CLI reference

Every command, flag and slash command of the DCode CLI.

On this page

This page lists what the CLI accepts. dcode --help prints the same list in your terminal, and /help <command> explains a slash command in the workspace. For everyday use, see DCode CLI; for runs without the workspace, see Scripting and CI.

shell
dcode [command] [options]

With no command, dcode opens the full-screen workspace.

Commands

CommandWhat it does
dcode tuiOpen the workspace. The same as dcode alone.
dcode loginSign in with your Dipole ML Inc. account in the browser. With --no-browser it prints the sign-in link instead of opening a browser.
dcode logoutSign out and remove the saved sign-in from this computer.
dcode doctorCheck Node.js, your PATH, that our servers can be reached, your sign-in, a browser, the macOS permissions and git. --json prints the result as JSON.
dcode plugins <command>Manage plugins: list, install, uninstall, enable, disable, update, validate, marketplace. dcode plugin works too.
dcode skills [list|inspect <name>]List skills, or show one.
dcode commands [list|inspect <name>]List custom slash commands, or show one.
dcode hooks trust <action>Review and trust a project's hooks: status, review, grant, revoke.
dcode mcp <add|remove|list>Add, remove or list MCP servers.
dcode worktree <list|remove <name>>List or remove the git worktrees made with --worktree.
dcode schedule <add|list|remove|run>Run a prompt on a schedule.
dcode app-serverRun the app server the desktop app uses. Not for typing by hand.
dcode helpShow the help.
dcode versionPrint the version.

dcode plugins

shell
dcode plugins list [--json] [--available]dcode plugins install <plugin>[@marketplace] [-s <scope>]dcode plugins uninstall <plugin> [-s <scope>] [--keep-data] [--force]dcode plugins enable <plugin> [-s <scope>]dcode plugins disable [plugin] [-a|--all] [-s <scope>]dcode plugins update <plugin> [-s <scope>]dcode plugins validate <path>dcode plugins marketplace add <source> [--scope <scope>] [--sparse <path>]dcode plugins marketplace list [--json]dcode plugins marketplace remove <name>dcode plugins marketplace update [name]
OptionWhat it does
-s, --scope <scope>Where to install: user (the default) or project.
--availableWith list, also show the plugins of the marketplace.
-a, --allWith disable, disable every enabled plugin.
--keep-dataWith uninstall, keep the plugin's data folder.
-f, --forceWith uninstall, do not ask for confirmation.
--sparse <path>With marketplace add, fetch only this path; repeat for more.

A marketplace source can be a GitHub repository, a git address, a file or a folder. More on Plugins.

dcode mcp

shell
dcode mcp listdcode mcp add <name> [--scope user|project] [--env KEY=VALUE ...] -- <command> [args...]dcode mcp add <name> --url <url> [--transport http|sse] [--header "Name: value" ...] [--oauth] [--scope user|project]dcode mcp remove <name> [--scope user|project]

A server that runs on your computer is the command after --; a remote server is its --url, over http (the default) or sse. User servers are saved in ~/.dcode/cli/config.json and project servers in .dcode/config.json in the project folder. A new server is there in your next session, or after /mcp connect <server>.

dcode schedule

shell
dcode schedule add "<when>" "<prompt>" [--cwd <dir>] [--mode <mode>]dcode schedule list [--json]dcode schedule remove <id>dcode schedule run <id>

<when> is a five-field cron expression in local time (minute, hour, day, month, weekday) or words such as "every day at 9:00", "every monday at 8:30", "every weekday at 9:00" or "every 2 hours". Each run is dcode -p "<prompt>" in that folder (the current one unless you pass --cwd), in the auto mode unless you pass --mode. Your computer's own scheduler starts the runs, and each run's output is added to a log under ~/.dcode/cli/schedules. run runs one now.

dcode worktree

shell
dcode --worktree [name]dcode worktree listdcode worktree remove <name> [--force]

--worktree starts a session in a new git worktree on the branch dcode/<name>; without a name, the date and time are the name. When the session ends, DCode prints how to merge it back and how to remove it. --force removes a worktree that has uncommitted changes, and those changes are lost.

dcode hooks trust

