# Command Reference This guide summarizes common actions and how to invoke them with vtcode. The agent exposes a suite of tools to the LLM; you interact with them via chat. When you ask to search, read, or edit files, the agent chooses an appropriate tool. ## Core command reference `vtcode --help` lists every subcommand, including niche utilities such as `benchmark`, `notify`, and `session-store`. The table below maps the primary subcommands to their purpose; detailed sections for the most-used commands follow. | Command | Purpose | | ---------------------------------------------------------------------- | ------------------------------------------------------------------- | | `vtcode` / `vtcode chat` | Interactive TUI session | | `vtcode ask ` | One-shot prompt; prints the reply without tools or a session | | `vtcode exec ` | Headless execution with the full tool loop; `--json` streams events | | `vtcode eval --suite ` | Run an evaluation suite with pass@k / pass^k metrics | | `vtcode review` | Non-interactive review of the current diff, files, or a git target | | `vtcode continue` | Resume the most recent conversation; `--session-id` forks it | | `vtcode init` | Scaffold `vtcode.toml`, `AGENTS.md`, and ast-grep starter files | | `vtcode init-project` | Register a project entry in the user state directory | | `vtcode config` | Generate or reset `vtcode.toml` configuration layers | | `vtcode login ` / `vtcode logout ` / `vtcode auth` | OAuth or API-key login, logout, and status | | `vtcode secret` | Store provider API keys in the OS keyring | | `vtcode models` | List, set, test, and inspect providers and models | | `vtcode schedule` | Durable scheduled tasks by cron, interval, or one-shot time | | `vtcode tool-policy` | Allow or deny specific tools per workspace | | `vtcode mcp` | Manage Model Context Protocol servers | | `vtcode a2a` | Agent2Agent protocol client and server | | `vtcode acp` | Start the Agent Client Protocol bridge for editors | | `vtcode webmcp` | Authenticated browser editor bridge and local MCP stdio service | | `vtcode skills` | Manage Agent Skills (list, create, load, validate) | | `vtcode plugins` | Manage Agent Plugins (add, list, validate, remove) | | `vtcode dependencies` (`deps`) | Install or check optional tools (ripgrep, ast-grep) | | `vtcode check` | Run built-in repository checks such as ast-grep | | `vtcode schema` | Emit built-in tool schemas for automation discovery | | `vtcode analyze` | Analyze workspace structure, security, and performance | | `vtcode trajectory` | Pretty-print run logs for debugging and audits | | `vtcode snapshots` / `vtcode revert` | List and roll back to workspace snapshots | | `vtcode cleanup-snapshots` | Prune old snapshots with a retention limit | | `vtcode update` | Check for and install binary updates from GitHub Releases | | `vtcode man` | Generate or display man pages | | `vtcode man --all-pages --output man/man1` | Write the main page and all visible command pages to a directory | For a local MCP connection that exposes Companion coding tasks, use `vtcode webmcp stdio --companion` with an explicitly selected workspace. The [VT Code Companion guide](./vtcode-companion.md) covers package setup and host marketplaces. The CLI command does not install the plugin or configure a host. ## Fast mode | Command | Purpose | | --- | --- | | `/fast` | Toggle native OpenAI ultrafast or Anthropic fast on eligible models | | `/fast on` | Enable fast processing at premium pricing and save the choice | | `/fast off` | Clear the active provider override and restore its default speed | Changes apply to subsequent requests and persist through the same configuration path as `/model`. Enabling on another route explains which models to select; it does not switch models. Disabling also works after switching to an unsupported route or ChatGPT subscription authentication. Each accepted command saves the choice and rebuilds the client to reconcile configuration reloads; repeated settings produce the same configuration. See the [fast mode guide](../development/fast-mode.md). The TUI reminds you once per session about `/fast on` when using an eligible native API-key route and fast mode is off. Using `/fast` dismisses the reminder. Claude speed changes affect prompt-cache reuse. ## Execution explanations Enter these slash commands in the interactive VT Code chat input. They summarize recorded execution without another model call. | Command | Purpose | | --- | --- | | `/explain` | Latest task's goal, changes, decisions, verification, and review priorities | | `/explain --scope task` | Explicitly select the latest task (the default) | | `/explain --scope session` | Explain all retained tasks | | `/explain --details` | Inspect public facts and evidence in Transcript Review | | `/explain diagram` | Show recorded execution order and file relationships | | `/explain diagram --scope session` | Show execution relationships across retained tasks | | `/explain --web` | Open the live Explanation view, or create an offline report | | `/explain --export html` | Export a private standalone HTML report | Choose one output mode: the summary, `--details`, `diagram`, `--web`, or `--export html`. Add `--scope task` or `--scope session` to any mode. The default summary has five sections and at most 20 logical lines; wrapped terminal text can occupy more rows. Omission counts point to additional facts available in the detailed views. ### Review a task 1. Run `/explain` after the agent finishes. Read **Goal** for the outcome and **Review first** for inspection priorities. 2. Run `/explain --details` for the full public facts. With mouse capture enabled, Alt+click a fact in Transcript Review to inspect its recorded evidence. Ordinary click and drag still select text. Use the configured review binding (default `Ctrl+T`) to close the viewer. 3. Run `/explain diagram` to inspect recorded action order, failures, delegation, and file relationships. The latest task includes its initial request, active corrections, approval handoffs, retries, and autonomous continuations. A new request entered while the agent is idle starts a new task. Use `--scope session` to include earlier retained tasks. ### Interpret the results - **Changes** attributes successful recorded file operations to the agent. A separate current workspace diff includes staged and unstaged tracked changes against HEAD; it does not establish who made them and excludes untracked files. - **Decisions** shows optional public rationale reported by the agent. Missing rationale remains unavailable. - **Verification** passes only for a completed recorded check with exit code zero. Pending checks and absent exit codes remain unconfirmed. Checks before later mutation attempts are marked stale, including failed or pending mutations. - **Review first** lists deterministic inspection signals with reasons and evidence. A priority is not a proven bug or a claim of test coverage. - Missing, malformed, evicted, or unavailable evidence is reported explicitly. Usage, cost, timing, and ancestry appear only when recorded. ### Open or save a report `/explain --web` opens the existing WebMCP app's Explanation view when the live bridge is active. Complete browser pairing if needed; see the [WebMCP guide](./webmcp.md#execution-explanations). Without an active bridge, the command creates and opens an offline HTML report. `/explain --export html` saves a report without opening the browser and prints its path: `.vtcode/sessions//derived/explain/explanation-.html`. Open that file directly in a browser. It embeds redacted public facts and available evidence, supports local evidence navigation, and needs no network connection or pairing credentials. Large or expired evidence is marked incomplete. A browser-opening failure leaves the report at the printed path. See the [development guide](../development/execution-explanations.md) for event and evidence limits. ## Headless / CI `exec`, `ask --print`, and `review` are safe with no TTY. `stdout` carries only the result (`--json` streams events); diagnostics go to `stderr`. Failures exit non-zero and never block on a prompt. ```bash vtcode exec "summarize this repo" ` / env-var guidance; no silent provider fallback. `[automation.full_auto]` must be enabled for `exec`. ## Search Use `exec_command.cmd` with `rg` or `grep` for flexible shell text search. The default model-visible tools are `exec_command`, `write_stdin`, and `apply_patch`. `code_search` is available through the advanced VT Code profile. It accepts a required literal `query` plus optional `path`, `file_types`, `result_types`, and `max_results`. Its four result categories are recognised definitions, exact syntactic usages, literal text, and matching paths. A usage is a same-spelling syntax occurrence, not a resolved reference. Queries use literal smart-case. When `truncated` is true, narrow a filter in another call; the response does not claim an exact repository-wide total. Use `exec_command` or the specialised ast-grep skill for arbitrary structural patterns. ## Storage diagnostics Use `vtcode --version` to print the active config, data, state, cache, runtime, executable, and legacy roots, as well as the migration marker and report paths. This is the quickest way to diagnose an XDG override, a sandbox environment, or a legacy `~/.vtcode` migration without relying on platform-specific guesses. ### Examples - Find TODO/FIXME with 2 lines of context in Rust files only: ```text Ask: Search for TODO or FIXME across the repo with 2 lines of context in Rust files. { "cmd": "rg -n -C 2 'TODO|FIXME' -g '*.rs' ." } ``` - Literal search for `unsafe {` anywhere (hidden files ignored): ```text { "cmd": "rg -n -C 1 -F 'unsafe {' ." } ``` - Search JavaScript files for a function name, case-insensitive: ```text { "cmd": "rg -n -i 'doSomethingImportant' -g '*.js' ." } ``` ## File operations - Inspect files with shell commands through `exec_command.cmd`, such as `rg --files`, `sed -n`, `cat`, `head`, and `tail`. - Edit files with `apply_patch`. - Continue live shell sessions with `write_stdin`. ## Session resume and forks VT Code can reopen archived sessions, continue the latest one, or fork a previous session into a new archive. ### Resume the latest or a specific session ```bash vtcode --continue vtcode --resume session-123 vtcode --resume # interactive picker ``` ### Fork from an archived session ```bash vtcode --fork-session session-123 vtcode --fork-session session-123 --session-id bugfix-branch vtcode --resume session-123 --session-id bugfix-branch vtcode --continue --session-id followup-branch ``` Notes: - `--session-id` turns `--resume ...` or `--continue` into a fork instead of an in-place resume. - `--resume` with no ID plus `--session-id ...` opens the interactive picker and then forks the selected session. - `--all` expands the picker/search scope across workspaces for resume and fork flows. ### Start a summarized fork ```bash vtcode --fork-session session-123 --summarize vtcode --resume session-123 --session-id handoff --summarize vtcode --resume --session-id handoff --summarize # interactive picker, summarized fork ``` Summarized forks do not copy the full transcript. VT Code starts the child session from: - one structured conversation summary - retained recent real user messages - the session memory envelope Normal forks keep the full archived transcript unchanged. ## Quick Actions in Chat Input VT Code provides several quick actions directly in the chat input for faster workflow: - **File Picker (`@`)** — Type `@` anywhere in your input to open the file picker and select files to reference in your message. This allows you to quickly mention files without typing full paths. The picker is hierarchical: with an empty query it browses one directory at a time (`Enter` opens a folder, `←` ascends, `PageUp`/`PageDown` jump a page), and once you type it switches to a fuzzy search across the workspace. Rows show a type glyph (`▸` folder, `▧` image, `⚙` executable) and symlinks render their target, with dangling links flagged as `(broken)`. Press `Alt+Enter` on a folder to reference it (`@dir/`) instead of opening it. Files and folders ignored by `.gitignore`, `.vtcodegitignore`, and the built-in sensitive-file list are never shown. - **Slash Commands (`/`)** — Type `/` at the start of input to access all available slash commands including `/files`, `/status`, and many more. Run `/splash` to inspect the current CLI workspace, session, tool registry, and WebMCP listener. It omits pairing credentials. In VT Code Desktop the same command opens Settings → Connections, refreshes bridge status, and shows the Desktop-to-CLI protocol handshake; a standalone CLI process cannot observe another process's Desktop connection. ## Desktop and CLI handoff Each surface can hand its current thread to the other. A loaded session holds an exclusive lock for its whole lifetime (idle included), so the two directions differ: Desktop → CLI forks (both sides stay open), while CLI → Desktop loads the same thread (exit the CLI session first). - **CLI → Desktop (`/desktop`, macOS only)** — Opens VT Code Desktop with the current thread selected. Delivery goes through a `vtcode://session/?workspace=` URL handled by the running app, so handoff to an open Desktop is instant (no new process, no reboot); a cold app launches and picks the link up on startup. When no bundle claims the scheme (dev builds, outdated installs), it falls back to resolving the app exactly like `vtcode desktop` (explicit path, `VTCODE_DESKTOP_APP`, then the standard install locations) with `--session` / `--workspace` argv. Linking needs a saved checkpoint: threads checkpoint after every turn, so a fresh thread with no turns yet opens unlinked with a notice — run a turn and retry. With history persistence disabled the thread cannot be linked. The CLI holds the thread open until it exits, so the desktop load fails fast with a close-and-reload error until then — exit this session and reload the thread there. - **Desktop → CLI** — The thread-header Terminal button, `/cli`, and the ⌘K "Continue in terminal" entry all open the same handoff card showing `vtcode --fork-session ` for the selected thread (the same command as Settings → Connections → Terminal). Fork, not resume: the desktop keeps the thread open, so the CLI continues an independent copy while the desktop thread stays live. **Copy** copies it; **Continue in terminal** copies it and runs it in the chosen terminal (Terminal.app runs it automatically via a generated script; iTerm2/Ghostty open at the workspace for pasting until their script handling is verified); **Dismiss** closes the card. The terminal is chosen in Settings → Connections. With no thread selected the button is disabled and the other entries explain why. While a turn runs, the card notes the copy includes only completed turns. - Typing `/desktop` inside Desktop reports that you are already there instead of opening a second instance. ## Configuration quick reference | Action | Command | Result | | ------------------------------ | ------------------------------- | ---------------------------------------------------------------------------- | | Open settings | `/config` (or `/settings`) | Browse curated groups, or search the complete schema under Advanced settings | | Open a section or field | `/config ` | Jump directly to a group, Advanced index, or nested setting | | Reset the active layer | `/config reset` | Show the target file and request confirmation | | Generate configuration | `vtcode config` | Print a generated configuration document | | Reset workspace/explicit layer | `vtcode config reset` | Clear one workspace-layer file and reload the stack | | Reset user layer | `vtcode config reset --global` | Clear the canonical user config only | | Reset project layer | `vtcode config reset --project` | Clear the current project profile only | Configuration resets preserve lower-precedence values and secure credentials. Interactive sessions live-reload safe changes from watched layers; malformed edits retain the last valid snapshot and show a warning. See the [configuration guide](../config/config.md) for layer precedence and live-reload details. In VT Code Desktop, `/config` opens a dedicated configuration page with the same groups, search, and typed editors, and `/config ` deep-links into it; the runtime-owned sections (`reset`, `clear`, `checkup`, `doctor`, `memory`, `tasks`, `jobs`, `log`, `subprocess`, `notify`) stay with the CLI runtime, and layer resets use `vtcode config reset` in the terminal. ### Slash-command notes - Slash commands are skill-backed. Each command routes through a namespaced command skill such as `cmd-status` or `cmd-review`. - The `/name` form remains the compatibility alias. You can also inspect or execute the same behavior through `/skills info cmd-name` and `/skills use cmd-name ...`. - Prompt-oriented slash commands such as `/review` are shipped as bundled system skills in the release binary. - `/review` accepts free-form instructions (`/review Review the full diff for correctness and regressions`) or legacy flags (`--last-diff`, `--target `, `--file `, positional files, `--style