CLI command reference
Every cruxy command, subcommand, flag, and default as the 1.19.0 help prints them, plus the session commands, keys, and exit codes.
This reference matches cruxy --help and each subcommand's --help in
@cruxy/cli 1.19.0. Run cruxy <command> --help for the same text in your
terminal. Every command and subcommand also takes -h, --help, which is left
out of the tables below.
Global options
These go before the command: cruxy [options] [command].
| Option | Description |
|---|---|
-v, --version | Print the cruxy version. |
-c, --config <path> | Use a specific config file instead of the discovered project config. The file must exist. |
--log-level <level> | One of debug, info, warn, error, or silent. |
--verbose | Shorthand for --log-level debug. Errors also show the underlying error. |
--resume [id] | Resume a saved session by id. Omit the id to pick from recent sessions. |
cruxy
cruxy [options] [message...]With no command, cruxy opens the full-screen interactive session, and a
message becomes its first turn. The full-screen session needs an interactive
terminal: it does not run when stdin or stdout is not a terminal (for example,
when piped), when TERM=dumb, or in screen-reader mode. There, with no message, cruxy prints a short usage banner
and exits 0; with a message, it runs the message once. On a first run with no
key, cruxy runs setup first and then carries on: with a message it runs the
message, and without one it opens the session. A single word that is a near miss of a
command name, such as cruxy confg, is refused with a suggestion instead of
being sent as a task.
| Option | Default | Description |
|---|---|---|
--no-memory | off | The gateway neither recalls nor captures memory for this run. |
--memory-capture | off | Let the gateway capture memory from this run's turns. Capture is off by default. |
Both flags override cruxy.memory.recall and cruxy.memory.capture for one
run; see
Projects, permissions, and context.
Passing both fails with CRUXY_E_USAGE (exit 2), because they contradict
each other.
run
cruxy run [options] [prompt...]Runs a task once, or starts a line-based interactive session when you omit the prompt. Without a terminal, the prompt is required.
| Option | Default | Description |
|---|---|---|
--plan | off | Plan mode: propose a step-by-step plan for approval before executing. |
--sandbox | off | Run shell and test commands inside an isolated container. Fails if no container runtime is available. |
--root <spec> | none | Declare a workspace root, as name=path or path. Repeatable; the first is the primary root. |
--no-memory | off | The gateway neither recalls nor captures memory for this run. |
--memory-capture | off | Let the gateway capture memory from this run's turns. Capture is off by default. |
A one-shot run that ends before the task is finished, at the iteration cap, at
a token budget, or because it was cancelled, exits 20 with
CRUXY_E_AGENT_INCOMPLETE.
login
cruxy login [--paste]Sets or replaces your credential, saved to ~/.cruxy. It is interactive: without
a terminal it exits 1. After a browser sign-in, it names the organization the
credential is bound to and your role in it. See
Sign in from the CLI.
| Option | Default | Description |
|---|---|---|
--paste | off | Paste an existing API key instead of approving in a browser. |
logout
cruxy logoutRevokes your saved credential at the gateway and removes it from ~/.cruxy. It
takes no options and does not need a terminal.
| Outcome | Exit |
|---|---|
| The gateway revoked the key, or already refused it as revoked or expired. The key is removed. | 0 |
| No credential is saved. Nothing changes. | 0 |
The key may not revoke itself (CRUXY_E_AUTH_INVALID). You stay signed in. | 4 |
The gateway cannot be reached (CRUXY_E_GATEWAY_UNREACHABLE). You stay signed in unless you answer y at the terminal prompt. | 5 |
The gateway answered with an error (CRUXY_E_API). You stay signed in. | 6 |
A key in CRUXY_API_KEY is never revoked: the CLI warns that it is still in
use. See Sign out.
init
cruxy initSets up the current directory: a key if none is set, an optional CRUXY.md,
and an optional first run. It is interactive: without a terminal it exits 1.
config
cruxy config <command>Manages configuration. See CLI configuration.
| Command | Description |
|---|---|
config list (alias ls) | Print the fully resolved configuration. --origin shows where each value came from: a default, a config file, or the environment. |
config get <key> | Read one value by dot path, such as model.temperature. An unknown key exits 2. |
config set <key> <value> | Write a value by dot path to the global config. -p, --project writes the project config instead. |
config path | Show the config file locations in effect. |
config init | Write a default global config file, if none exists. |
index
cruxy index [options]Builds or refreshes the local codebase search index.
| Option | Default | Description |
|---|---|---|
--status | off | Show index status without building. |
--force | off | Re-embed every file, ignoring content hashes. |
--install | off | Install the local embedding runtime that semantic search needs. It prints what it downloads first. |
--uninstall | off | Remove the embedding runtime and its model cache. |
Without the runtime, cruxy index offers to install it in a terminal and fails
with CRUXY_E_INDEX_EMBEDDER_NOT_INSTALLED elsewhere. It writes a persistent
index at .cruxy/index.db, so it needs Node.js 22.13 or later.
skills
cruxy skills [--status]Lists the skills available to the agent.
| Option | Default | Description |
|---|---|---|
--status | off | Show source directories and validation errors. |
pr
cruxy pr [options]Opens a pull request from the current changes. The commit message and pull
request text are generated, and the whole plan is shown for approval first. It
needs a Cruxy key and a GitHub token from GITHUB_TOKEN, GH_TOKEN, or
gh auth token.
| Option | Default | Description |
|---|---|---|
-b, --base <branch> | see description | Base branch to merge into. Defaults to git.defaultBase, then the repository's default branch, then main. |
-t, --title <title> | generated | Pull request title, as a conventional-commit subject. |
--body <body> | generated | Pull request body. |
--draft | off | Open the pull request as a draft. |
checkpoint
cruxy checkpoint listInspects working-tree checkpoints, the undo units behind rollback.
checkpoint list lists restore points, one before each turn that changed
files, newest first.
rollback
cruxy rollback [id]Restores the working tree to before a turn, which undoes that turn and every
newer one. id is a run id, job id, or checkpoint id. Without one, it lets you
pick a restore point, with the newest selected, when there is more than one. It
restores the most recent run directly when there is only one, or when the
history spans more than one workspace root. It previews the change and asks for approval, so without a terminal
it exits 10 with CRUXY_E_ROLLBACK_APPROVAL_REQUIRED.
test
cruxy testRuns the project's test suite once and shows the parsed result. It runs
test.command when that is set, and otherwise the test script in
package.json through the project's package manager. It exits 1 when tests
fail, and 2 with CRUXY_E_TEST_COMMAND_NOT_FOUND when there is no test
command.
hooks
cruxy hooks <command>Inspects and trusts hooks and custom slash commands.
| Command | Description |
|---|---|
hooks list | List configured hooks, custom commands, and load errors. |
hooks trust <path> | Trust a project's hooks after reviewing them. The decision is recorded. |
memory
cruxy memory <command>Inspects and controls the CLI's local memory, recalled across sessions.
| Command | Description |
|---|---|
memory list | List saved memory entries and the project memory's trust status. |
memory forget <id> | Forget one saved memory entry by id. |
memory clear [--scope <scope>] | Clear saved entries in a scope: user, project, or all. Default all. Any other scope exits 2. |
memory trust [path] | Trust this repository's project memory after reviewing it. The decision is recorded. |
usage
cruxy usage [options]Shows token usage and cost for the session and recent runs, from the local usage record. Cost is the figure the gateway reported for each request, and requests it reported no cost for are counted as such.
| Option | Default | Description |
|---|---|---|
--session | off | Only the most recent session's runs. |
--last <n> | off | Only the last n runs. |
Pass one of --session or --last, not both.
limits
cruxy limitsShows your plan's weighted-token pool and what is left of it, read from
GET /api/v1/limits. With no usable key, it prints that you are not signed in.
mcp
cruxy mcp <command>Inspects and controls MCP integrations.
| Command | Description |
|---|---|
mcp list | List configured MCP integrations and their trust status. |
mcp trust [path] | Trust this repository's MCP integrations. They run with your full privileges. |
mcp login <server> | Set a bearer credential for a remote MCP integration, stored owner-only in ~/.cruxy. Needs a terminal. |
mcp untrust [path] | Clear MCP trust for this repository, so the CLI stops connecting. |
sessions
cruxy sessions <command>Manages this project's saved sessions.
| Command | Description |
|---|---|
sessions list [--all] | List saved sessions, newest first. --all lists every session, not only the newest 20. |
sessions prune [-n, --dry-run] | Clear sessions past sessions.retention or sessions.maxAgeDays. --dry-run shows what would be deleted and deletes nothing. |
sessions rm <id> | Forget one session by id or an unambiguous id prefix. |
logs
cruxy logs [--all] [id]Reads a finished background job's log. id is a job id or an unambiguous
prefix; without it, the command lists retained logs.
| Option | Default | Description |
|---|---|---|
--all | off | List every retained log, not only the newest 20. |
A background job never outlives the session that started it: leaving a session cancels every live job. Logs of failed and interrupted jobs are kept; a job that finished cleanly has its log removed at the next start.
Session commands
Type these inside an interactive session. /help lists them.
| Command | Description |
|---|---|
/help | Show the session commands. |
/clear | Clear the conversation history and keep the session. |
/compact | Summarize older history now, to free up context. |
/init | Write a project CRUXY.md and load it. |
/reload | Re-read the project instructions (CRUXY.md). |
/status | Show what this session is set up to do. |
/permissions [revoke <n>] | Show what runs without asking, and drop a standing grant by number. |
/diff [ref | --since <checkpoint>] | Show uncommitted changes in the workspace. |
/undo-last | Roll back the most recent checkpointed set of file changes. |
/redact | Mask secrets in this conversation so the model stops seeing them. |
/export [path] | Write this conversation to a markdown file. |
/plan | Toggle plan mode: propose a plan before executing. |
/mode [manual | auto-approve | plan | full-auto] | Show or set the session mode. |
/model [auto | canto | saga | epos] | Show or set the model for this session. |
/context | Show where the context budget is going, and what compaction would drop. |
/usage [all | last <n>] | Show token usage, weighted tokens, and cost. |
/budget [<n> | off] | Show or set this session's weighted-token budget. |
/jobs | List background jobs and their status. |
/logs <id> | Show a background job's log. |
/cancel <id> | Cancel a background job. |
/add-root <name> <path> | Check another workspace root and print the --root flag to relaunch with. The root is not added to the running session. |
/exit, /quit | Leave the session. |
The full-screen session also takes these keys:
| Key | Action |
|---|---|
| Tab | Complete a slash command. |
| Ctrl+K | Open the command palette. |
| Shift+Tab | Cycle the mode: manual, auto-approve, plan, full-auto. |
| PgUp, PgDn | Scroll the pane. The mouse wheel does too. |
| Esc | Return to the live tail. |
| Enter during a turn | Queue the line to run when the current turn finishes. |
| Ctrl+C | Clear the line. On an empty line, stop cruxy: with no turn running it leaves the session, and during a turn it ends the process (exit 130). |
| Ctrl+D | Leave cruxy, after any queued lines. |
Exit codes
Every error prints a stable code, such as CRUXY_E_AUTH_MISSING_KEY, and exits
with its category's status, so a script can branch on why cruxy failed.
Troubleshoot the CLI covers the codes you
are most likely to see.
| Exit | Category | Codes |
|---|---|---|
0 | Success | None. --help and --version also exit 0. |
1 | Internal | CRUXY_E_INTERNAL. Also login or init without a terminal or not completed, test with failing tests, and mcp login refusals. |
2 | Usage | CRUXY_E_USAGE, CRUXY_E_INTERACTIVE_REQUIRED, CRUXY_E_CONFIG_KEY_UNKNOWN, CRUXY_E_PROVIDER_UNSUPPORTED, CRUXY_E_GIT_PROTECTED_BRANCH, CRUXY_E_PLAN_INVALID, CRUXY_E_PLAN_REVISION_LIMIT, CRUXY_E_CHECKPOINT_NOT_FOUND, CRUXY_E_ROUTING_TIER_UNAVAILABLE, CRUXY_E_SESSION_BUDGET_EXHAUSTED, CRUXY_E_SUBAGENT_DEPTH_EXCEEDED, CRUXY_E_SUBAGENT_SCOPE_OVERLAP, CRUXY_E_TEST_COMMAND_NOT_FOUND, CRUXY_E_USAGE_READ, CRUXY_E_JOB_LIMIT |
3 | Config | CRUXY_E_CONFIG_PARSE, CRUXY_E_CONFIG_INVALID, CRUXY_E_CONFIG_NOT_FOUND |
4 | Auth | CRUXY_E_AUTH_MISSING_KEY, CRUXY_E_AUTH_INVALID, CRUXY_E_AUTH_EXPIRED, CRUXY_E_FORGE_AUTH, CRUXY_E_CREDENTIALS_UNPROTECTED |
5 | Network | CRUXY_E_GATEWAY_UNREACHABLE, CRUXY_E_GIT_PUSH_FAILED |
6 | API | CRUXY_E_API, CRUXY_E_API_REQUEST_REJECTED, CRUXY_E_API_RATE_LIMIT, CRUXY_E_API_OVERLOADED, CRUXY_E_BUDGET_EXHAUSTED, CRUXY_E_FORGE_API |
7 | Filesystem | CRUXY_E_FILE_NOT_FOUND, CRUXY_E_PERMISSION_DENIED, CRUXY_E_PATH_ESCAPE, CRUXY_E_CHECKPOINT_FAILED, CRUXY_E_FILE_CHANGED_SINCE_READ |
8 | Index | CRUXY_E_INDEX_EMBEDDER_UNAVAILABLE, CRUXY_E_INDEX_EMBEDDER_NOT_INSTALLED, CRUXY_E_INDEX_EMBEDDER_INSTALL_FAILED, CRUXY_E_INDEX_EMBEDDER_DOWNLOAD_FAILED, CRUXY_E_INDEX_STORE_UNAVAILABLE, CRUXY_E_INDEX_FAILED |
9 | Skill | CRUXY_E_SKILL_INVALID, CRUXY_E_SKILL_NOT_FOUND |
10 | Approval | CRUXY_E_APPROVAL_REQUIRED, CRUXY_E_PLAN_APPROVAL_REQUIRED, CRUXY_E_ROLLBACK_APPROVAL_REQUIRED |
11 | Subagent and tests | CRUXY_E_SUBAGENT_BUDGET, CRUXY_E_SUBAGENT_FAILED, CRUXY_E_SUBAGENT_CANCELLED, CRUXY_E_TEST_ITERATION_LIMIT |
12 | Sandbox | CRUXY_E_SANDBOX_UNAVAILABLE, CRUXY_E_SANDBOX_IMAGE, CRUXY_E_SANDBOX_EXEC |
13 | Hooks | CRUXY_E_HOOK_FAILED, CRUXY_E_HOOK_UNTRUSTED, CRUXY_E_HOOK_INVALID, CRUXY_E_SLASH_INVALID |
14 | Memory and stores | CRUXY_E_MEMORY_INVALID, CRUXY_E_MEMORY_SECRET, CRUXY_E_MEMORY_STORE_UNLOADABLE, CRUXY_E_STORE_LOCKED |
15 | Language servers | CRUXY_E_LSP_SERVER_NOT_FOUND, CRUXY_E_LSP_TIMEOUT, CRUXY_E_LSP_CRASHED |
16 | MCP | CRUXY_E_MCP_UNTRUSTED, CRUXY_E_MCP_CONNECT, CRUXY_E_MCP_BLOCKED, CRUXY_E_MCP_AUTH, CRUXY_E_MCP_CONFIG |
17 | Web | CRUXY_E_WEB_UNAVAILABLE, CRUXY_E_WEB_SEARCH, CRUXY_E_WEB_FETCH, CRUXY_E_WEB_BLOCKED_HOST |
18 | Workspace roots | CRUXY_E_ROOT_UNKNOWN, CRUXY_E_ROOT_AMBIGUOUS, CRUXY_E_ROOT_OVERLAP, CRUXY_E_ROOT_ADD_REFUSED, CRUXY_E_MULTIROOT_WRITE_DEFERRED, CRUXY_E_CHECKPOINT_SET_INCOMPLETE, CRUXY_E_CHECKPOINT_SET_PARTIAL, CRUXY_E_VCS_REMOTE_CHANGED, CRUXY_E_VCS_CROSS_ROOT |
19 | Background jobs | CRUXY_E_JOB_NOT_FOUND, CRUXY_E_JOBS_DISABLED |
20 | Incomplete run | CRUXY_E_AGENT_INCOMPLETE |
21 | Host shell | CRUXY_E_NO_SHELL |
22 | Paid plan required | CRUXY_E_PAID_PLAN_REQUIRED |
Several codes, such as most subagent, language-server, MCP connect, and web codes, are reported to the agent inside a tool result and end the process only when they surface on their own.