Skip to main content

CLI Reference

Complete command-line flags, subcommands, and slash commands for OpsCode.

Usage

opscode [OPTIONS] [PROMPT]
# or:
ops [OPTIONS] [PROMPT]

When run without arguments, OpsCode starts in interactive TUI mode. Pass a positional prompt or use -n for non-interactive headless mode.


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 most recent, -r <ID> for specific thread ID

Agent selection

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

Model and execution profile

FlagDescription
-M, --model MODELModel specifier (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 max retries for transient model errors
--profile-override JSONOverride model profile fields as a JSON string
--default-model [MODEL]Set or show the current 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, --quietClean output for piping stdout (suppresses spinners/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 to generate acceptance criteria (interactive only)
--rubric TEXT|@PATHAcceptance criteria text or @path for self-evaluation loop (requires non-interactive mode)
--rubric-model MODELDedicated grader model for rubric self-evaluation
--rubric-max-iterations NMax grader iterations per rubric attempt
--recursion-limit NOverride main agent recursion limit (default: 2000)

Approval modes

Mutually exclusive:

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

Shell and sandbox

FlagDescription
-S, --shell-allow-list LISTComma-separated allowed shell commands (recommended, all, or 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 setup shell script to run after sandbox creation

Interpreter and filesystem tools

FlagDescription
--interpreter / --no-interpreterToggle JavaScript QuickJS 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 explicit MCP JSON configuration file
--no-mcpDisable all MCP tool loading
--trust-project-mcpSkip interactive approval for project-level MCP configs
--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 OpsCode version and exit
--verboseEnable verbose debug logging

Subcommands

opscode config

Inspect resolved configuration without starting a 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
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 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 and manage 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> # Scaffolds 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 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

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 comprehensive system diagnostics (checking authentication, network endpoints, core tools, and dependencies).


Slash commands

Available inside an interactive session. Type /help to list all commands.

Core commands

CommandAliasesDescription
/auth/loginOpen interactive credential manager
/logoutRemove stored credentials
/modelOpen model selector modal
/effortSet reasoning effort (low, medium, high)
/fastQuick switch to a faster / cheaper model
/configView or modify runtime configuration
/permissions/permsInspect and toggle tool permissions
/skillsBrowse and inspect active skills
/mcpInspect MCP servers and available tools
/pluginsManage plugins and marketplace sources
/costView session token consumption and USD cost
/contextView context window utilization gauge
/compactTrigger manual conversation compaction
/clearClear conversation history
/clear!Force clear history without confirmation prompt
/resumeOpen thread selector modal to resume a past session
/doctorRun system diagnostics (auth, tools, dependencies)
/bugOpen GitHub bug report template
/help/hList all available slash commands
/exit/quitExit OpsCode session

Power commands

CommandDescription
/agentsOpen subagent selector modal to hot-swap active agent
/goal <text>Define high-level objective and generate acceptance criteria
/rubric <text|@file>Attach evaluation rubric to current session
/tasksOpen task management board
/loopEnter autonomous execution loop
/reviewRequest agent self-review of recent workspace modifications
/memoryView, save, or delete persistent memory entries (AGENTS.md)
/btw <note>Send out-of-band note without triggering LLM turn execution
/copyCopy last assistant response to system clipboard
/traceView or toggle LangSmith tracing status
/versionDisplay OpsCode version and environment metadata
/reloadHot-reload configuration and skill definitions
/restartRestart 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 conversation into a new reusable skill

Exit codes

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