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].

OptionDescription
-v, --versionPrint 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.
--verboseShorthand 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.

OptionDefaultDescription
--no-memoryoffThe gateway neither recalls nor captures memory for this run.
--memory-captureoffLet 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.

OptionDefaultDescription
--planoffPlan mode: propose a step-by-step plan for approval before executing.
--sandboxoffRun shell and test commands inside an isolated container. Fails if no container runtime is available.
--root <spec>noneDeclare a workspace root, as name=path or path. Repeatable; the first is the primary root.
--no-memoryoffThe gateway neither recalls nor captures memory for this run.
--memory-captureoffLet 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.

OptionDefaultDescription
--pasteoffPaste an existing API key instead of approving in a browser.

logout

cruxy logout

Revokes your saved credential at the gateway and removes it from ~/.cruxy. It takes no options and does not need a terminal.

OutcomeExit
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 init

Sets 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.

CommandDescription
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 pathShow the config file locations in effect.
config initWrite a default global config file, if none exists.

index

cruxy index [options]

Builds or refreshes the local codebase search index.

OptionDefaultDescription
--statusoffShow index status without building.
--forceoffRe-embed every file, ignoring content hashes.
--installoffInstall the local embedding runtime that semantic search needs. It prints what it downloads first.
--uninstalloffRemove 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.

OptionDefaultDescription
--statusoffShow 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.

OptionDefaultDescription
-b, --base <branch>see descriptionBase branch to merge into. Defaults to git.defaultBase, then the repository's default branch, then main.
-t, --title <title>generatedPull request title, as a conventional-commit subject.
--body <body>generatedPull request body.
--draftoffOpen the pull request as a draft.

checkpoint

cruxy checkpoint list

Inspects 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 test

Runs 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.

CommandDescription
hooks listList 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.

CommandDescription
memory listList 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.

OptionDefaultDescription
--sessionoffOnly the most recent session's runs.
--last <n>offOnly the last n runs.

Pass one of --session or --last, not both.

limits

cruxy limits

Shows 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.

CommandDescription
mcp listList 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.

CommandDescription
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.

OptionDefaultDescription
--alloffList 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.

CommandDescription
/helpShow the session commands.
/clearClear the conversation history and keep the session.
/compactSummarize older history now, to free up context.
/initWrite a project CRUXY.md and load it.
/reloadRe-read the project instructions (CRUXY.md).
/statusShow 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-lastRoll back the most recent checkpointed set of file changes.
/redactMask secrets in this conversation so the model stops seeing them.
/export [path]Write this conversation to a markdown file.
/planToggle 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.
/contextShow 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.
/jobsList 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, /quitLeave the session.

The full-screen session also takes these keys:

KeyAction
TabComplete a slash command.
Ctrl+KOpen the command palette.
Shift+TabCycle the mode: manual, auto-approve, plan, full-auto.
PgUp, PgDnScroll the pane. The mouse wheel does too.
EscReturn to the live tail.
Enter during a turnQueue the line to run when the current turn finishes.
Ctrl+CClear 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+DLeave 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.

ExitCategoryCodes
0SuccessNone. --help and --version also exit 0.
1InternalCRUXY_E_INTERNAL. Also login or init without a terminal or not completed, test with failing tests, and mcp login refusals.
2UsageCRUXY_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
3ConfigCRUXY_E_CONFIG_PARSE, CRUXY_E_CONFIG_INVALID, CRUXY_E_CONFIG_NOT_FOUND
4AuthCRUXY_E_AUTH_MISSING_KEY, CRUXY_E_AUTH_INVALID, CRUXY_E_AUTH_EXPIRED, CRUXY_E_FORGE_AUTH, CRUXY_E_CREDENTIALS_UNPROTECTED
5NetworkCRUXY_E_GATEWAY_UNREACHABLE, CRUXY_E_GIT_PUSH_FAILED
6APICRUXY_E_API, CRUXY_E_API_REQUEST_REJECTED, CRUXY_E_API_RATE_LIMIT, CRUXY_E_API_OVERLOADED, CRUXY_E_BUDGET_EXHAUSTED, CRUXY_E_FORGE_API
7FilesystemCRUXY_E_FILE_NOT_FOUND, CRUXY_E_PERMISSION_DENIED, CRUXY_E_PATH_ESCAPE, CRUXY_E_CHECKPOINT_FAILED, CRUXY_E_FILE_CHANGED_SINCE_READ
8IndexCRUXY_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
9SkillCRUXY_E_SKILL_INVALID, CRUXY_E_SKILL_NOT_FOUND
10ApprovalCRUXY_E_APPROVAL_REQUIRED, CRUXY_E_PLAN_APPROVAL_REQUIRED, CRUXY_E_ROLLBACK_APPROVAL_REQUIRED
11Subagent and testsCRUXY_E_SUBAGENT_BUDGET, CRUXY_E_SUBAGENT_FAILED, CRUXY_E_SUBAGENT_CANCELLED, CRUXY_E_TEST_ITERATION_LIMIT
12SandboxCRUXY_E_SANDBOX_UNAVAILABLE, CRUXY_E_SANDBOX_IMAGE, CRUXY_E_SANDBOX_EXEC
13HooksCRUXY_E_HOOK_FAILED, CRUXY_E_HOOK_UNTRUSTED, CRUXY_E_HOOK_INVALID, CRUXY_E_SLASH_INVALID
14Memory and storesCRUXY_E_MEMORY_INVALID, CRUXY_E_MEMORY_SECRET, CRUXY_E_MEMORY_STORE_UNLOADABLE, CRUXY_E_STORE_LOCKED
15Language serversCRUXY_E_LSP_SERVER_NOT_FOUND, CRUXY_E_LSP_TIMEOUT, CRUXY_E_LSP_CRASHED
16MCPCRUXY_E_MCP_UNTRUSTED, CRUXY_E_MCP_CONNECT, CRUXY_E_MCP_BLOCKED, CRUXY_E_MCP_AUTH, CRUXY_E_MCP_CONFIG
17WebCRUXY_E_WEB_UNAVAILABLE, CRUXY_E_WEB_SEARCH, CRUXY_E_WEB_FETCH, CRUXY_E_WEB_BLOCKED_HOST
18Workspace rootsCRUXY_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
19Background jobsCRUXY_E_JOB_NOT_FOUND, CRUXY_E_JOBS_DISABLED
20Incomplete runCRUXY_E_AGENT_INCOMPLETE
21Host shellCRUXY_E_NO_SHELL
22Paid plan requiredCRUXY_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.

Was this page helpful?