Skip to content
DevSpace
Esc
↑↓navigate↵open⌘Jpreview
On this page

CLI

Every devspace command — setup, the MCP server, subagents, workflows, and diagnostics.

Setup and server

Command Description
devspace Run first-time setup if needed, then start the server.
devspace init [options] Create or update ~/.devspace/config.jsonc and auth.json. See init options.
devspace serve Start the MCP server on 127.0.0.1:7676.
devspace doctor Show config, runtime, Git, Bash, and native dependency status.
devspace config get Print the persisted config.
devspace config set publicBaseUrl <url|null> Update the public origin, preserving comments. Restart serve to apply it.
devspace worktrees prune Prune managed worktrees unused for three days; CLI agent worktrees are excluded.
devspace show-changes <review-ref> [--json] Inspect a Git-backed review checkpoint.
devspace -v, --version Print the installed version.

init options

In a terminal, devspace init asks its setup questions. Each flag answers one of them, and --yes takes the defaults for the rest. Without a terminal, init uses the defaults too.

Flag Default Meaning
--providers Configured providers, else every detected one Comma-separated subagent providers, such as codex,claude.
--public-url The saved public URL Your tunnel’s HTTPS origin, without /mcp. Setting one also serves an MCP host such as ChatGPT.
--roots Configured roots Project folders an MCP host may open. Needs a public URL, and is required with one unless roots are already configured.
--yes, -y — Use the defaults for every unanswered question.
--force — Update an existing setup.
--json — Print the result as JSON. With a public URL it includes the MCP URL and where the owner password is stored, never the password itself.
devspace init --yes
devspace init --public-url https://your-tunnel-host.example.com --roots ~/work

Subagents

Agent commands need no MCP server, OAuth, or tunnel. They run from the project the agent should work in, using an on-demand local daemon. Without a subagents config section, targets use detected built-in providers and each provider’s default model; Claude and Pi are bundled. Any explicit section replaces detection. Availability does not check sign-in.

Command Description
devspace agents targets List usable providers and profiles, unavailable reasons, or <disabled>…</disabled> when disabled.
devspace agents models [provider] Ask each enabled provider, or the named one, which models it offers here. Each id is exactly what --model and profile model accept; efforts and default appear when the harness reports them. A provider that cannot answer prints its error instead.
devspace agents run <target> [options] <prompt> Start a new logical agent.
devspace agents continue <id> [options] <prompt> Send a follow-up to an existing agent.
devspace agents show <id> Immediate snapshot.
devspace agents wait <id>... [--timeout s] Wait for all current turns or the timeout, then print one observation per agent (duplicate IDs once, in first-seen order). The exit code is aggregated.
devspace agents stop <id> Cancel the agent’s running turn. The agent can be continued later.
devspace agents events <id> [--turn <turn-id>] [--follow] Tool calls, messages, and errors from a turn, as they happen with --follow.
devspace agents ls List agents in the current project.
devspace agents skill [--install <harness> [--project]] Print the subagents skill, or install it for claude-code, codex, cursor, opencode, or agents.
devspace agents daemon <status|stop|logs> Diagnose the local agent daemon; prints diagnostic text/JSON, not agent XML.

Options for run and continue:

Option Description
--model <model>, --effort <level> Override the target’s model or reasoning effort.
--write-mode <read_only|allowed|full_access> Default allowed. See write authority; continuations may lower authority but cannot raise it.
--wait [--timeout <seconds>] Block until the turn ends or timeout. A timeout or Ctrl-C leaves the agent running; scripts should set --timeout, then wait again or stop.
--worktree [--branch <name>] run only. Work in a new Git worktree on branch devspace/<agent id> (or --branch), created from the committed HEAD.
--request-id <key> run only. A retry with the same key returns the same agent instead of starting another.

Use complete logical agent IDs, not provider session IDs or prefixes. Agents started with --worktree stay scoped to their originating checkout. See Subagents for worktree paths, errors, review, and cleanup.

Exit codes

Code Meaning
0 With --wait or wait, the turn completed. Without --wait, run or continue accepted the request and the turn is running.
1 Command error: usage, unknown or unavailable target, workspace conflict, or daemon failure.
2 Agent failed.
3 Agent stopped.
4 Wait timed out; unfinished agents keep running.

For several observations, precedence is failed (2), stopped (3), then timeout (4).

Safe retries

--request-id becomes the logical agent ID. Use 1–128 ASCII characters: the first must be a letter or digit; the rest may also contain ., _, :, or -. Reusing it returns the same agent only when the project, target, brief, resolved options (model, effort, write mode), and worktree/branch choice match. Otherwise the command fails with AGENT_CONFLICT. A matching retry creates no second agent or worktree.

Output for scripts

Agent commands print compact XML fragments; add --json for scripts. Receipts and observations include the DevSpace turn ID as XML turn or JSON turnId. status is running, completed, failed, or stopped.

Command or outcome JSON contract
run / continue without --wait {id,status,turnId}.
wait Array of observations, in first-seen ID order.
targets {enabled,targets,unavailable}.
Completed observation May include response.
Failed observation error: {code,message,retryable,detail?}; optional provider detail is redacted and truncated.
Unfinished wait status: "running", wait: "timeout".
Command error {"error":{...}}, exit 1.
events --follow --json One JSON event per line.

--worktree adds worktree and branch to run, continue, show, wait, and ls output in both formats. See turn events for fields and retention.

Workflows Experimental

Workflow commands exist only when DEVSPACE_EXPERIMENTAL_WORKFLOWS=1 reaches both the CLI and daemon. Stop an existing daemon first with devspace agents daemon stop. There is no config-file switch or MCP workflow tool. See Dynamic workflows.

Command Description
devspace workflow run --name <name> Run .devspace/workflows/<name>.js.
devspace workflow run --file <path> Run a script by path.
devspace workflow run --resume <run-id> Create a resumed run that reuses completed calls.
devspace workflow status <run-id> Run status and phase progress.
devspace workflow wait <run-id> [--timeout s] Wait 0–60 seconds (default 60); return latest state on timeout.
devspace workflow calls <run-id> Compact child-call summaries without prompts or results.
devspace workflow call <run-id> <index> One call’s prompt, result, or error; index is zero-based.
devspace workflow events <run-id> [--after <sequence>] Up to 100 event-log entries after the sequence.
devspace workflow cancel <run-id> Cancel a run.
devspace workflow ls Runs in the current project.

workflow run requires exactly one of --file, --name, or --resume. It takes arguments as JSON with either --args <json> or --args-file <file>, and --write-mode read_only|allowed (default read_only). Resume uses the original arguments and authority. Named workflows and run lookups are scoped to the current checkout or worktree.

Was this page helpful?