The OpsCode CLI (opscode or ops) runs either as an interactive terminal user interface (TUI) or as a non-interactive headless command for scripts and CI/CD pipelines. This reference documents every command-line flag, subcommand, interactive slash command, and exit code.
Usage
opscode [OPTIONS] [PROMPT]
# or:
ops [OPTIONS] [PROMPT]
Run ops without arguments to launch the interactive TUI. Pass a positional prompt or -n (--non-interactive) to run a single task and exit.
Command-line options
| Flag | Description |
|---|
PROMPT | Non-interactive prompt (positional argument, alternative to -n) |
-n, --non-interactive TEXT | Run a single task non-interactively and exit |
-m, --message TEXT | Initial prompt to auto-submit when an interactive session starts |
-s, --skill NAME | Invoke a skill when the interactive session starts |
--startup-cmd CMD | Shell command executed at startup before the first prompt |
--stdin | Read input from stdin explicitly |
Thread management
| Flag | Description |
|---|
-r, --resume [ID] | Resume a thread: -r for the most recent thread, or -r <ID> for a specific thread ID |
Agent selection
| Flag | Description |
|---|
-a, --agent NAME | Agent or subagent to use (default: opscode) |
Model and execution profile
| Flag | Description |
|---|
-M, --model MODEL | Model specifier in provider:model format (e.g., anthropic:claude-opus-4-7, openai:gpt-4.1) |
--model-params JSON | Extra kwargs to pass to the model constructor as a JSON string |
--max-retries N | Override maximum retries for transient model errors |
--profile-override JSON | Override model profile fields as a JSON string |
--default-model [MODEL] | Set or display the persistent default model |
--clear-default-model | Clear the configured persistent default model |
Non-interactive mode controls
These flags require -n, a positional prompt, or piped stdin:
| Flag | Description |
|---|
-q, --quiet | Emit clean stdout output for piping (suppresses spinners and banners) |
--no-stream | Buffer the full response before writing to stdout |
--max-turns N | Maximum agentic turns before stopping |
--timeout SECONDS | Hard wall-clock timeout in seconds |
Goal and rubric evaluation
| Flag | Description |
|---|
--goal TEXT | Goal objective used to generate live acceptance criteria (interactive mode only) |
--rubric TEXT|@PATH | Acceptance criteria text or @path for autonomous self-evaluation (requires non-interactive mode) |
--rubric-model MODEL | Dedicated grader model for rubric self-evaluation |
--rubric-max-iterations N | Maximum grader iterations per rubric attempt |
--recursion-limit N | Override main agent recursion limit (default: 2000) |
Approval modes
These flags are mutually exclusive:
| Flag | Description |
|---|
-y, --auto-approve | Enable Auto mode (auto-approves safe read-only actions, prompts for mutating ones) |
--yolo | Run gated actions without interactive review (requires initial risk acknowledgement) |
Shell and sandbox
| Flag | Description |
|---|
-S, --shell-allow-list LIST | Comma-separated allowed shell commands (recommended, all, or explicit binary list) |
--sandbox [TYPE] | Remote sandbox for code execution (agentcore, daytona, langsmith, modal, runloop, vercel; default: none) |
--sandbox-id ID | Existing remote sandbox ID to attach to |
--sandbox-snapshot-name NAME | Snapshot or blueprint name to create or attach |
--sandbox-setup PATH | Path to a setup shell script executed after sandbox creation |
| Flag | Description |
|---|
--interpreter / --no-interpreter | Toggle the QuickJS JavaScript interpreter (js_eval) middleware |
--interpreter-tools VALUE | Programmatic Tool Calling (PTC) allowlist: safe, all, or comma-separated list |
--allow-fs-tools LIST | Allowlist of filesystem tools (all or comma-separated: read_file, write_file, edit_file, delete, glob, grep, ls) |
MCP and security
| Flag | Description |
|---|
--mcp-config PATH | Path to an explicit MCP JSON configuration file |
--no-mcp | Disable all MCP tool loading for the session |
--trust-project-mcp | Skip interactive approval for project-level MCP configurations |
--trust-project-hooks | Trust project-level .opscode/hooks.json command handlers |
--acp | Run as an Agent Client Protocol (ACP) server over stdio instead of launching the TUI |
| Flag | Description |
|---|
-v, --version | Show the OpsCode version and exit |
--verbose | Enable verbose debug logging |
Subcommands
opscode config
Inspect and update resolved configuration values without starting an interactive session:
opscode config show # Show all effective values and their sources
opscode config list # List all available options with types and defaults
opscode config get <key> # Show effective value and source for a single option
opscode config set <key> <v> # Set a configuration value in ~/.opscode/config.toml
opscode config path # Show config file locations and existence status
opscode auth
Manage provider credentials from the shell:
opscode auth list # List configured credentials and their sources
opscode auth set <provider> # Set an API key or endpoint for a provider
opscode auth remove <provider> # Remove a stored credential
opscode plugin
Manage plugins and marketplace sources from the shell:
opscode plugin list # List installed and project plugins
opscode plugin install <id> # Install a plugin from a marketplace
opscode plugin uninstall <id> # Uninstall an installed plugin
opscode plugin enable <id> # Enable a plugin
opscode plugin disable <id> # Disable a plugin
opscode plugin marketplace add <url> # Add a remote or local marketplace source
opscode plugin marketplace remove <name> # Remove a marketplace source
opscode plugin marketplace list # List active marketplace sources
opscode skills
Inspect, search, and scaffold domain skills:
opscode skills list # List all discovered skills across all sources
opscode skills info <name> # Display details, domain, and description for a skill
opscode skills find <query> # Search skills by keyword
opscode skills create <name> # Scaffold a new skill directory
opscode mcp
Inspect and test MCP server definitions:
opscode mcp list # List configured MCP servers
opscode mcp tools # List available tools across all MCP servers
opscode mcp test <server> # Test connection to a specific MCP server
opscode threads
Manage conversation history and saved thread checkpoints:
opscode threads list # List recent threads (options: --agent, -n/--limit, --branch, --cwd)
opscode threads delete <id> # Delete a specific thread checkpoint
opscode agents
Inspect and manage subagents:
opscode agents list # List built-in, user, and project subagents
opscode agents reset --agent <name> # Reset an agent's prompt to default
opscode doctor
Run system diagnostics across authentication, network endpoints, DevOps CLI binaries, and local dependencies:
Slash commands
Slash commands are available inside an interactive TUI session. Type /help at any time to browse the full list.
Core commands
| Command | Aliases | Description |
|---|
/auth | /login | Open the interactive credential manager |
/logout | — | Remove stored credentials |
/model | — | Open the model selector modal |
/effort | — | Set reasoning effort (low, medium, high) |
/fast | — | Switch to your configured fast model |
/config | — | View or modify runtime configuration |
/permissions | /perms | Inspect and toggle tool permissions |
/skills | — | Browse and inspect active skills |
/mcp | — | Inspect MCP servers and available tools |
/plugins | — | Manage plugins and marketplace sources |
/cost | — | View session token consumption and estimated USD cost |
/context | — | View the context window utilization gauge |
/compact | — | Trigger manual conversation compaction |
/clear | — | Clear conversation history |
/clear! | — | Force-clear history without confirmation prompt |
/resume | — | Open the thread selector modal to resume a past session |
/doctor | — | Run system diagnostics (auth, tools, dependencies) |
/bug | — | Open the GitHub bug report template |
/help | /h | List all available slash commands |
/exit | /quit | Exit the OpsCode session |
Power commands
| Command | Description |
|---|
/agents | Open the subagent selector modal to switch the active agent |
/goal <text> | Define a high-level objective and generate live acceptance criteria |
/rubric <text|@file> | Attach an evaluation rubric to the current session |
/tasks | Open the task management board |
/loop | Enter an autonomous execution loop |
/review | Request an agent self-review of recent workspace modifications |
/memory | View, save, or delete persistent memory entries (AGENTS.md) |
/btw <note> | Send an out-of-band note without triggering an LLM turn |
/copy | Copy the last assistant response to the system clipboard |
/trace | View or toggle LangSmith tracing status |
/version | Display the OpsCode version and environment metadata |
/reload | Hot-reload configuration, plugins, and skill definitions |
/restart | Restart the current agent session |
/update | Check for newer OpsCode package releases |
/auto-update | Toggle automatic background updates |
/install | Install missing package dependencies |
/notifications | Toggle desktop notification toasts |
/scrollbar | Toggle chat window vertical scrollbars |
/timestamps | Toggle timestamp display on messages |
/skill <name> | Explicitly invoke a skill |
/skill-create | Distill the current conversation into a new reusable SKILL.md |
Exit codes
| Code | Meaning |
|---|
0 | Success |
1 | General runtime error |
2 | Argument parsing or validation error |
130 | Interrupted by user (Ctrl+C / SIGINT) |