shell
dcode hooks trust status [--workspace <path-or-identity>] [--json]dcode hooks trust review [--workspace <path-or-identity>] [--json]dcode hooks trust grant --workspace <path-or-identity> --hook-digest <sha256> [--hook-digest <sha256> ...]dcode hooks trust grant --workspace <path-or-identity> --all-current --bundle-digest <sha256>dcode hooks trust revoke --workspace <path-or-identity> [--hook-digest <sha256> ... | --all]

Hooks that come with a project do not run until you trust them. A hook that changes after you trusted it needs your trust again.

Options

A flag that is not in this list stops the run with the help. A wrong value stops it with one line that says why.

Run one prompt

OptionWhat it does
-p, --prompt <text>Run one prompt without the workspace, then exit.
--output-format <format>What -p prints: text, json or stream-json (one JSON object per line).
--jsonPrint JSON where a command supports it. For -p, the same as --output-format json.
--input-format <format>text, or stream-json: your messages arrive on standard input, one JSON object per line. Needs --output-format stream-json.
--json-schema <schema>Make the answer of -p JSON that matches this schema (JSON text or a file).
--max-turns <n>Stop a -p run after this many turns.
--attach <path>Attach a file to -p; repeat for more files.

Model and permissions

OptionWhat it does
--model <name>Raven Flash or Raven Max for -p, in any letter case. Without it, your saved choice, else Raven Flash.
--fallback-model <name>The model -p uses when the chosen one is busy.
--mode <mode>The permission mode (below). For -p the default is yolo.
--allowed-tools <rules...>Let tools run without asking for this run, for example "Bash(npm test:*) Edit mcp__github__*". Also written --allowedTools.
--disallowed-tools <tools...>Turn tools off for this run, for example "Bash Edit". Also written --disallowedTools.
--system-prompt <text>Replace the system prompt for this run.
--append-system-prompt <text>Add text after the system prompt for this run.
--crew <mode>Crew for -p: auto, always or off (the default). In the workspace, use /crew mode.
--workflow-mode <mode>Dynamic workflows: disabled (the default), onDemand or alwaysOn.

Sessions

OptionWhat it does
--resume <sessionId>Pick up a saved session by its id (sess_...).
-c, --continuePick up the latest session in this folder.
--fork-sessionWith --resume or --continue, carry on in a copy of that session.
--session-id <uuid>Start the new session with this id. A UUID, with or without sess_ in front.
--name <name>Name the session.
--target <text>Set the session's goal and work on it without the workspace. Not with -p.
--target-replaceWith --target, replace the current goal.

Folders and settings

OptionWhat it does
--cwd <path>Run from this folder.
--add-dir <folders...>Let the agent work in more folders than the current one.
--worktree [name]Start in a new git worktree on the branch dcode/<name>. Not with --resume or --continue.
--mcp-config <file|json>Add MCP servers for this run from {"mcpServers": {...}}; repeat for more.
--settings <file|json>Load more settings for this run, as JSON text or a file.
--locale <locale>The language: en-US, fr-CA or auto.

Browser

OptionWhat it does
--browser-use <mode>Turn on Browser Use for -p, --target or the workspace: headless.
--browser-executable <path>The Chrome or Chromium to use with --browser-use headless.

Display and other

OptionWhat it does
--no-fullscreenKeep the workspace in the terminal's normal scrollback.
--no-colorTurn off colour.
--no-browserWith login, print the sign-in link instead of opening a browser.
--no-update-checkDo not check for a new version at start.
--verbosePrint more detail, including the full error output.
--surface <surface>Where the output of -p or app-server is shown: terminal or desktop.
--force-mcsForce system messages in the middle of a conversation, for models that support them.
--memory-benchWith -p, run project memory extraction and wait for it before exiting. Project memory must be on.
-h, --helpShow the help.
-v, --versionPrint the version.

Permission modes

The values of --mode and /mode. What each mode allows, how to switch and what always asks are on Permission modes.

ValueName in the app
buildAsk before changes
autoAuto
guardedFewer questions
planPlan mode
yoloFull access
editCLI only: file changes inside the project run without asking

The workspace starts in build and a -p run in yolo, unless you pass --mode.

Slash commands

Type these in the workspace. /help <command> explains one.

