---
title: "CLI slash commands"
description: "Every slash command in the Hoplite CLI, from models and retries to pull requests and thread actions."
canonical_url: "https://hoplite.sh/docs/cli/commands"
markdown_url: "https://hoplite.sh/docs/cli/commands.md"
---

# CLI slash commands
URL: /docs/cli/commands
LLM index: /llms.txt
Description: Every slash command in the Hoplite CLI, from models and retries to pull requests and thread actions.
Related: /docs/cli/interactive, /docs/agent/slash-commands, /docs/github, /docs/threads/manage

# CLI slash commands

Type `/` in an interactive session to open the command menu, or `/help` to list every command. Commands act on the current [thread](/docs/threads); you don't need to phrase them as a request to the agent. Commands that act on a thread need one: send a prompt or `/resume` a thread first.

## Command reference

### Threads and sessions

| Command | What it does |
| --- | --- |
| `/new` | Start a new Hoplite thread |
| `/clear` | Clear the screen and start a new thread |
| `/resume` | Pick a recent thread to resume (**Tab** switches between **Mine** and **Team**) |
| `/rename TITLE` | Rename the current thread |
| `/model`, `/model MODEL` | Pick the thread's model, or switch to the one you name |
| `/reasoning`, `/reasoning LEVEL` | Pick the model's reasoning level, or set it. Alias: `/effort` |
| `/fast` | Turn the fast (priority) speed on or off |
| `/retry` | Retry the last failed run |
| `/retry hoplite` | Retry on Hoplite credits, when a linked subscription hit its usage limit |
| `/continue` | Continue in a new thread |
| `/copy`, `/copy link` | Copy the last response, or the thread's Hoplite link |

### Thread tools

| Command | What it does |
| --- | --- |
| `/pr` | Open a pull request for the thread, or open the existing one in the browser |
| `/pr status` | Show the pull request card |
| `/pr comments` | Add the pull request's review comments to the chat |
| `/merge`, `/merge METHOD` | Merge the pull request after a confirmation. `METHOD` is `squash`, `merge`, or `rebase` |
| `/autofix`, `/autofix on`, `/autofix off` | Show or set whether Hoplite fixes review comments and failing checks |
| `/automerge`, `/automerge on`, `/automerge off` | Show or set whether Hoplite merges the pull request once it is ready |
| `/preview` | Open the workspace preview in the browser |
| `/terminal` | Open the workspace terminal in the browser |
| `/shell` | Open a shell in the thread's sandbox, in this terminal. Type `~.` on a new line to come back |
| `/usage` | Show the thread's context and cost |
| `/compact` | Compact the thread's context |
| `/stop` | Stop the thread's run, including a teammate's (**Esc Esc** stops only yours) |
| `/rewind` | Rewind the thread to an earlier reply |
| `/export`, `/export FORMAT SCOPE` | Save the thread to a file in the current directory. `FORMAT` is `md` or `json`; `SCOPE` is `messages`, `activity`, or `full` |
| `/archive`, `/archive ACTION` | Archive the thread. `ACTION` (`leave`, `draft`, or `close`) says what happens to an open pull request |
| `/good`, `/good COMMENT` | Rate the last reply as good |
| `/bad`, `/bad COMMENT` | Rate the last reply as bad, with reasons |

### General

