Skip to main content

CLI reference

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​

Prompts and input​

FlagDescription
PROMPTNon-interactive prompt (positional argument, alternative to -n)
-n, --non-interactive TEXTRun a single task non-interactively and exit
-m, --message TEXTInitial prompt to auto-submit when an interactive session starts
-s, --skill NAMEInvoke a skill when the interactive session starts
--startup-cmd CMDShell command executed at startup before the first prompt
--stdinRead input from stdin explicitly

Thread management​

FlagDescription
-r, --resume [ID]Resume a thread: -r for the most recent thread, or -r <ID> for a specific thread ID

Agent selection​

FlagDescription
-a, --agent NAMEAgent or subagent to use (default: opscode)

Model and execution profile​

FlagDescription
-M, --model MODELModel specifier in provider:model format (e.g., anthropic:claude-opus-4-7, openai:gpt-4.1)
--model-params JSONExtra kwargs to pass to the model constructor as a JSON string
--max-retries NOverride maximum retries for transient model errors
--profile-override JSONOverride model profile fields as a JSON string
--default-model [MODEL]Set or display the persistent default model
--clear-default-modelClear the configured persistent default model

Non-interactive mode controls​

These flags require -n, a positional prompt, or piped stdin:

FlagDescription
-q, --quietEmit clean stdout output for piping (suppresses spinners and banners)
--no-streamBuffer the full response before writing to stdout
--max-turns NMaximum agentic turns before stopping
--timeout SECONDSHard wall-clock timeout in seconds

Goal and rubric evaluation​

FlagDescription
--goal TEXTGoal objective used to generate live acceptance criteria (interactive mode only)
--rubric TEXT|@PATHAcceptance criteria text or @path for autonomous self-evaluation (requires non-interactive mode)
--rubric-model MODELDedicated grader model for rubric self-evaluation
--rubric-max-iterations NMaximum grader iterations per rubric attempt
--recursion-limit NOverride main agent recursion limit (default: 2000)

Approval modes​

These flags are mutually exclusive:

FlagDescription
-y, --auto-approveEnable Auto mode (auto-approves safe read-only actions, prompts for mutating ones)
--yoloRun gated actions without interactive review (requires initial risk acknowledgement)

Shell and sandbox​

FlagDescription
-S, --shell-allow-list LISTComma-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 IDExisting remote sandbox ID to attach to
--sandbox-snapshot-name NAMESnapshot or blueprint name to create or attach
--sandbox-setup PATHPath to a setup shell script executed after sandbox creation

Interpreter and filesystem tools​

FlagDescription
--interpreter / --no-interpreterToggle the QuickJS JavaScript interpreter (js_eval) middleware
--interpreter-tools VALUEProgrammatic Tool Calling (PTC) allowlist: safe, all, or comma-separated list
--allow-fs-tools LISTAllowlist of filesystem tools (all or comma-separated: read_file, write_file, edit_file, delete, glob, grep, ls)

MCP and security​

FlagDescription
--mcp-config PATHPath to an explicit MCP JSON configuration file
--no-mcpDisable all MCP tool loading for the session
--trust-project-mcpSkip interactive approval for project-level MCP configurations
--trust-project-hooksTrust project-level .opscode/hooks.json command handlers
--acpRun as an Agent Client Protocol (ACP) server over stdio instead of launching the TUI

Meta​

FlagDescription
-v, --versionShow the OpsCode version and exit
--verboseEnable 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:

opscode doctor

Slash commands​

Slash commands are available inside an interactive TUI session. Type /help at any time to browse the full list.

Core commands​

CommandAliasesDescription
/auth/loginOpen 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/permsInspect 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/hList all available slash commands
/exit/quitExit the OpsCode session

Power commands​

CommandDescription
/agentsOpen 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
/tasksOpen the task management board
/loopEnter an autonomous execution loop
/reviewRequest an agent self-review of recent workspace modifications
/memoryView, save, or delete persistent memory entries (AGENTS.md)
/btw <note>Send an out-of-band note without triggering an LLM turn
/copyCopy the last assistant response to the system clipboard
/traceView or toggle LangSmith tracing status
/versionDisplay the OpsCode version and environment metadata
/reloadHot-reload configuration, plugins, and skill definitions
/restartRestart the current agent session
/updateCheck for newer OpsCode package releases
/auto-updateToggle automatic background updates
/installInstall missing package dependencies
/notificationsToggle desktop notification toasts
/scrollbarToggle chat window vertical scrollbars
/timestampsToggle timestamp display on messages
/skill <name>Explicitly invoke a skill
/skill-createDistill the current conversation into a new reusable SKILL.md

Exit codes​

CodeMeaning
0Success
1General runtime error
2Argument parsing or validation error
130Interrupted by user (Ctrl+C / SIGINT)