# Workstation access

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


> Start, stop, connect to, and diagnose a workstation from the command line.


These commands manage a workstation's lifecycle and connect to a running one. Each of
the access commands, `shell`, `tmux`, `logs`, `troubleshoot` and `code`, also runs under
the workstation group, so `rl workstation shell my-box` is the same command as
`rl shell my-box`. `shell`, `tmux`, `logs` and `troubleshoot` read the workstation's
address and login user from its status.

On a [node-bound workstation](https://docs.ringleader.dev/workstations/basics/#node-bound-workstations), those five
commands work only on the computer that runs it, which reads the address from its own records
instead of from status. On any other device they refuse and name that
computer, while `start`, `stop`, `restart` and `delete` work from anywhere.

When you omit the name, `shell` and `tmux` choose a workstation for you if exactly one fits,
as
[Workstation choice for shell and tmux](https://docs.ringleader.dev/workstations/connectivity/shells-remote-commands/#workstation-choice-for-shell-and-tmux)
explains. Otherwise they list the candidates and stop. Name the one you want with `-w`, or add
`-A` to look in every namespace.

`rl shell` chooses a workstation only when you give it no command. With a command and no `-w`,
it reads the first word as the workstation's name, so name the workstation first or with `-w`:
`rl shell -w my-box -- make test`.

## `rl workstation start` / `stop` / `restart`

Stop, start or restart one or more workstations. The commands set `spec.stopped`, and for
`restart` also `spec.restartNonce`, as
[Starts, stops and restarts](https://docs.ringleader.dev/workstations/lifecycle/starts-stops-restarts/)
explains. Target workstations by name, several names, or a label selector with `-l`. Alias:
`ws`.

```bash
rl workstation start my-box
rl workstation stop my-box other-box
rl ws stop -l tier=dev            # every matching workstation
rl workstation restart my-box
rl ws restart -l tier=dev         # one logical restart across the whole set
```

Each command returns once Ringleader accepts the request. Add `--wait` to wait until the
change is done. For `start` and `restart` that means `Ready`. For `stop` it means `Stopped`,
which Ringleader records only once the provider confirms the workstation is down.

```bash
rl workstation start my-box --wait              # returns when my-box is Ready
rl workstation stop my-box --wait --timeout 2m
```

| Flag | Description |
|------|-------------|
| `-l, --selector <selector>` | Label selector (`key=value[,key!=value,key in (a,b),key,!key]`) instead of name(s). |
| `--wait` | Block until each workstation the command moved is `Ready` (`start`, `restart`) or `Stopped` (`stop`). |
| `--timeout <duration>` | With `--wait`, how long to wait. Default `20m`; `0` means no limit. |
| `-n, --namespace <ns>` | Namespace. |
| `-A, --all-namespaces` | Operate across all namespaces. |
| `--as <subject>` | Impersonate a subject. |
| `--home <dir>` | Data directory. |

## `rl workstation cordon` / `uncordon`

Take a workstation pool member out of service, or put it back, as
[Take a member out of service](https://docs.ringleader.dev/workstations/lifecycle/pools-leases/#take-a-member-out-of-service)
describes. Target members by name, several names, or a label selector with `-l`.

```bash
rl workstation cordon agents-linux-e5f6a7b8
rl workstation cordon -l app=agent-runner
rl workstation uncordon agents-linux-e5f6a7b8
```

```text
workstation/agents-linux-e5f6a7b8 cordoned
workstation/agents-linux-e5f6a7b8 unchanged: already cordoned
```

The verb writes an annotation on the workstation, so whoever may update the workstation may
cordon it: the pool's owner, who owns every member, and a namespace admin. On a workstation
outside a pool the annotation changes nothing.

| Flag | Description |
|------|-------------|
| `-l, --selector <selector>` | Label selector (`key=value[,key!=value,key in (a,b),key,!key]`) instead of name(s). |
| `-n, --namespace <ns>` | Namespace. |
| `-A, --all-namespaces` | Operate across all namespaces. Combine it with `-l`, not with names. |
| `--as <subject>` | Impersonate a subject. |
| `--home <dir>` | Data directory. |

## `rl workstation release-finalizer <name>`

Remove the record of a workstation stuck in `Terminating`, without deleting its virtual
machine. Only a namespace administrator can run it.
[Release a workstation stuck in Terminating](https://docs.ringleader.dev/workstations/lifecycle/deletion-deadlines/#release-a-workstation-stuck-in-terminating)
gives the steps and says when to use it.

```bash
rl workstation release-finalizer my-box \
    --acknowledge-orphaned-machine my-box-7f3a91
```

| Flag | Description |
|------|-------------|
| `--acknowledge-orphaned-machine <machine>` | **Required.** The machine that may be left running. Shown in the refusal if omitted. |
| `-n, --namespace <ns>` | Namespace. |
| `--as <subject>` | Impersonate a subject. |
| `--home <dir>` | Data directory. |

## `rl workstation orphan [name]`

List the [node-bound workstations](https://docs.ringleader.dev/workstations/basics/#node-bound-workstations) this
computer still runs for control planes it is no longer logged in to, such as one you logged out
of or switched away from. With a name, keep that VM and its disk as an
[orphaned workstation](https://docs.ringleader.dev/workstations/lifecycle/orphaned-workstations-recovery/#orphaned-workstations):
an ordinary workstation stored on this computer, which you can then use or delete. The daemon must
be running.

```bash
rl workstation orphan
rl workstation orphan dev -n team
```

| Flag | Description |
|------|-------------|
| `--url <url>` | The old Ringleader service's URL, when two of them hold a workstation of the same namespace and name. |
| `-n, --namespace <ns>` | Namespace. |
| `--as <subject>` | Impersonate a subject. |
| `--home <dir>` | Data directory. |

## `rl workstation adopt <name>`

Run a node-bound workstation on this computer again after the computer lost its record of it, the
file `state.db` in its data directory. The daemon must be running.
[Adopt a workstation after your computer loses its records](https://docs.ringleader.dev/workstations/lifecycle/orphaned-workstations-recovery/#adopt-a-workstation-after-your-computer-loses-its-records)
explains it.

```bash
rl workstation adopt dev -n team
```

```text
workstation/dev is now managed on this device through qemu
```

| Flag | Description |
|------|-------------|
| `--machine <name>` | The name of the virtual machine a workstation runs on that an earlier release moved with `rl workstation move`, when this computer no longer records it. Any other workstation's virtual machine is found without it. |
| `--provider <provider>` | The provider that has the virtual machine, when more than one does. |
| `-y, --yes` | Confirm the name given with `--machine` without a prompt. |
| `-n, --namespace <ns>` | Namespace. |
| `--as <subject>` | Impersonate a subject. |
| `--home <dir>` | Data directory. |

## `rl workstation get-resolved-configuration <name>`

Print the merged effective configuration a workstation resolves to: the
answer to "what configuration will my workstation actually get?".

```bash
rl workstation get-resolved-configuration my-box
rl ws get-resolved-configuration my-box -o json
```

[Configuration merging and resolution](https://docs.ringleader.dev/workstations/configuration/configuration-merging-resolution/) explains where the answer
comes from and how to read it.

| Flag | Description |
|------|-------------|
| `-o, --output <format>` | `yaml` (default) or `json`. |
| `-n, --namespace <ns>` | Namespace. |
| `--as <subject>` | Impersonate a subject. |
| `--home <dir>` | Data directory. |

The document has these top-level keys:

| Key | Description |
|-----|-------------|
| `workstation` | `<namespace>/<name>`, so a pasted document says what it is about. |
| `effectiveConfigHash` | The configuration fingerprint the control plane wants, read from `status.config.effectiveHash`. Empty means the workstation has not been set up yet. |
| `appliedConfigs` | Each config that shaped the workstation, with its `name`, its `source` and its `priority`. `source` is `explicit` for a `spec.configs[]` reference and `selector` for a label match. A lower priority applies first, so a higher priority wins. A config that targets the workstation but was dropped is listed too, with `refused: true` and a `reason` such as `author-lacks-reach` or `configmap-key-not-found`. |
| `effective` | The whole merged spec, including everything status never carried: `environment`, `files`, `scripts`, `sources`, `devtools`, `toolconfigs`, and `dotfiles`. |
| `configCurrency` | `current` when the workstation's `Configured` condition was computed from its configuration as it is now. `stale` when the workstation or one of its configs has changed since. |
| `configCurrencyAt` | The workstation's `metadata.resourceVersion` that `configCurrency` was computed against. |
| `cloudIdentity` | The [CloudIdentity](https://docs.ringleader.dev/reference/resources/cloudidentity/) whose selector matches the workstation, or `<none matched>`. Absent for a local provider. |

```yaml
appliedConfigs:
- name: ai-box
  priority: 200
  source: explicit
- name: base
  priority: 100
  source: selector
configCurrency: current
effective:
  devtools:
  - name: nodejs
  packages:
  - git
  shell: /bin/bash
  uid: 1000
  user: dev
effectiveConfigHash: 8f2c1a9e4d6b...
workstation: local/my-box
```

## `rl shell [workstation] [command...]`

Open a shell on a workstation over SSH using the node key.

```bash
rl shell my-box                 # interactive shell
rl shell my-box -- uname -a     # run a remote command
rl shell                        # the sole Ready workstation
```

| Flag | Description |
|------|-------------|
| `-w, --workstation <name>` | Target workstation. Defaults to the sole `Ready` one; required when several are. |
| `-n, --namespace <ns>` | Namespace. |
| `-A, --all-namespaces` | Look for the workstation in every namespace you can reach. |
| `--start` | Start the workstation first if it is stopped, and wait until it is `Ready`. See [Start a workstation as you connect](https://docs.ringleader.dev/workstations/connectivity/shells-remote-commands/#start-a-workstation-as-you-connect). |
| `--start-timeout <duration>` | With `--start`, how long to wait. Default `20m`; `0` means no limit. |
| `--pty` | Give the command a terminal. See [Terminal for a remote command](https://docs.ringleader.dev/workstations/connectivity/shells-remote-commands/#terminal-for-a-remote-command). |
| `--script <file>` | Run this local script file on the workstation. See [Local script files](https://docs.ringleader.dev/workstations/connectivity/shells-remote-commands/#local-script-files). |
| `--copy <dir>` | Send this local directory along with `--script`. |
| `--exit-code-file <path>` | Write the remote command's exit code to this file. See [Shell exit codes](#shell-exit-codes). |
| `--host` | Run a command or `--script` on the workstation's VM instead of inside its dev container. It needs a command. For a shell on the VM, use the `<user>-host` login described in [Devcontainer shell and file locations](https://docs.ringleader.dev/workstations/packages-tools-settings/devcontainers/#devcontainer-shell-and-file-locations). |
| `--as <subject>` | Impersonate a subject. |
| `--home <dir>` | Data directory. |

Arguments after `--` are the remote command's **argv**, delivered word for word; with
none, you get an interactive shell. A `git` command in a remote command signs with your
forwarded key, as
[SSH agent in every session](https://docs.ringleader.dev/workstations/connectivity/git-ssh-keys/#ssh-agent-in-every-session)
explains.

### Shell exit codes

The remote command's exit code passes through unchanged. When Ringleader itself fails,
`rl shell` exits `1` if it could not find or reach the workstation. It exits `2` for a
usage error, or when it could not choose one workstation for you. An ssh connection failure
exits `255`. So `1` and `2` can mean either a remote failure or a Ringleader one.

`--exit-code-file` tells them apart without reading stderr. The file is written only if the
remote command ran, and it holds that command's exit code. An absent file means Ringleader
failed. A file already at that path is removed first.

```bash
rl shell my-box --exit-code-file /tmp/ec --script ./ci.sh
[ -f /tmp/ec ] || exit 75          # never ran: retry rather than report a result
exit "$(cat /tmp/ec)"              # the remote command's own exit code
```

[Shells and remote commands](https://docs.ringleader.dev/workstations/connectivity/shells-remote-commands/)
explains how the arguments reach the workstation and what the command's environment holds. It
also shows how to run a terminal command, a local script file or a persistent session.

## `rl file cp [-r] <src> <dst>`

Copy a file or directory between your computer and a workstation. One side is a local
path, the other is `workstation:path`, in the style of `scp`:

```bash
rl file cp ./local.txt my-box:/remote/path     # upload
rl file cp my-box:/remote/path ./local.txt     # download
rl file cp -r ./dir my-box:/remote/dir         # a whole directory, either way
rl file cp ./notes.md :/tmp/notes.md            # empty name: the workstation rl shell would pick
rl file cp ./notes.md my-box:                  # empty path: the login user's home directory
```

[File transfer](https://docs.ringleader.dev/workstations/connectivity/file-transfer/) explains how Ringleader
tells a local path from a remote one, where a copy lands and what a failed copy leaves
behind.

| Flag | Description |
|------|-------------|
| `-r, --recursive` | Copy a directory and everything under it. Required for a directory, refused for anything else, in both directions. |
| `--host` | Copy to and from the workstation's VM rather than the dev container it hosts. |
| `-n, --namespace <ns>` | Namespace. |
| `-A, --all-namespaces` | Look across every namespace. |
| `--as <subject>` | Impersonate a subject. |
| `--home <dir>` | Data directory. |

## `rl ssh-config`

Manage the one `Include` line in your `~/.ssh/config` that
[Ringleader's SSH configuration](https://docs.ringleader.dev/workstations/connectivity/editors-ssh/#ringleaders-ssh-configuration)
depends on. The command reads and edits
files on your machine only, so it needs no sign-in and no running daemon. The
Ringleader desktop app runs it for you, from the onboarding step **Set up ssh for
workstations** and the Settings switch **Reach workstations with standard `ssh`**. It is
kept out of `rl --help`, and `rl ssh-config --help` describes it.

```bash
rl ssh-config              # print the Include line for this data directory
rl ssh-config install      # put the line at the top of ~/.ssh/config, or move it back there
rl ssh-config status       # installed, not installed, or installed in the wrong place
rl ssh-config check        # the same report, exiting 1 when something is wrong
rl ssh-config uninstall    # remove the line and nothing else
```

Every form takes `--home <dir>` to name a different data directory. `status` also
takes `-o json`. A bare `rl ssh-config` and `rl ssh-config print` do the same thing.
On Windows the file is `%USERPROFILE%\.ssh\config`, which the Windows OpenSSH client
reads.

### Block added by `install`

`rl ssh-config install` adds three lines at the very top of `~/.ssh/config`, above
every other line in the file:

```
# BEGIN ringleader-managed - DO NOT EDIT (managed by `rl ssh-config`)
Include /Users/you/.ringleader/ssh/config
# END ringleader-managed
```

The path is your data directory's, written in full. That is `~/.ringleader/ssh/config`
on a Mac or `%USERPROFILE%\.ringleader\ssh\config` on Windows, unless `RINGLEADER_HOME`
or `--home` names another directory. The file it includes is the configuration the
daemon writes, described in
[Ringleader's SSH configuration](https://docs.ringleader.dev/workstations/connectivity/editors-ssh/#ringleaders-ssh-configuration).

When `~/.ssh` or the config file does not exist, `install` creates them. An existing
file keeps its permissions, its other lines and its line endings. The command prints
what it did, then the line it wrote, then the notes described under `status` below:

```text
Added the Ringleader include to /Users/you/.ssh/config.
  Include /Users/you/.ringleader/ssh/config

Standard ssh, scp, rsync, git and VS Code Remote-SSH now reach your workstations by name.
  - the included config is regenerated by `rl daemon`; with the daemon stopped it freezes, and OpenSSH's ControlPersist can hold a master open against a stale address for ~5 minutes after a box moves
```

Running it again when the block is already in place changes nothing, and the first
line reads `Already installed in /Users/you/.ssh/config (no change).` instead.

### `status` output

`rl ssh-config status` names the two files it compares and the state of the block,
then lists each problem with a `!` and each note with a `-`:

```text
Your config:     /Users/you/.ssh/config
Managed config:  /Users/you/.ringleader/ssh/config
State:           installed
  - the included config is regenerated by `rl daemon`; with the daemon stopped it freezes, and OpenSSH's ControlPersist can hold a master open against a stale address for ~5 minutes after a box moves
```

The state is one of these:

- `installed`: the block is at the top of the file and includes this data directory's
  config.
- `not installed`: there is no block, or no `~/.ssh/config` at all.
- `installed, but BELOW other directives (ssh may offer the wrong key)`: another
  setting in the file comes before the block. Comments and blank lines above it do not
  count. See [Position of the include](https://docs.ringleader.dev/workstations/connectivity/editors-ssh/#position-of-the-include).
- `installed, but pointing at another data directory`: the block includes a different
  data directory's config, which happens when `RINGLEADER_HOME` changed after it was
  installed.

`-o json` prints the same report as JSON. Its `state` is `installed`, `not-installed`
or `misplaced`, where `misplaced` covers both wrong-place cases above.

Two notes appear whenever they apply, and neither counts as a problem:

- An alias collision. Every workstation gets a `Host` entry under its bare name, and
  the block comes first. So `ssh dev` reaches a workstation called `dev` even when your
  config has its own `Host dev`. The note names each such workstation. Reach your own
  host some other way, or address the workstation as `dev.<namespace>.ringleader`.
- A hand-written `Include` of the same path outside the block. It is harmless, and
  `uninstall` leaves it in place.

A third note is always printed: the daemon rewrites the included config, so it freezes
when the daemon stops, and a multiplexed `ssh` connection can keep an old address for
about five minutes after a workstation moves.

### A misplaced include

When the block sits below your own settings, `rl ssh-config install` moves it back to the top
and says so:

```text
Repaired the Ringleader include in /Users/you/.ssh/config (it now sits above every other directive).
```

[Position of the include](https://docs.ringleader.dev/workstations/connectivity/editors-ssh/#position-of-the-include)
explains why the position matters.

### `check`

`rl ssh-config check` prints the same report as `status`, then exits `1` unless the
state is `installed`, repeating each problem on standard error. Use it in a script, or
before a command that needs the include:

```bash
rl ssh-config check && ssh my-box
```

An alias collision and a hand-written duplicate are notes, so neither fails the check.

### `uninstall`

`rl ssh-config uninstall` removes the three lines and nothing else. `rl shell` and
`rl tmux` keep working, because they hand the daemon's config to `ssh` directly. When
there is no block to remove it says so and exits `0`.

| Flag | Description |
|------|-------------|
| `--home <dir>` | Data directory. Every form takes it. |
| `-o, --output <format>` | `status` only: `text` (default) or `json`. |

## `rl code [workstation]`

Open a workstation in a desktop editor over Remote-SSH: VS Code, Cursor, or VS Code
Insiders. Also available as `rl workstation code`.

```bash
rl code my-box
rl code my-box --editor cursor
rl code my-box --path /home/dev/other-repo
rl code my-box --print            # show the command, launch nothing
```

The folder opened is the first `spec.sources` path of the resolved configuration, and `--path`
overrides it. Remote-SSH needs Ringleader's `Include` in your `~/.ssh/config`, which
[`rl ssh-config install`](#rl-ssh-config) adds.
[The rl code command](https://docs.ringleader.dev/workstations/connectivity/editors-ssh/#the-rl-code-command)
explains the editor choice, why `rl code` exits with status `3` when `ssh` can't find the
workstation, the Remote - SSH extension and the first connection.

| Flag | Description |
|------|-------------|
| `-w, --workstation <name>` | Workstation to open (defaults to the sole `Ready` one; required when several are). |
| `--editor <name>` | `code`, `cursor`, or `code-insiders`. Default: autodetect in that order. |
| `--path <dir>` | Absolute folder to open on the workstation, overriding the resolved source path. |
| `--print` | Print the command that would run, one argument per line, and launch nothing. |
| `-n, --namespace <ns>` | Namespace. |
| `-A, --all-namespaces` | Resolve across all namespaces. |
| `--as <subject>` | Impersonate a subject. |
| `--home <dir>` | Data directory. |

## `rl tmux [workstation]`

Attach to a persistent `tmux` session on the workstation (`tmux new-session -A -s
ringleader`). [Persistent sessions with tmux](https://docs.ringleader.dev/workstations/connectivity/shells-remote-commands/#persistent-sessions-with-tmux)
explains the session and how it reconnects.

```bash
rl tmux my-box
```

| Flag | Description |
|------|-------------|
| `-w, --workstation <name>` | Target workstation. Defaults to the sole `Ready` one; required when several are. |
| `--start` | Start the workstation first if it is stopped, and wait until it is `Ready`. See [Start a workstation as you connect](https://docs.ringleader.dev/workstations/connectivity/shells-remote-commands/#start-a-workstation-as-you-connect). |
| `--start-timeout <duration>` | With `--start`, how long to wait. Default `20m`; `0` means no limit. |
| `-n, --namespace <ns>` | Namespace. |
| `-A, --all-namespaces` | Look for the workstation in every namespace you can reach. |
| `--as <subject>` | Impersonate a subject. |
| `--home <dir>` | Data directory. |

## `rl logs <workstation>`

Stream the in-VM `ringleader-agent` logs (or a managed service's logs), like
`kubectl logs`. It automatically picks the systemd journal or the durable
log file on the workstation.

```bash
rl logs my-box -f                 # follow
rl logs my-box --tail 200
rl logs my-box --since 30m
rl logs my-box --source service:code-server
```

| Flag | Description |
|------|-------------|
| `-f, --follow` | Stream new lines as they arrive. |
| `--tail <N>` | Show only the last N lines (`0` = all). |
| `--since <duration>` | Window to show (e.g. `30m`, `1h`; journal only). |
| `--source <source>` | `agent` (default) or `service:<name>`. |
| `-n, --namespace <ns>` | Namespace. |
| `--as <subject>` | Impersonate a subject. |
| `--home <dir>` | Data directory. |

## `rl troubleshoot <workstation>`

Diagnose one workstation. The report has these sections, in this order:

- The controller view: phase, conditions, last update, and the
  [ambient SSH agent](https://docs.ringleader.dev/workstations/connectivity/git-ssh-keys/#ssh-agent-in-every-session)
  when its delivery fell short.
- For a workstation with an egress policy, an `egress` section. It shows the rule set the
  workstation runs, the destinations it permits, and any it could not enforce. It names the
  edge VM on your machine that serves the workstation, when there is one. When it can, it
  also tests from inside the workstation which destinations answer. It lists the connections
  the workstation was refused in the last 24 hours, newest first, up to 10 rows. When there are
  any, it ends with the [`rl workstation egress`](#rl-workstation-egress-workstation) command
  that lists the rest.
- The port forwarding on your machine: the LocalBindings that forward from the
  workstation, or a note that none does.
- Live system probes: OS, docker, disk, user, agent and ssh-agent-env.
- The in-VM agent's provisioning timeline.

Run with **no workstation** to dump *local* status (daemon, origins/auth, version,
host) instead. Either form takes `--diagnostics` to write a zip you can send for support.
With no workstation, the zip describes only your computer. With a workstation, it adds
that workstation and the records it uses. Add `--all` instead of a workstation to include
every workstation and related record you can read.
[Bundle contents](https://docs.ringleader.dev/troubleshooting/#bundle-contents) says what each zip holds,
and [Bundle privacy](https://docs.ringleader.dev/troubleshooting/#bundle-privacy) says what it leaves out
and what to check before you send it.

For the whole diagnosis workflow, and how to capture and share a bundle from the
desktop apps, see the [Troubleshooting](https://docs.ringleader.dev/troubleshooting/) section
and [Prepare a diagnostics bundle](https://docs.ringleader.dev/troubleshooting/#prepare-a-diagnostics-bundle).

```bash
rl troubleshoot                          # local status to stdout
rl troubleshoot my-box                   # diagnose one workstation
rl troubleshoot my-box --failed          # only failed steps
rl troubleshoot my-box --kind devtool --since 1h
rl troubleshoot my-box --json            # machine-readable ledger
rl troubleshoot --diagnostics            # local-only zip
rl troubleshoot --all --diagnostics      # zip with every workstation and related record
rl troubleshoot my-box --diagnostics=out.zip
rl troubleshoot my-box --diagnostics --secret-keys   # also list each Secret's key names
rl troubleshoot my-box --report-only     # only the in-VM diagnostic ledger
rl troubleshoot --diagnostics --log-since=6h   # reach 6 hours back in the daemon log
```

The bundled daemon log is trimmed to a byte budget, so a bundle captured a while after
an incident can carry a window that begins *after* it. The covered wall-clock range is
printed when the zip is written and recorded inside it. Check it against the time you
are reporting, and use `--log-since` to reach further back. (`--log-since` moves the
daemon log; `--since` filters a workstation's in-VM timeline.)

| Flag | Description |
|------|-------------|
| `--diagnostics[=PATH]` | Write a self-contained diagnostics zip (default `./ringleader-diagnostics-<timestamp>.zip`). |
| `--all` | With `--diagnostics`: include every workstation you can read, and every session, worktree set, configuration, ConfigMap, Integration, Edge, pool, lease and policy you can read, whether or not a workstation uses it. An error without `--diagnostics` or with a workstation name. |
| `--secret-keys` | With `--diagnostics`: list the key names of each Secret in the zip's Secret list, which a zip for a workstation or for `--all` has. An error without `--diagnostics`. |
| `--failed` | Show only failed timeline steps. |
| `--kind <kind>` | Filter the timeline by kind (`user`, `package`, `devtool`, `tool-config`, `script`, `security-update`, `self-update`). |
| `--target <substring>` | Filter the timeline by target (substring match). |
| `--since <duration>` | Steps started within this window (e.g. `30m`, `1h`). |
| `--reconcile latest` | Show only the steps from the most recent configuration pass. |
| `--log-since <duration>` | With `--diagnostics`: make the bundled daemon log reach at least this far back in wall clock (e.g. `90m`, `6h`), across rotated segments. |
| `--limit <N>` | Show only the most recent N steps (`0` = remote default). |
| `--report-only` | Print **only** the in-VM diagnostic ledger (no controller view or host probes). |
| `--json` | Emit the in-VM diagnostic ledger report as JSON. |
| `-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>rl troubleshoot &lt;workstation&gt; --report-only</code> pulls just the in-VM diagnostic
ledger over the daemon&rsquo;s SSH connection (no controller view or host probes) and
renders it with the same formatter the in-VM agent uses.
  </div>
</div>


## `rl workstation egress [workstation]`

List what a workstation's Edge recorded: the connections it refused, the connections it let
through, what it did with each Integration's credential, or the bytes and connections it carried
each day. Use it to find out why a workstation cannot reach a destination, to see what it did
reach, to turn that into a `strict` egress policy, and to see how much traffic it moved.
[Connection records and traffic totals](https://docs.ringleader.dev/security/outbound/connection-records/) says what each record holds, who can read it and
what the totals mean.

```bash
rl workstation egress dev-box                  # what was refused for dev-box, last 7 days
rl workstation egress                          # the same for every workstation you may read
rl workstation egress dev-box --since 24h      # the last day
rl workstation egress dev-box --allowed        # what dev-box reached
rl workstation egress dev-box --suggest        # a strict policy for what dev-box reached
rl workstation egress dev-box --credentials    # credential use, per Integration and host
rl workstation egress dev-box --totals         # bytes and connections per day, with no destinations
```

Each call lists one kind of record. Pass at most one of `--denied`, `--allowed`,
`--credentials` and `--totals`. More than one is a usage error.

| Flag | Description |
|------|-------------|
| `--denied` | List refused connections. This is the default. |
| `--allowed` | List allowed connections, for a workstation that records them. |
| `--credentials` | List credential use per Integration and host. |
| `--totals` | List each day's bytes and connections, with no destinations. See [Daily totals](https://docs.ringleader.dev/security/outbound/connection-records/#daily-totals). |
| `--suggest` | Print a `strict` egress policy built from the allowed connections. See [Suggest a policy](#suggest-a-policy). |
| `--since <when>` | Start of the window: a duration back from now, such as `24h` or `168h`, or an RFC 3339 time. Default: 7 days ago. |
| `--until <when>` | End of the window, in the same forms as `--since`. Default: now. |
| `--json` | Print the rows as JSON. |
| `-n, --namespace <ns>` | Namespace. |
| `--as <subject>` | Impersonate a subject. |
| `--home <dir>` | Data directory. |

### Window and retention

Records are counted per UTC day, and the window starts on the day that holds `--since`.
[Record retention](https://docs.ringleader.dev/security/outbound/connection-records/#record-retention) says how
long they last. [Record access](https://docs.ringleader.dev/security/outbound/connection-records/#record-access)
says who may read which workstation's records. With no workstation name, the command reads both
places a workstation's records can be kept, and adds a `FROM` column and a `BOX` column. Steps in
[Connection records and traffic totals](https://docs.ringleader.dev/security/outbound/connection-records/#read-a-workstations-connection-records)
explain them.

### Egress list columns

Each kind of record has its own table. The allowed connections table has one row per day,
destination and port, with these columns:

| Column | Meaning |
|--------|---------|
| `DAY` | The UTC day. |
| `DESTINATION` | The name the Edge read off the connection, or the address when it read no name. |
| `CONNECTIONS` | How many connections the Edge let through. |
| `BYTES OUT` | Bytes the workstation sent. |
| `BYTES IN` | Bytes the workstation received. |

The `--totals` table has one row per workstation and day, with these columns:

| Column | Meaning |
|--------|---------|
| `DAY` | The UTC day. |
| `OUT CONNS`, `OUT EGRESS`, `OUT INGRESS` | Connections the workstation opened, and the bytes that left and entered it on them. |
| `IN CONNS`, `IN EGRESS`, `IN INGRESS` | Connections opened to the workstation, and the bytes that left and entered it on them. |
| `TOTAL EGRESS`, `TOTAL INGRESS` | The day's bytes that left and entered the workstation, on connections in both directions. |
| `SOURCE` | `edge` for what an Edge counted, or `box` for what the workstation reported about its own network interface. |

A `box` row appears only for a day with no Edge count. It shows `-` in the six `OUT` and `IN`
columns. [Two byte counts](https://docs.ringleader.dev/security/outbound/connection-records/#two-byte-counts) says why its numbers are only a
usage figure. The three `IN` columns read `not counted` for a workstation whose records
are kept on this computer, and for any day on which all three are zero: an Edge that counted no
inbound connections and an Edge that does not count them look the same.

One read returns at most 1,000 rows. When the window holds more, the command says so on standard
error, and you narrow it with `--since` and `--until`. A row that reads `other destinations`
counts what a workstation reached after it passed its limit for the day, and a note under the
table says so.

An empty `--allowed` list does not prove that nothing was reached.
[Allowed connections](https://docs.ringleader.dev/security/outbound/connection-records/#allowed-connections) says when an empty list means
recording is off.

`--json` prints the same rows, each with the `from` it was read from. When a named workstation
has no records because nothing keeps them, `notRecorded` says why.

### Suggest a policy

`--suggest` turns what a workstation reached into a `strict` policy. It needs exactly one
workstation name, and it cannot be combined with `--denied`, `--allowed`, `--credentials`,
`--totals` or `--json`. Either mistake is a usage error.

```bash
rl workstation egress dev-box --suggest > egress.yaml
```

The command writes the `egress` block as YAML on standard output, and its notes on standard
error, so the file holds only the policy.

- It keeps the destinations the workstation already declares, then adds each allowed connection
  they do not cover. It copies names and addresses exactly as the Edge recorded them.
- It leaves out a hostname on any port other than 80 and 443, and a note says how many. To reach
  such a host, declare its address range as a `cidr`.
- It reads one UTC day at a time. A note names a day that reached the row limit or holds an
  `other destinations` row, because the policy may then be incomplete.
- It uses the same default window as the other kinds, the last 7 days.
- It refuses when nothing was recorded, and when the workstation records no allowed connections.
  A workstation on hcs, vz or qemu that its own network process serves, and whose policy is not
  `audit`, records none.
- It refuses a [node-bound](https://docs.ringleader.dev/workstations/basics/#node-bound-workstations)
  workstation. Run `--allowed` on the computer that runs the workstation, and add the destinations
  to its policy yourself.

[Workstation reach audit](https://docs.ringleader.dev/security/outbound/reach-audit/)
walks from an `audit` policy to a `strict` one.

### Egress exit codes

| Code | Meaning |
|------|---------|
| `0` | At least one store answered, and none failed. |
| `1` | A read failed, no store answered, or the workstation does not exist. |
| `2` | A usage error: a flag combination, a time that does not parse, a `--since` that is not before `--until`, or no namespace. |

## `rl workstationpool`

Manage workstation pools, which [Pools and leases](https://docs.ringleader.dev/workstations/lifecycle/pools-leases/)
explains: sets of
workstations built from one template and leased out one at a time. The group has the generic verbs every
kind has (`get`, `describe`, `edit`, `copy`, `delete`, `wait`) plus the ones below. Aliases:
`wsp` for `workstationpool` and `wspl` for `workstationpoollease`.

`rl workstationpool describe` lists the pool's members and leases by name under its status.
`rl workstationpool delete` asks you to confirm, because it deletes every member's virtual
machine and disk, as [Delete a pool](https://docs.ringleader.dev/workstations/lifecycle/pools-leases/#delete-a-pool)
describes.

### `rl workstationpool create <name>`

Create a pool whose template is a copy of an existing workstation's configuration. To create
a pool and lease from it step by step, follow
[Lease a workstation from a pool](https://docs.ringleader.dev/guides/lease-pool-workstation/):

```bash
rl workstationpool create agents-linux --from-workstation ci-runner-1 --size-max 8
rl workstationpool create agents-linux --from-workstation ci-runner-1 --size-max 8 --warm-running 2 --recycle
rl workstationpool create agents-linux --from-workstation ci-runner-1 --size-max 8 --dry-run -o yaml
```

The workstation must be in the pool's namespace. The command copies its spec and labels, and
leaves out what the pool owns: the power and lifetime fields, the `pools.ringleader.dev/`
labels, and `spec.identity.authorizedKeys`, which would open every member to those keys. It
names each dropped field on stderr. A configuration that reached the workstation by selector,
and that would stop reaching a member someone else owns, is added to the template's `configs`
at the priority it applied at. The command warns when you are a person, because every device
you own can open a shell on every member, and with `--recycle`, because a recycled member keeps
whatever its last holder left. Both are advice, and the pool is created either way.

Check the template with `--dry-run -o yaml` before you create the pool, because
[Pool template and owner](https://docs.ringleader.dev/workstations/lifecycle/pools-leases/#pool-template-and-owner)
says who can read it. A name that is already taken fails, and nothing is written.

| Flag | Description |
|------|-------------|
| `--from-workstation <name>` | **Required.** The workstation whose configuration becomes the template. |
| `--size-max <n>` | **Required.** The most members the pool holds at once. |
| `--warm-running <n>` | Idle members to keep running and ready. |
| `--warm-stopped <n>` | Idle members to keep stopped and ready to start. |
| `--recycle` | Return a released member to the pool instead of deleting it. |
| `--dry-run` | Print the pool as a manifest instead of creating it. |
| `-o, --output <format>` | Print the manifest instead of creating: `yaml` (default) or `json`. |
| `-n, --namespace <ns>` | Namespace. |
| `--as <subject>` | Impersonate a subject. |
| `--home <dir>` | Data directory. |

### `rl workstationpool lease <pool>`

Lease a workstation from a pool. The pool binds one of its members as soon as one is available,
idle, starting or newly built, and that member is yours until the lease ends:

```bash
rl workstationpool lease agents-linux --name my-build --label purpose=ci --wait
workstationpoollease/my-build Ready on agents-linux-e5f6a7b8
rl shell agents-linux-e5f6a7b8
```

The lease carries this device's own public key unless you pass `--key`, so `rl shell --script`
and `rl file cp` work against the member at once. Without `--wait` the command returns as soon
as the lease is written, and `rl workstationpoollease get` shows its phase. With `--wait` it
blocks until the lease is `Ready` or `Failed`, then prints the lease and its member. If the wait
times out, the lease still exists and may still bind a member, and the message names the
release command. `rl workstationpoollease create <pool>` is the same command under the lease's
own noun.

| Flag | Description |
|------|-------------|
| `--name <name>` | The lease's name. Default: generated from the pool's name. |
| `--key <public-key>` | A public key authorized on the member while the lease holds it, repeatable. Default: this device's own key. |
| `--expires-in <duration>` | How long the lease runs before the pool treats it as abandoned. Default: the pool's `lease.maxTerm`. |
| `--label <key=value>` | A label to add, repeatable. |
| `--wait` | Block until the lease is `Ready` or `Failed`. |
| `--timeout <duration>` | With `--wait`, how long to wait. Default `20m`; `0` means no limit. |
| `--dry-run` | Print the lease as a manifest instead of creating it. |
| `-o, --output <format>` | Print the manifest instead of creating: `yaml` (default) or `json`. |
| `-n, --namespace <ns>` | Namespace. |
| `--as <subject>` | Impersonate a subject. |
| `--home <dir>` | Data directory. |

### `rl workstationpool share` / `unshare` / `access`

Let a teammate lease from a pool you own, take that back, or report who may lease and through
which Grant. They are on the [Shares and access](https://docs.ringleader.dev/reference/cli/commands/shares-access/#rl-workstationpool-share-name)
page.

### `rl workstationpool usage <pool>`

Print a pool's hourly usage history: its demand, waits, endings and idle time, one row per hour,
newest first. History is kept for the last 168 hours, and nothing older is served.

```bash
rl workstationpool usage agents-linux
rl workstationpool usage agents-linux --since 24h -o json
```

The table has a column for each counter, which
[Pool usage history](https://docs.ringleader.dev/workstations/lifecycle/pools-leases/#pool-usage-history)
lists.

| Flag | Description |
|------|-------------|
| `--since <duration>` | How far back to read. Default: the whole kept history, `168h`. |
| `-o, --output <format>` | `json` or `yaml`. Default: a table. |
| `-n, --namespace <ns>` | Namespace. |
| `--as <subject>` | Impersonate a subject. |
| `--home <dir>` | Data directory. |

## `rl workstationpoollease`

Manage the leases themselves. `create` is
[`rl workstationpool lease`](https://docs.ringleader.dev/reference/cli/commands/workstation-access/#rl-workstationpool-lease-pool)
under this noun, and the generic verbs apply. `rl workstationpoollease get` prints each lease's
holder, pool, phase, member and expiry, and `--mine` narrows it to yours. `rl workstationpoollease
wait` without `--for` waits for `Ready`, and a `Failed` lease ends the wait.

### `rl workstationpoollease renew`

Move a lease's expiry later, so the pool does not treat it as abandoned. Target leases by name,
several names, or a label selector with `-l`. Each renewed lease prints its new expiry. A lease
that has been released or has failed is reported and left alone.

```bash
rl workstationpoollease renew my-build --expires-in 4h
rl workstationpoollease renew -l purpose=ci
```

```text
workstationpoollease acme-dev/my-build is renewed until 2026-10-20T22:00:00Z
```

Without `--expires-in`, the lease runs for the pool's `lease.maxTerm` from now. The expiry may
not be more than one `lease.maxTerm` ahead, so a renewal with a longer `--expires-in` is refused.

| Flag | Description |
|------|-------------|
| `--expires-in <duration>` | How long the renewed lease runs. Default: the pool's `lease.maxTerm`. |
| `-l, --selector <selector>` | Label selector instead of name(s). |
| `-n, --namespace <ns>` | Namespace. |
| `-A, --all-namespaces` | Operate across all namespaces. |
| `--as <subject>` | Impersonate a subject. |
| `--home <dir>` | Data directory. |

### `rl workstationpoollease release`

End one or more leases. By default the pool deletes the member. With `--recycle` it asks the pool
to clean the member and keep it for the next lease, which the pool does only when it declares a
`recycle` block and none of the reasons that
[Member recycling](https://docs.ringleader.dev/workstations/lifecycle/pools-leases/#member-recycling)
lists applies. A lease whose release
was already requested is reported and left alone.

```bash
rl workstationpoollease release my-build
rl workstationpoollease release -l purpose=ci --recycle
```

```text
workstationpoollease acme-dev/my-build is releasing (its member will be deleted)
```

| Flag | Description |
|------|-------------|
| `--recycle` | Ask the pool to recycle the member instead of deleting it, if the pool recycles. |
| `--ignore-not-found` | Exit successfully when a named lease is missing. |
| `-l, --selector <selector>` | Label selector instead of name(s). |
| `-n, --namespace <ns>` | Namespace. |
| `-A, --all-namespaces` | Operate across all namespaces. |
| `--as <subject>` | Impersonate a subject. |
| `--home <dir>` | Data directory. |

