Skip to main content
This is the supported command surface of the Cortex CLI, one table per group. The generated help is always authoritative: cortex --help and cortex <command> --help come from the same definitions this page describes, so if a flag here disagrees with your installed build, believe the build and check your version with cortex --version. Two invocation forms exist, and the first one has two meanings:
With no subcommand and a terminal attached, cortex starts the interactive interface, and a positional prompt seeds that first session. Without a terminal, use run or exec. Global options go before the subcommand.

Global options

--dangerously-bypass-approvals-and-sandbox turns off both gates at once: nothing asks, and nothing is confined. Use it only in a throwaway environment you are willing to lose. Modes and permissions explains the safer combinations.

Run the agent

cortex run

Non-interactive and streaming. Alias r. Usage: cortex run [OPTIONS] [MESSAGE]...

cortex exec

Headless execution for CI and scripts. Alias e. Usage: cortex exec [OPTIONS] [PROMPT]...

Sessions

Sharing, forking and rewinding are in-session actions, not subcommands. Use the slash commands /share, /fork and /rewind inside a session, or cortex run --share for a one-shot run. See Sessions.

Authentication

Bounty

Agents

cortex agent manages agents. See Agents.

MCP servers

cortex mcp manages connected servers. See MCP servers.

Plugins

cortex plugin manages plugins. Alias plugins. See CLI plugins.

Editor integration

cortex acp starts an Agent Client Protocol server so an editor can drive a session. Standard input and output is the only transport: run cortex acp --stdio. Alongside it you can pass -C/--cwd, -v/--verbose and -m/--model. A nonzero -p/--port or a --host other than the default fails closed with ACP network transport is unsupported; use --stdio, and --agent, --allow-tool or --deny-tool fail with ACP agent selection and tool allow/deny controls are not supported. Both checks run before the server starts. See Editors.

Configuration

See Configuration for the file format and Environment variables for what the binary reads from the environment.

Utilities

Maintenance

Diagnostics

cortex debug groups the diagnostic commands. They are hidden from the main help, and they are supported: use them when you need to know what the CLI actually resolved rather than what you think it resolved. A few further subcommands exist for development of the CLI itself. They are hidden, undocumented and not part of the supported surface. If cortex --help on your build lists a command this page does not, check your version with cortex --version before relying on it.

Exit codes and output shapes

cortex exec is the command to script against. Its exit codes, its json envelope and the streaming event shapes are on Headless and scripting, along with the rule that matters most for automation: parse the JSON, and treat the shape of human-readable text as something that can change between releases.