CommandWhat it does
/help [command]Show the slash command help.
/loginSign in to your Dipole ML Inc. account.
/logoutSign out of your Dipole ML Inc. account.
/setupRun the first-run setup again: theme, folder trust, browser and macOS permission checks, sign-in.
/model [list]Show or switch the model of the session.
/effort [list|<level>]Show or switch the thinking level of the session. Also /variant.
/mode [mode]Show or switch the permission mode.
/plan [task]Switch to plan mode, and send a task if you give one.
/usageShow your 6-hour and weekly use and when each resets.
/statusShow the account, model, version, folder, MCP servers and plugins.
/contextShow what fills the context window.
/compact [instructions]Compress the conversation, with instructions if you give them.
/newStart a fresh session. Also /clear.
/resume [sessionId]Resume a saved session. /continue resumes the latest one in this folder.
/rename <name>Give this session a name.
/fork [latest|checkpointId]Start a new session from a checkpoint of the project.
/rewind [latest|checkpointId]See or restore checkpoints of the project.
/diffList the files DCode changed in this session and show their diffs. /diff --git adds the git diff of the working tree.
/review [branch|--staged]Review local changes or a branch for bugs, risks and missing tests. DCode only reports.
/security-review [branch|--staged]Review local changes or a branch for security problems, with severity, file and line, and a fix for each.
/btw <question>Ask a side question without disturbing the running task.
/goal [objective]Show or set the session's goal; pause, resume, clear and replace manage it. Also /target.
/crew [mode|agents]Show what an agent of the latest crew did. /crew mode auto|always|off sets when DCode starts a crew, and /crew agents auto or a number from 1 to 24 sets how many work at once.
/agentsSee helper agents and background tasks, and manage custom agents.
/bg <task>Run a task as a background helper, so the prompt stays free.
/expert [status|resume|stop|<task>]Run or manage the expert workflow.
/workflow [task]Design and start a dynamic workflow for a task, after you confirm its script. Needs dynamic workflows on (--workflow-mode).
/dwf [list|cancel|resume]List, cancel or resume dynamic workflow runs.
/init [notes]Create or update the project's AGENTS.md instructions.
/memorySee the memory files DCode loads and open one.
/skill [name [task]]List skills, or make the next prompt load one.
/mcp [list|status|connect|disconnect]Show or manage the configured MCP servers.
/plugins [list|enable|disable]Open the plugin manager. Also /plugin.
/add-dir <folder>Let the agent work in another folder for the rest of the session.
/permissions [remove <rule>]Show and remove permission rules.
/config [setting]Change your settings. Also /settings.
/locale [auto|en-US|fr-CA]Show or switch the language. Also /language.
/export [file]Save the conversation as a Markdown file.
/copyCopy the last answer to the clipboard.

Environment variables

VariableWhat it does
DCODE_API_KEYSign in with an API key for one run, without a browser. It is taken out of the environment before anything runs, so the agent's commands never see it (Scripting and CI).
NO_COLORTurn colour off. Wins over FORCE_COLOR.
FORCE_COLORForce colour on.
CIWhen true or 1, the CLI does not check for updates.
DCODE_SKIP_UPDATE_CHECKWhen 1, the CLI does not check for updates.
DCODE_LOG_CONSOLEWhen 1, a -p run prints its full debug output, like --verbose.
DCODE_STORAGE_DIRKeep the CLI's files in this folder instead of ~/.dcode.
VISUAL, EDITORThe editor that Ctrl G, /memory and /agents open.

Exit codes

CodeMeaning
0Done.
1Something failed: a wrong flag or value, a refused API key, an answer that did not match --json-schema, or an error during the run.
2A -p run needs a sign-in and there is none.
3Node.js is too old.

Files

FileWhat it does
~/.dcode/cli/config.jsonYour settings, and your user MCP servers.
~/.dcode/cli/keybindings.jsonYour own keys.
~/.dcode/cli/schedulesThe logs of scheduled runs.
~/.dcode/AGENTS.mdYour own instructions, for every project.
AGENTS.mdThe project's instructions, in the project folder. /init writes it.
.dcode/config.jsonThe project's settings and MCP servers.
.dcode/agentsThe project's custom agents, shared through git.