| Command | What it does |
| --- | --- |
| `/help` | Show the available slash commands |
| `/status` | Show runtime configuration and the thread's Hoplite link |
| `/settings` | Browse and change [settings](/docs/cli/configuration#settings) |
| `/statusline session`, `/statusline workspace` | Show or hide a status line segment |
| `/paste` | Paste text from the clipboard |
| `/trace` | Copy a private diagnostic trace, for support |
| `/version` | Show the Hoplite CLI version |
| `/quit` | Exit. Alias: `/exit` |

Model, reasoning, retry, and continue are covered in [Interactive sessions](/docs/cli/interactive#model-reasoning-and-speed).

## Pull requests

When the thread has a pull request, it shows as a card with its verdict, checks, and mergeability, and as a chip in the footer.

- `/pr` opens a pull request for the thread's changes. If one exists, it opens it in your browser.
- `/pr status` shows the pull request card again.
- `/pr comments` lists the pull request's review comments. Select the ones you want with **Space** and press **Enter** to add them to the chat.
- `/merge` asks for confirmation, then merges with the repository's default method. `/merge squash`, `/merge merge`, or `/merge rebase` picks a method the repository allows. The CLI tells you when the pull request can't be merged yet.
- `/autofix` and `/automerge` show or set the [review loop](/docs/github#the-review-loop).

Merging and changing the review loop need the `repo:update` permission, as in the Hoplite app: workspace owners and admins can, members can't. Your CLI key gets it when you sign in as an owner or admin. If your role changed since you signed in, run `hoplite login` again for a key with your current role.

See [Pull requests](/docs/github) for how Hoplite opens and updates pull requests.

## Previews and terminal

`/preview` opens the thread's [preview](/docs/sandboxes/previews) in your browser. If the workspace serves several ports, you choose one. `/terminal` opens the workspace terminal in the browser; it needs an active workspace. Both use `$BROWSER` when it's set.

## Usage and context

The footer's meter shows how much of the model's context the thread uses and, when your workspace shows dollar amounts, its cost. `/usage` shows the breakdown: context used, model, input and output tokens, run count, and cost split between the model and the sandbox, plus any [spend limit](/docs/threads/cost).

`/compact` summarizes older context to free space. The compaction run streams into the transcript.

## Skills

The thread's [skills](/docs/agent/skills) appear in the slash menu next to the built-in commands. Choosing one sends it as a prompt, as the web composer does. If a skill has the same name as a built-in command, the built-in command runs.

The agent's task list updates in place as it works, and subagents show under the tool that started them. Long task lists are cut short inline; **Ctrl+O** shows all of them.

## Run commands in the sandbox

In a session, a line starting with `!` runs in the thread's sandbox; see [Run a command in the sandbox](/docs/cli/interactive#run-a-command-in-the-sandbox). From your shell, `hoplite exec` does the same and exits with the command's status, like `ssh`:

```sh
hoplite exec -- npm test
hoplite exec -c 'npm test 2>&1 | tail -20'
git diff | hoplite exec -- git apply
```

| Option | What it does |
| --- | --- |
| `-- <command>...` | The command and its arguments, passed as words that are never split or expanded |
| `-c '<shell>'` | A shell string instead, with pipes and redirects |
| `--resume <id>` | Run in this thread. The default is the latest thread in this repository, the one `hoplite -c` resumes |
| `-r` | Pick the thread from this repository's recent threads (needs a terminal) |
| `--timeout <s>` | Stop the command after this many seconds. The default is 120 and the most is 3,600; a command that times out exits 124 |
| `--cwd <dir>` | The directory to run in. Relative paths start at the repository root |

Piped standard input goes to the command, up to 512 KiB. Its standard output and error print to your terminal's, each up to 2 MiB; `hoplite exec` says on standard error when one was cut. On a terminal, it first prints which thread it runs in. It exits with the command's exit status, with 255 when Hoplite couldn't run it (for example, the sandbox is still setting up, or the thread has no sandbox until you send it a prompt), and with 130 after **Ctrl+C**, which cancels the command in the sandbox. A thread that runs on a local agent has no sandbox; run the command in its folder instead. Like `hoplite ask`, it signs you in first when no CLI key is stored (or Hoplite no longer accepts the stored one); without a terminal to sign in from, it fails at once with 255 and asks you to run `hoplite login` in a terminal first.

It needs the same access as the workspace terminal and a CLI key from `hoplite login`. Each key can run 30 commands a minute.

## Open a shell in the sandbox

`/shell` opens an interactive shell in the thread's sandbox, in place of the session, like `ssh`. From your shell, `hoplite shell` does the same:

```sh
hoplite shell                 # the latest thread in this repository
hoplite shell --resume <id>   # a given thread
hoplite shell -r              # pick from this repository's recent threads
```

It's the web app's workspace terminal. If the sandbox is asleep, Hoplite wakes it first, which can take a while; press **Ctrl+C** to stop waiting. Every key goes to the sandbox as you type it, including **Ctrl+C**, **Ctrl+Z**, and **Ctrl+D**. As in `ssh`, `~` at the start of a line is an escape:

| Escape | What it does |
| --- | --- |
| `~.` | Disconnect. `/shell` returns to the session, and remote updates that arrived meanwhile show then |
| `~?` | List the escapes |
| `~~` | Send a `~` |

The shell ends when you exit it or type `~.`, and `hoplite shell` exits with 0; there's no exit status from the sandbox. It exits with 255 when the connection is lost, for example when the sandbox is archived under it, and with 1 when Hoplite refuses the shell. It needs a terminal; use `hoplite exec` in scripts.

It needs the same access as the workspace terminal and a CLI key from `hoplite login`. You can have 4 workspace terminals open at once, across the web app and the CLI, and open 30 a minute. A thread that runs on a local agent has no sandbox; if you used the thread from this computer, `hoplite shell` names that folder so you can `cd` there instead.

## Rewind, export, and archive

- `/rewind` lists the replies you can rewind to. After you confirm, that reply and everything after it are discarded, and the thread reopens. This can't be undone.
- `/export` saves the thread to a file in the current directory. Choose Markdown (`md`, the default) or `json`, and how much to include: `messages` (the default), `activity`, or `full`. A full export includes subagents. See [Export a transcript](/docs/threads/manage#export-a-transcript).
- `/archive` archives the thread. If it has an open pull request, the CLI asks what to do with it. `/archive leave`, `/archive draft`, or `/archive close` answers up front, optionally followed by a comment. See [Archive or delete a thread with an open PR](/docs/threads/manage#archive-or-delete-a-thread-with-an-open-pr).

## Rate a reply

`/good` and `/bad` rate the last reply. The rating is sent at once; then you can pick reasons, such as **Wrong approach** or **Broke the build**, or press **Esc** to skip. Text after the command is sent as a comment. See [Rate an agent response](/docs/threads/review#rate-an-agent-response).

## Sitemap

See the full [sitemap](/docs/sitemap.md) for all pages.
Well-known sitemap: [/docs/.well-known/sitemap.md](/docs/.well-known/sitemap.md).
