# CLI reference

This page lists the commands in `workrex --help`, in the same groups. For a
command's full options, run `workrex <command> --help`. "Window" means a Rex tab within a session. A terminal pane is a Rex block. In session mode, which
is the default under Rex, each worktree gets a session instead.
Configuration lives in `.workrex.yaml` and the Workrex global directory.
See [Configuration](https://kong109.github.io/workrex/guide/configuration/).

## Worktree lifecycle

| Command                                       | Description                                                   |
| --------------------------------------------- | ------------------------------------------------------------- |
| [`add`](https://kong109.github.io/workrex/reference/commands/add/)             | Create a worktree and its window                              |
| [`remove`](https://kong109.github.io/workrex/reference/commands/remove/)       | Remove a worktree, its window, and its branch without merging |
| [`rename`](https://kong109.github.io/workrex/reference/commands/rename/)       | Rename a worktree, its window or session, and its branch      |
| [`merge`](https://kong109.github.io/workrex/reference/commands/merge/)         | Merge a branch, then remove its worktree and window           |
| [`rebase`](https://kong109.github.io/workrex/reference/commands/rebase/)       | Rebase a worktree branch onto its base branch                 |
| [`open`](https://kong109.github.io/workrex/reference/commands/open/)           | Open a window for an existing worktree                        |
| [`close`](https://kong109.github.io/workrex/reference/commands/close/)         | Close a worktree's window and keep the worktree and branch    |
| [`resurrect`](https://kong109.github.io/workrex/reference/commands/resurrect/) | Restore worktree windows after a crash                        |

## Monitoring

| Command                                       | Description                                  |
| --------------------------------------------- | -------------------------------------------- |
| [`dashboard`](https://kong109.github.io/workrex/reference/commands/dashboard/) | Show a TUI dashboard of every active agent   |
| [`sidebar`](https://kong109.github.io/workrex/reference/commands/sidebar/)     | Control the live agent status sidebar in Rex |
| [`list`](https://kong109.github.io/workrex/reference/commands/list/)           | List all worktrees                           |
| [`path`](https://kong109.github.io/workrex/reference/commands/path/)           | Print the filesystem path of a worktree      |
| [`status`](https://kong109.github.io/workrex/reference/commands/status/)       | Query agent status for worktrees             |

## Setup and configuration

| Command                                         | Description                                            |
| ----------------------------------------------- | ------------------------------------------------------ |
| [`init`](https://kong109.github.io/workrex/reference/commands/init/)             | Write an example `.workrex.yaml`                       |
| [`setup`](https://kong109.github.io/workrex/reference/commands/setup/)           | Set up agent status tracking hooks and install skills  |
| [`config`](https://kong109.github.io/workrex/reference/commands/config/)         | Edit, locate, or print the global configuration        |
| [`sandbox`](https://kong109.github.io/workrex/reference/commands/sandbox/)       | Manage sandbox settings                                |
| [`remote`](https://kong109.github.io/workrex/reference/commands/remote/)         | Manage SSH remotes that run agents                     |
| [`sync-files`](https://kong109.github.io/workrex/reference/commands/sync-files/) | Copy and symlink configured files into worktrees again |
| [`claude`](https://kong109.github.io/workrex/reference/commands/claude/)         | Claude Code commands, such as `claude prune`           |

## Agent interaction

| Command                                           | Description                                       |
| ------------------------------------------------- | ------------------------------------------------- |
| [`send`](https://kong109.github.io/workrex/reference/commands/send/)               | Send a prompt or instruction to a running agent   |
| [`capture`](https://kong109.github.io/workrex/reference/commands/capture/)         | Capture terminal output from a running agent      |
| [`wait`](https://kong109.github.io/workrex/reference/commands/wait/)               | Wait for agents to reach a target status          |
| [`run`](https://kong109.github.io/workrex/reference/commands/run/)                 | Run a command in a worktree's window              |
| [`reap-agents`](https://kong109.github.io/workrex/reference/commands/reap-agents/) | Exit tracked agent processes older than a set age |

## Help and updates

| Command                                           | Description                                     |
| ------------------------------------------------- | ----------------------------------------------- |
| [`docs`](https://kong109.github.io/workrex/reference/commands/docs/)               | Show the README in the terminal                 |
| [`changelog`](https://kong109.github.io/workrex/reference/commands/changelog/)     | Show the changelog (what's new in each version) |
| [`update`](https://kong109.github.io/workrex/reference/commands/update/)           | Update workrex to the latest release            |
| [`completions`](https://kong109.github.io/workrex/reference/commands/completions/) | Print shell completions                         |

## Commands not shown in --help

`workrex --help` does not list these commands.

| Command                                         | Description                                                        |
| ----------------------------------------------- | ------------------------------------------------------------------ |
| [`last-done`](https://kong109.github.io/workrex/reference/commands/last-done/)   | Switch to the agent that finished or asked for input most recently |
| [`last-agent`](https://kong109.github.io/workrex/reference/commands/last-agent/) | Switch to the last visited agent (toggle between two)              |
| [`shell`](https://kong109.github.io/workrex/reference/commands/shell/)           | Open a shell in a remote workspace                                 |
| `uninstall`                                     | Remove status hooks, skills, and workrex's state and update cache  |
