# Imperative creation commands

> For the complete documentation index, see [llms.txt](https://docs.ringleader.dev/llms.txt).


> kubectl-style generators that build a canonical object from flags and apply it.


Every kind carries a minimal `rl <kind> create <name>`. A few also have a **rich
generator**, where `rl <kind> create` builds a complete object from flags and
applies it, so you do not have to write the manifest by hand for the common case.
There is no bespoke server endpoint behind this; the CLI generates an ordinary
object and applies it like any other.

## Print the object instead of creating it

Add `--dry-run`, `-o`, or both to any `rl <kind> create` to print the object as YAML
and create nothing. `-o yaml` is the default, and `-o json` prints JSON. Any other `-o`
value is a usage error, and the command exits 2.

The printed object is what the command would create, in the namespace it would use.
Save it to a file and `rl apply -f` creates the same object later:

```bash
rl ns create acme-engineering --org acme -l team=platform -o yaml > acme-engineering.yaml
rl apply -f acme-engineering.yaml
```

`-o` on a create command never writes anything. That differs from `rl apply -o yaml`,
which applies the file first and then prints the stored object. An older `rl` created the
object when you passed `-o json`, so a script that relied on that now needs to drop the flag.

## `rl namespace create <name>`

Create a Namespace in an org. Alias: `ns`.

```bash
rl namespace create acme-engineering --org acme
rl ns create acme-engineering --org acme -l team=platform
rl ns create acme-engineering --org acme --dry-run -o yaml
```

A namespace belongs to the org that `--org` names. If you can see only one org,
leave out `--org` and the command uses that org, naming it on stderr. If you can see
several orgs, the command stops before it creates anything and asks you for `--org`.
A global admin has no default org, so pass `--org` to put the namespace in one.

If you are an org admin, name a new namespace after its org: `<org>` or `<org>-<name>`,
such as `acme` or `acme-engineering`. The server refuses any other name, and its error
suggests one that starts with `<org>-`. When one org's name starts with another's, such
as `acme-labs` and `acme`, a name like `acme-labs-dev` is valid in both orgs.

A global admin can use any name, and can pass `--org ""` to create a namespace that
belongs to no org. The name rule applies only when you create a namespace, so a
namespace that already exists keeps its name.

| Flag | Description |
|------|-------------|
| `--org <org>` | The org that owns the namespace. Defaults to your org when you can see only one. |
| `-l, --labels <name=value>` | Labels (repeatable or comma-separated). |
| `--dry-run` | Print the generated object instead of applying it. |
| `-o, --output <format>` | `yaml` (default) or `json`. Prints the object and creates nothing. |
| `--as <subject>` | Impersonate a subject. |
| `--home <dir>` | Data directory. |

## `rl secret create <name>`

Create a Secret. Ringleader copies a Secret to every origin of its namespace, except a
Ringleader-only one, and masks its values wherever it shows them. That includes a preview,
which prints `***` for each value and says on stderr that the values are masked.

```bash
rl secret create db \
  --from-string password=s3cret \
  --from-file ca.crt=./ca.pem \
  -n dev
rl secret create db --from-string password=s3cret --dry-run            # values print as ***
rl secret create db --from-string password=s3cret --dry-run --reveal   # values print as typed
```

A masked preview shows what you typed without exposing it, and applying it would store
`***`. To keep a Secret as a file you can apply, add `--reveal`. The file then holds the
values in clear text, so keep it out of version control.

| Flag | Description |
|------|-------------|
| `--from-string <name=value>` | Literal data (repeatable). |
| `--from-file <name=path>` | File content as data (repeatable). |
| `-l, --labels <name=value>` | Labels (repeatable or comma-separated). |
| `--dry-run` | Print the generated object instead of applying it. |
| `-o, --output <format>` | `yaml` (default) or `json`. Prints the object and creates nothing. |
| `--reveal` | With `--dry-run` or `-o`, print the real values instead of `***`. Without a preview it exits 2. |
| `--ringleader-only` | Make the Secret Ringleader-only: nobody can read its values back, and only Ringleader uses them, to add a key to a request. You can set this only when you create the Secret. See [Ringleader-only Secrets](https://docs.ringleader.dev/security/credentials/secret-handling/#ringleader-only-secrets). |
| `-n, --namespace <ns>` | Namespace. |
| `--as <subject>` | Impersonate a subject. |
| `--home <dir>` | Data directory. |

<div class="callout callout-note">
  <p class="callout-title">Note</p>
  <div class="callout-body">
    <code>--from-file</code> reads the file content <strong>client-side</strong> and stores it as Secret data. The
content reaches disk as part of a YAML file only if you save a <code>--reveal</code> preview.
  </div>
</div>


## `rl workstation create <name>`

Create a Workstation. Alias: `ws`. The flags below are enough to make a workstation that
comes up, on your machine or in a cloud.

```bash
rl workstation create my-box
rl ws create my-box --image debian-13 --cpus 4 --memory 8 --disk 60
rl ws create my-box --provider gcp --machine-type e2-standard-4 -l cloud=gcp --wait
rl ws create my-box --config ide -l tier=dev --dry-run -o yaml   # print, don't apply
```

| Flag | Description |
|------|-------------|
| `--config <name>` | WorkstationConfig to apply (repeatable). |
| `--provider <name>` | Place the workstation on this provider by adding a `provider:<name>` requirement. Omit it and Ringleader chooses. |
| `--requirement <req>` | Add a capability requirement such as `provider:gcp` (repeatable). It comes after the `--provider` requirement. Two different `provider:` requirements exit 2. |
| `--image <distribution>[-<version>]` | Base image. `debian-13` sets the distribution `debian` and the version `13`. A bare `debian` sets only the distribution. `debian-` exits 2. |
| `--cpus <n>` | vCPUs of a local workstation. |
| `--memory <GiB>` | RAM of a local workstation, in GiB. |
| `--disk <GiB>` | Disk size, in GiB. |
| `--machine-type <type>` | Machine type of a cloud workstation, such as `e2-standard-4`. Needs `gcp`, `aws` or `azure` named by `--provider` or a `provider:` requirement. |
| `--wait` | After creating, wait until the workstation is Ready or has failed. |
| `--timeout <duration>` | With `--wait`, how long to wait. Default `20m`; `0` waits without a limit. |
| `-l, --labels <name=value>` | Labels (repeatable or comma-separated). |
| `--dry-run` | Print the generated object instead of applying it. |
| `-o, --output <format>` | `yaml` (default) or `json`. Prints the object and creates nothing. |
| `-n, --namespace <ns>` | Namespace. |
| `--as <subject>` | Impersonate a subject. |
| `--home <dir>` | Data directory. |

### Image

A workstation's own `image` replaces the whole `image` block of its configs. If a
WorkstationConfig also names an image, give both halves, as in `--image debian-13`,
or the version from the config is dropped.
[Operating system images](https://docs.ringleader.dev/workstations/configuration/provider-settings/#operating-system-images)
says which version a provider picks when you give only a distribution.

### Size

`--cpus`, `--memory` and `--disk` take whole numbers greater than zero. What they set
depends on the provider you name, with `--provider` or a `provider:` requirement:

| Provider named | `--cpus`, `--memory` | `--disk` | `--machine-type` |
|----------------|----------------------|----------|------------------|
| none, or a local provider | `providerConfig.cpus`, `providerConfig.memory` | `providerConfig.disk` | exits 2 |
| `gcp` | exit 2 | `providerConfig.gcp.diskGiB` | `providerConfig.gcp.machineType` |
| `aws` | exit 2 | `providerConfig.aws.rootVolumeGiB` | `providerConfig.aws.instanceType` |
| `azure` | exit 2 | `providerConfig.azure.osDiskGiB` | `providerConfig.azure.size` |

A cloud provider is sized by its machine type, so the error for `--cpus` or `--memory`
points you at `--machine-type`. The qemu, vz and hcs providers read the local
keys, which the [Provider images and keys](https://docs.ringleader.dev/reference/providers/images-keys/) page describes
for each of them. A CloudIdentity's `defaultProviderConfig` gives way to these flags, and
its `overrideProviderConfig` wins over them.

### Wait behavior

Without `--wait`, the command returns as soon as the workstation is written, and a
workstation that later fails says so only in its status. With `--wait`, the command waits
for Ready, or for a failure. It exits 1 on a failure and prints what to change. It waits
the way [`rl workstation wait`](https://docs.ringleader.dev/reference/cli/commands/resource-verbs/#rl-kind-wait-name) does.
`--wait` with `--dry-run` or `-o` exits 2, because nothing is written to wait for.

A cloud workstation in the `local` namespace is refused unless this device runs that
provider, because the `local` namespace stays on this device. Pick another namespace with
`-n`, or log in to a control plane that runs the provider. A preview is never refused.

## `rl configmap create <name>`

Create a ConfigMap: text that a config's `scripts` and `files` can reference. Alias: `cm`.

```bash
rl configmap create bootstrap --from-file setup.sh=./setup.sh
```

It takes `--from-file`, `--from-string` and `-l` the way `secret create` does, and its
values are not masked. The flags are listed in the
[ConfigMap reference](https://docs.ringleader.dev/reference/resources/configmap/#cli).

## `rl sshkey create <name>`

Create an SSHKey, which forwards a local private key into matching workstations.

```bash
rl sshkey create github --path ~/.ssh/id_ed25519
```

The flags are listed in the
[SSHKey reference](https://docs.ringleader.dev/reference/resources/sshkey/#create-a-key-from-the-command-line).

