Droid CLI Reference

Complete reference for the Droid CLI, including commands and flags

Installation

Install Droid CLI

The Droid CLI operates in two modes:

  • Interactive (droid) - Chat-first REPL with slash commands
  • Non-interactive (droid exec) - Single-shot execution for automation and scripting

Installing a specific version

Pin a version when upgrades must be reviewed and applied intentionally, such as in CI runners, provisioned development environments, or other reproducible systems.

npm

Specify an exact package version:

Bash
npm install -g [email protected]

The binaries published through npm have auto-updates disabled at build time, so the installed version remains pinned. To upgrade, install the new version explicitly with npm.

Built-in updater

After installing Droid through the standalone installer, select a version with:

Bash
droid update --version 0.174.0

This command can also roll back to an older version. Use droid update --check to check for an available update without installing it.

Note

Standalone installations enable automatic updates by default. After selecting a version, follow the auto-update guidance to keep it pinned.

Direct binary download

Release binaries and their SHA256 checksums use the following paths:

https://downloads.factory.ai/factory-cli/releases/<version>/<platform>/<arch>/<binary>
https://downloads.factory.ai/factory-cli/releases/<version>/<platform>/<arch>/<binary>.sha256
  • <platform>: linux, darwin, or windows
  • <arch>: x64, arm64, or x64-baseline
  • <binary>: droid on Linux and macOS, or droid.exe on Windows

For example, download and verify the Linux x64 binary:

Bash
VERSION=0.174.0
BASE_URL="https://downloads.factory.ai/factory-cli/releases/${VERSION}/linux/x64"
 
curl -fsSLO "${BASE_URL}/droid"
curl -fsSLO "${BASE_URL}/droid.sha256"
echo "$(awk '{print $1}' droid.sha256)  droid" | sha256sum --check
chmod +x droid

Move the verified binary to a directory on PATH. The download URL layout is an implementation detail, so always pin a version and verify its checksum.

Droid CLI commands

CommandDescriptionExample
droidStart interactive REPLdroid
droid "query"Start REPL with initial promptdroid "explain this project"
droid --resume [sessionId]Resume a session (defaults to last modified). Alias: -rdroid --resume
droid --fork <sessionId>Fork and resume a session in a new copydroid --fork session-abc123
droid exec "query"Execute task without interactive modedroid exec "summarize src/auth"
droid exec -f prompt.mdLoad prompt from filedroid exec -f .factory/prompts/review.md
cat file | droid execProcess piped contentgit diff | droid exec "draft release notes"
droid exec -s <id> "query"Resume existing session in exec modedroid exec -s session-123 "continue"
droid exec --list-toolsList available tools, then exitdroid exec --list-tools
droid search "query"Search across local sessions (messages, documents, tool results). Alias: droid finddroid search "auth bug"
droid rules checkValidate permission rules and optionally preview command policydroid rules check --command 'git push origin main'
droid loop <command>Create, list, pause, resume, or cancel a session's recurring prompts; Droid runs them as tools in a session (details)droid loop --help
droid work-item linkLink the calling session to a Linear issue; Droid runs it as a tool in a session (details)droid work-item link --help
droid analytics effectiveness <command>Fetch usage for, and render, the Agent Effectiveness report (details)droid analytics effectiveness usage --date-range last_30_days
droid analytics readiness storeStore a /readiness-report result; Droid runs it as a tool in a session (details)droid analytics readiness store --help
droid mcp add <name> <url>Add an MCP serverdroid mcp add api https://api.example.com/mcp --type http
droid mcp remove <name>Remove an MCP serverdroid mcp remove linear
droid mcp authSign in to every MCP server that needs authentication, one at a timedroid mcp auth
droid plugin install <plugin>Install a plugin. Alias: droid plugin idroid plugin install droid-control@factory-plugins
droid plugin uninstall <plugin>Uninstall a plugin. Alias: droid plugin removedroid plugin uninstall droid-control@factory-plugins
droid plugin update <plugin>Update a plugin to the latest versiondroid plugin update droid-control@factory-plugins
droid plugin listList installed pluginsdroid plugin list
droid plugin marketplaceManage plugin marketplacesdroid plugin marketplace
droid computer register [name]Register this computer for Remote Controldroid computer register laptop
droid computer removeRemove this computer's Remote Control registrationdroid computer remove
droid computer listList computers and Factory Environments as JSON; use --human for readable tablesdroid computer list --human
droid computer service-accounts listList service accounts (Manager role or higher)droid computer service-accounts list
droid computer ssh <name>SSH into a registered computerdroid computer ssh laptop
droid computer port-forward <name> <mappings...>Forward local ports to a computer over the relaydroid computer port-forward laptop 8080:80
droid daemonRun the Factory daemon serverdroid daemon
droid daemon --remote-controlConnect this computer through Remote Control. Alias: --remote-accessdroid daemon --remote-control
droid updateManually update the CLI to latest versiondroid update

List computers and environments

droid computer list lists your computers and the Factory Environments visible to your identity, including whether each Environment can launch. It is read-only and prints JSON by default. Use --human for readable tables.

Bash
droid computer list
droid computer list --human

To list another identity's inventory, first list the organization's service accounts, then select an active account by its ID or name. Both account discovery and account selection require the Manager role or higher. Replace the example values with an account returned by the first command:

Bash
droid computer service-accounts list
droid computer list --service-account-id sa_example
droid computer list --service-account-name "deploy-bot"
FlagBehavior
--service-account-id <id>List the selected service account's computers and Factory Environments instead of your own.
--service-account-name <name>Select the same inventory by account name. Supply either the ID or the name, not both.
--humanPrint readable output instead of JSON; nonempty lists appear as a computer table followed by a Factory Environments table.

The service-account list returns {"ok": true, "data": {"serviceAccounts": [...]}}. Each account has id, name, and status. Deleted accounts are omitted; inactive accounts remain visible, but only active accounts can be selected with the flags above or run automations.

Read the human output

In English, --human prints a computer table with COMPUTER, STATUS, PROVIDER, and ID columns and marks this machine with (this machine) when Droid can identify it. When there are no computers, it prints a message instead: how to register this machine for your own inventory, or No computers registered for service account "<name>". for a selected account.

When Environments are returned, a Factory Environments: section follows after a blank line. The table has ENVIRONMENT, STATUS, SCOPE, LAUNCHABLE, and ID columns, and LAUNCHABLE is yes or no. For example, with illustrative names and IDs:

COMPUTER               STATUS  PROVIDER  ID
laptop (this machine)  active  byom      3f2a9c1e-5b7d-4e8a-9c0f-1d2e3f4a5b6c
dev-box                active  e2b       8b1c2d3e-4f5a-4b6c-8d7e-9f0a1b2c3d4e
 
Factory Environments:
ENVIRONMENT   STATUS    SCOPE         LAUNCHABLE  ID
team-default  ready     organization  yes         0c56098a-c40d-4a56-bdd2-8f58120dc456
my-sandbox    building  user          no          6de596d4-1a67-4ebc-be46-61265c198698

With --service-account-id or --service-account-name, the heading is Factory Environments service account "<name>" can launch:.

If the Environment lookup fails, one line replaces the Environments section, and the computers still list. The HTTP status appears when one is available:

Factory Environments could not be listed (HTTP <status>: <error>).

Without an HTTP status, the line is Factory Environments could not be listed (<error>). When the lookup succeeds with no Environments, the section is omitted.

Read the JSON result

A successful computer list returns {"ok": true, "data": {...}} with these fields:

FieldMeaning
data.serviceAccountThe selected account (id, name, status), or null for your own inventory.
data.computersComputer rows with id, name, providerType, thisMachine, and status when known. An unknown status appears as unknown in the human table.
data.environmentsA successful Environment lookup (ok: true, items) or a failed lookup (ok: false, error, and an HTTP status when available).

Each Environment item has id, name, status, scope, and launchable. Use an Environment with launchable: true when choosing an automation's environmentName. Account selection applies to both the computers and Environments in the result.

An Environment lookup can fail while the computer list succeeds. Check data.environments.ok before reading items: ok: false means the lookup failed, not that no Environments exist. The top-level ok can still be true, and the command can exit successfully with the computer inventory intact.

Migrate existing scripts and prompts

droid computer list defaults to JSON. If a script expects the computer table, add --human and account for the Factory Environments section, or update the script to read data.computers and handle data.environments separately.

Update tool names in prompts and automation instructions:

Previous toolCurrent tool
ListComputerscomputer_list (Script: tools.computer.list)
ListServiceAccountscomputer_service_accounts_list (Script: tools.computer.service_accounts_list)
PickSlackChannelsRemoved.

Check permission rules

Use droid rules check to validate permission rules, run their embedded matching examples, and preview a decision without executing a command.

Bash
droid rules check
droid rules check --command 'git push origin main'
droid rules check --file rules.json --command 'npm publish' --json
OptionBehavior
--file <path>Check a standalone {version, rules} object or bare rule array. Does not load built-ins or other settings. A full settings.json wrapper is not accepted.
--command <shell-command>Preview the policy decision for a non-empty command. Quote it so your shell passes it as one argument.
--jsonPrint the report as one JSON object, including rule diagnostics and, when requested, decision and match details.

Without --file, the checker validates resolved settings. A command preview follows the active policy engine; validating rules does not enable enforcement on a client still using legacy policy.

Exit code 0 means the check succeeded, even if the preview says block. Invalid rules or failed examples produce exit code 1. Preview covers command policy only, not hooks, sandbox permissions, autonomy, or session approvals.

The commandAllowlist, commandDenylist, and commandBlocklist settings are deprecated but remain respected for backward compatibility. Use permissionRules for new policy; see migration guidance.

Run loop, work item, and analytics commands

droid loop, droid work-item link, and droid analytics are the command form of tools that Droid calls during a session. The droid analytics effectiveness commands and their tools share one schema: each flag is a field of the tool, spelled in kebab case on the command line, and the tool returns the command's data. For example, droid analytics effectiveness usage --date-range last_30_days is the analytics_effectiveness_usage tool with dateRange: "last_30_days", which a Script calls as tools.analytics.effectiveness_usage. The droid loop commands, droid work-item link, and droid analytics readiness store run only as tools or in a Script. Their commands accept no input; they name the tool to call instead.

Where a command runs decides what it does:

WhereBehavior
A Droid sessionDroid calls the tool directly. If the session's shell runs one of these commands, it exits 1 with in_process_command and names the tool to call instead.
A terminal outside any sessionThe droid analytics effectiveness commands run. The droid loop commands, droid work-item link, and droid analytics readiness store exit 1 with in_process_command and name the tool to call, because each acts on a session.

A command prints {"ok": true, "data": {...}} to stdout and exits 0 when it succeeds. A failure prints {"ok": false, "code": "...", "error": "..."} to stderr, sometimes with details, and exits 1. A command group that is not enabled for your organization fails with an unknown-command error instead, and a failure while Droid starts, such as a settings file it cannot read, can print a plain-text error instead. A flag that takes JSON accepts it inline or from a file, as in --request @request.json.

CodeMeaning
invalid_inputThe command line could not be parsed, such as an unknown flag or an @file that cannot be read; a flag or tool field failed its schema; or loop_resume was given a listed loop that is not paused.
not_foundThe loop ID matched no loop in this session, or loop_pause or loop_resume was given a cancelled or expired loop.
unavailableThe command needs a session, this machine cannot schedule loops, or session contents sync is off.
permission_deniedA permission rule or the sandbox denied a file the command writes, such as the report droid analytics effectiveness render saves.
in_process_commandA session's shell ran the command, or a terminal ran a command that runs only as a tool. details.tool and details.scriptPath name the tool to call.
request_failedThe local daemon or Droid refused a request the command made. When Droid answered, status carries its HTTP status.

In Airgap Mode, Droid does not offer the work_item_link and analytics_effectiveness_usage tools, because each needs Droid on every run.

Schedule recurring prompts

In a session, type /loop <interval> <prompt> or ask Droid to repeat a task on a schedule. /loop <interval> <prompt> schedules the loop directly; for a request in prose, Droid creates the loop with the loop_create tool. /loop status lists the session's loops, and /loop stop <loop-id> stops one (/loop stop all stops every loop in the session).

> /loop 30m check the CI run on my pull request and fix any failure

Loops fire from the daemon on the session's machine, so they run on your own machine and on Computers. On your own machine, a loop runs only while its session is open. On a Computer, a loop keeps running after you leave the session: each run wakes the Computer and reopens the session. There a loop expires seven days after it is created or last resumed, rescheduled, or given a new prompt, so a forgotten loop does not keep running unattended. Workspace sandboxes cannot schedule loops, because nothing wakes a paused sandbox for a scheduled run.

Droid manages a session's loops with five tools, which a Script calls as tools.loop.create, tools.loop.list, tools.loop.pause, tools.loop.resume, and tools.loop.cancel:

ToolWhat it doesFields
loop_createSchedule prompt as a recurring prompt for the calling session. Inside a Task, the loop belongs to the session that launched the Task when the Task's session records one, and otherwise to the Task's own session. Runs only in a session.prompt and cron, both required; waitForSchedule
loop_listList the session's loops, with their IDs, schedules, and states.None
loop_pauseStop a loop from running and keep it, so loop_resume can restart it.loopId
loop_resumeRun a paused loop on its schedule again. A listed loop that is not paused fails with invalid_input; a cancelled or expired loop, which loop_list does not show, fails with not_found.loopId
loop_cancelDelete a loop. Cancelling a loop that is already cancelled succeeds again.loopId

For example, a Script schedules a loop that checks CI every 15 minutes, starting at the first scheduled run, with tools.loop.create({ prompt: "check CI", cron: "*/15 * * * *", waitForSchedule: true }).

cron takes a five-field cron expression in UTC:

  • A step cadence such as */15 * * * * or 0 */2 * * * is anchored to the minute the loop is created, so its scheduled runs fall on minute boundaries. It must be an exact interval from 1 minute to 24 hours.
  • A time of day, such as 0 9 * * * for 09:00 UTC, is kept as written.
  • The loop also runs once right away unless waitForSchedule is true. Without that run, the scheduler skips a first scheduled run that falls less than 30 seconds after the loop is created.

A loop belongs to the session that created it. A loop created inside a Task belongs instead to the session that launched the Task, when the Task's session records one. Each run prompts the session the loop belongs to. To manage a session's loops, use /loop in that session or ask Droid.

Read the loop output

/loop status prints one line per loop:

6503a90d · active · next 9:15am · expires in 7d · #3 · check CI

The fields are the loop ID; its state, such as active or paused; the next run time, or the cadence when no run is scheduled or the loop is paused; expires in <time> when the loop expires; # and the number of runs so far; and the start of the prompt. /loop status prints No scheduled loops. when there are none. When /loop <interval> <prompt> creates a loop, it shows the schedule and the same line for the new loop. loop_pause, loop_resume, and loop_cancel fail with not_found when the loop ID matches no loop in the session, such as Loop 6503a90d was not found among this session's loops.

loop_create, loop_pause, and loop_resume return the loop record as loop, loop_list returns loops, and loop_cancel returns loopId. A loop record carries id, status, schedule.expression, schedule.nextRunAt when a run is scheduled, expiresAt when the loop expires, and stats.fireCount.

Linking a session to a Linear issue records which issue the session works on, so Droid can track the session's cost and productivity against it. In a session, type /link-work <url>, or tell Droid which issue the session is for; Droid links it with the work_item_link tool (tools.work_item.link in a Script), the tool form of droid work-item link. The tool tells Droid to link only an issue you identify as the session's work, not one the conversation mentions in passing.

> /link-work https://linear.app/acme/issue/PLT-524

/link-work with no URL shows the session's current link, and /link-work clear removes it. A session links one issue at a time: the latest link replaces the previous one, whether you or Droid made it.

Linking needs:

  • Work item linking enabled for your organization. Until Droid enables it, /link-work is hidden, Droid does not offer work_item_link, and droid work-item link fails with unknown command 'work-item'.
  • Session contents sync, because the link is stored with the synced session. With sync off, linking fails with unavailable.

The work_item_link tool takes workItemUrl, a full Linear URL, such as https://linear.app/acme/issue/PLT-524. A bare issue key such as PLT-524, or a URL outside Linear, fails with invalid_input. The stored URL drops any credentials, query string, and fragment. The tool returns the stored workItemUrl, platform (linear), and ticketId: the issue key, or null when the URL names no issue.

Generate an Agent Effectiveness report

/agent-effectiveness-report builds an HTML report that relates your organization's Droid usage to the pull requests and work items your team delivered. Add a timeframe, or Droid asks for one: the last 30 days, the last 90 days, lifetime, or a custom start and end date.

> /agent-effectiveness-report last 30 days

Droid fetches usage from Droid with the analytics_effectiveness_usage tool, collects merged pull requests with the GitHub CLI and work items from Linear or Jira, joins them by person, and renders the report with the analytics_effectiveness_render tool. Droid does not upload pull request or work item data to Droid; it joins and renders them on the session's machine, then saves the report as an HTML file and tries to open it in your browser. In a headless environment, or when opening fails, Droid gives you the file's path and link instead.

The report needs:

  • The Owner or Manager role in an organization where Droid has enabled the report. /agent-effectiveness-report is listed only for those users.
  • Linear or Jira access, through an MCP server or an API key.
  • The GitHub CLI (gh), signed in to an account that can see your organization's GitHub organization.

Without Linear or Jira access, or without gh access, Droid stops instead of rendering a partial report.

Run the report steps yourself

droid analytics effectiveness runs the same two steps from a terminal or a script. Both commands print JSON; neither takes --human.

CommandWhat it doesExample
droid analytics effectiveness usageFetch per-user usage and organization totals for a date range. Needs the same role and enablement as the report.droid analytics effectiveness usage --date-range last_30_days
droid analytics effectiveness renderRender the report from usage and the pull requests and work items you collected, and save it as an HTML file.droid analytics effectiveness render --request @request.json --coding-usage @usage.json --daily-usage-rows @daily.json

usage takes the date range:

FlagBehavior
--date-range <range>custom (the default), last_30_days, last_90_days, or lifetime.
--start-date <date>First day of the range, as YYYY-MM-DD. Required with custom.
--end-date <date>Last day of the range, as YYYY-MM-DD, inclusive. Required with custom.

A range other than lifetime covers at most 90 days; a longer one fails with request_failed and status 400. For a user who is not an Owner or Manager, or an organization without the report enabled, usage fails with request_failed. On success, data carries organizationId, organizationName, the resolved startDate and endDate, generatedAt, codingUsage, and totalUsage. codingUsage has one row per user, with userId, userEmail, sessions, billingEvents, billableTokens, droidCommits, droidPrsCreated, toolCalls, skillCalls, and fileOperations. totalUsage holds the organization's sessions, billingEvents, and billableTokens.

render takes the collected data:

FlagBehavior
--request <json|@file>Required. The report request: the organization's ID and name, the resolved date range, the work items, pull requests, and repositories you collected, and render options.
--coding-usage <json|@file>Required. The codingUsage rows usage returned for the same range, unchanged.
--total-usage <json|@file>The totalUsage that usage returned. The headline credits figure uses it; every chart and per-user figure uses codingUsage.
--daily-usage-rows <json|@file>Required. One entry per day of the range: the date and the codingUsage rows of a usage call for that day alone. A count of entries that differs from the number of days fails with invalid_input. A repeated or out-of-range date is not rejected when the count matches, so give each date exactly once.

render makes no request to Droid. It saves agent-effectiveness-report-<start>-to-<end>.html in an agent-effectiveness-report directory under the system temporary directory, and returns data.filename, data.path, data.fileUrl, and data.trendPointCount, the number of days in the report's daily trend.

Store a readiness report

/readiness-report evaluates the repository, then Droid stores the result with the analytics_readiness_store tool (tools.analytics.readiness_store in a Script), the tool form of droid analytics readiness store. Storing a report runs only in a session.

The readinessReportUpload setting decides where the report goes. always uploads it to Droid, never keeps it off Droid, and ask or no setting asks you first when the session can ask you. A refresh you start from the readiness page in Droid uploads without asking, unless the setting is never. When the report is not uploaded, because of the setting, a declined or impossible ask, Airgap Mode, or a failed upload, Droid saves it in the repository's .factory directory.

analytics_readiness_store takes these fields:

FieldBehavior
repoUrlRequired. Repository URL, such as https://github.com/owner/repo. The username and password of an HTTP or HTTPS URL are stripped before the report is stored.
reportRequired. Each readiness criterion's numerator (null when skipped), denominator, and rationale. Every criterion key is required.
appsMap of app paths to their descriptions, for monorepos, such as {"apps/web": {"description": "Customer dashboard"}}.
commitHashCommit the report describes (git rev-parse HEAD).
branchBranch the report describes (git rev-parse --abbrev-ref HEAD).
hasLocalChangesThe working tree had uncommitted changes.
hasNonRemoteCommitsThe branch had commits not pushed to its remote.
modelUsedModel and reasoning level that generated the report: id and reasoningEffort (low, medium, high, or off).

The result says whether the report was uploaded:

uploadedOther fields
truereportId, the report's ID in Droid.
falsereason: disabled_by_setting, declined, consent_unavailable, airgap, or upload_failed. localPath: where the report was saved. For disabled_by_setting, declined, or consent_unavailable, a failed save gives localPath null, with localError saying why.

When saving fails in Airgap Mode, the call fails with that save's error, such as permission_denied. When the upload and then the save both fail, the call fails with request_failed.

Update tool names in prompts and automations

These tools replace earlier tools. Update tool names in prompts, automation instructions, and tool selectors:

Previous toolCurrent tool
Looploop_create, loop_list, loop_pause, loop_resume, and loop_cancel (Script: tools.loop.create, tools.loop.list, tools.loop.pause, tools.loop.resume, tools.loop.cancel)
LinkWorkItem, link-work-item-cliwork_item_link (Script: tools.work_item.link)
get_agent_effectiveness_usageanalytics_effectiveness_usage (Script: tools.analytics.effectiveness_usage)
render_agent_effectiveness_reportanalytics_effectiveness_render (Script: tools.analytics.effectiveness_render)
store_agent_readiness_reportanalytics_readiness_store (Script: tools.analytics.readiness_store)

A denial of a previous tool, such as --remove-tools Loop, also denies the tools that replaced it. Selectors that add tools, --only-tools and --add-tools, need the current names.

Droid CLI flags

Customize droid's behavior with command-line flags:

FlagDescriptionExample
-f, --file <path>Read prompt from a filedroid exec -f plan.md
-m, --model <id>Select a specific model IDdroid exec -m claude-opus-5-5
-s, --session-id <id>Continue an existing sessiondroid exec -s session-abc123
--auto <level>Set autonomy level (low, medium, high)droid exec --auto medium "run tests"
--only-tools <ids>Use only these tools: names such as Read, or MCP:<server>[/<tool>] (comma or space separated)droid exec --only-tools Read,Grep,Glob,LS
--add-tools <ids>Add tools to the default set (same selectors as --only-tools)droid exec --add-tools MCP:linear
--remove-tools <ids>Remove tools from the allowed set (same selectors as --only-tools)droid exec --auto low --remove-tools Execute
--disable-builtin-skillsDisable Factory-provided builtin skills in interactive or exec sessions while preserving other skill sourcesdroid --disable-builtin-skills
--list-toolsPrint available tools and exitdroid exec --list-tools
-o, --output-format <format>Output format (text, json, stream-json, stream-jsonrpc)droid exec -o json "document API"
--input-format <format>Input format for multi-turn sessions. Use stream-jsonrpc; the older stream-json mode is deprecated. Must match --output-format.droid exec --input-format stream-jsonrpc -o stream-jsonrpc
-r, --resume [sessionId]Resume a previous session. In interactive mode, -r is --resume; in droid exec, -r is --reasoning-effort.droid -r
-r, --reasoning-effort <level>Override reasoning effort; valid levels are model-dependent (see /models). In droid exec, -r maps to this flag.droid exec -r high "debug flaky test"
--spec-model <id>Use a different model ID for specification planningdroid exec --spec-model claude-opus-5-5
--spec-reasoning-effort <level>Override reasoning effort for spec modedroid exec --use-spec --spec-reasoning-effort high
--use-specStart in specification mode (plan before executing)droid exec --use-spec "add user profiles"
--skip-permissions-unsafeSkip all permission prompts; command blocks still apply (unsafe)droid exec --skip-permissions-unsafe
--cwd <path>Execute from a specific working directory (use an absolute path)droid exec --cwd "$PWD/service" --auto medium "run tests"
-w, --worktree [name]Run the session in an isolated git worktreedroid --worktree fix-bug
--tag <spec>Session tag (name or JSON, repeatable)droid exec --tag code-review
--log-group-id <id>Log group ID for filtering logsdroid exec --log-group-id grp-123
--fork <id>Fork and resume an existing session into a new copydroid exec --fork session-abc123
--missionRun droid exec in Mission Mode (multi-agent orchestration). Requires --auto high or --skip-permissions-unsafe.droid exec --mission --auto high -f mission.md
--worker-model <id>Model used for mission worker agentsdroid exec --mission --worker-model claude-opus-5-5
--worker-reasoning-effort <level>Reasoning effort for mission worker agents (model-dependent; see /models)droid exec --mission --worker-reasoning-effort medium
--validator-model <id>Model used for mission validator agentsdroid exec --mission --validator-model gpt-6.2-sol
--validator-reasoning-effort <level>Reasoning effort for mission validator agentsdroid exec --mission --validator-reasoning-effort high
--append-system-prompt <text>Append custom text to the end of the system promptdroid --append-system-prompt "Always run tests."
--append-system-prompt-file <path>Append the contents of a file to the end of the system promptdroid --append-system-prompt-file .factory/system.md
--settings <path>Apply a settings file merged on top of the normal settings hierarchy, for this process onlydroid exec --settings ./runtime-settings.json
-v, --versionDisplay CLI versiondroid -v
-h, --helpShow help informationdroid --help
Tip

Use --output-format json for scripting and automation, so you can parse droid's responses programmatically.

Note

--output-format controls how droid exec serializes results. Your saved output style controls how Droid writes the responses inside them.

Manage automations

Create and manage automations from a Droid session. Type /automations to open this machine's scheduled automations, or ask Droid to create, list, read, edit, delete, or run an automation. Droid does this with the automation tools; there is no droid automations command.

> /automations
ToolWhat it does
ListAutomationTemplatesList the prompt presets that CreateAutomation applies with templateId. Pass trigger to list only the presets for that trigger.
ListAutomationsList the scheduled automations on this machine, or the scheduled, webhook, Slack, and chained automations in the cloud. It omits prompts; use ReadAutomation to read one.
ReadAutomationShow one automation and its full prompt. When this machine's daemon cannot supply a local automation's prompt, the result says so instead.
CreateAutomationCreate an automation. trigger is schedule (the default), webhook, slack, or automation for a chained automation.
EditAutomationChange an automation. A new prompt replaces the whole prompt.
DeleteAutomationDelete an automation. Deleting a webhook automation also retires its URL.
RunAutomationStart a run now, without waiting for it to finish. Pass exactly one of automationId and automationName; automationName matches an exact name, ignoring case.

CreateAutomation, ListAutomations, ReadAutomation, EditAutomation, and DeleteAutomation require executionLocation: local for automations on this machine, or remote for automations in the cloud. ListAutomationTemplates and RunAutomation do not take it. Webhook, Slack, and chained automations are always remote. A local schedule runs only while the desktop app or a standalone droid daemon is running on this machine; a terminal session alone does not run it. Factory-managed Droid Computers never run local schedules, so create a remote automation there.

Creating an automation needs a name and a prompt, unless a Slack automation (trigger: "slack") uses templateId: "incident-response", which supplies them. That template applies the Incident Response preset: its name and prompt, messageSource: "bots", and sessionPrivacy: "team". Fields you pass override the preset. New automations default to status: "active"; pass status: "paused" to create one paused. A scheduled automation needs a schedule.

model accepts a model ID, a display name, or cheapest, the available built-in model, other than Router, with the lowest credit multiplier. Omit model and reasoningEffort to use the defaults. On EditAutomation, an empty string clears either one, and only a remote automation's reasoningEffort can be changed. A remote automation's description takes up to 1,024 characters, and creating a remote automation also takes up to 16 tags.

On a remote create, privacyLevel is private or organization, and sessionPrivacy is private or team. Unless a service account or the Incident Response preset sets them, both default to private; with privacyLevel: "organization", run sessions default to team.

A remote automation needs exactly one run target: computerName or computerId for a computer, or environmentName or environmentId to start each run on a fresh computer built from a Factory Environment. To deliver runs into an existing session instead, pass deliverToSessionId ("current" for the session you are in) and no run target. Runs then happen wherever that session lives, and the automation cannot start a chain. executionLocation is still required. The session's autonomy, model, and tools stay in effect, so model and reasoningEffort do not apply, and a run can wait for your permission. Slack automations cannot deliver into a session. To deliver into a session on another machine that is not a registered computer, create the automation from that machine.

On EditAutomation, for a remote automation created with session delivery, deliverToSessionId moves its deliveries to another session on the same kind of machine; it cannot turn session delivery off, and computerId is refused. Session delivery cannot be added to an automation created without it. For a remote automation that runs on a computer and does not deliver into a session, computerId moves it to another computer, and a service-account automation must stay on one of that account's computers. An automation that runs on an Environment or on the organization default refuses a computerId edit.

To run a remote automation as a service account, pass runAsServiceAccountName or runAsServiceAccountId with an active account you can select (see List computers and environments), and target one of that account's computers or a Factory Environment. Such an automation defaults to privacyLevel: "organization" and sessionPrivacy: "team".

Creating an active remote scheduled automation also starts its first run right away, unless it delivers into a session, which waits for its next scheduled time. If that run cannot start, the automation stays created and the result says why. Webhook, Slack, and chained automations wait for their first delivery, message, or upstream run.

A chained automation (trigger: "automation") runs when a run of one of the automations in its triggeredByAutomationIds ends, completed or failed. Its sources are up to five scheduled, webhook, or chained cloud automations with the same owner, not Slack or CI automations; loops are rejected, and each source can start at most five automations. A new chain can be at most five automations deep, counting the first. Remote scheduled, webhook, and Slack automations can also take triggeredByAutomationIds, and their own trigger keeps working alongside those sources. On EditAutomation, triggeredByAutomationIds replaces the whole list, and an empty list clears it. passUpstreamContext decides whether the source run's outcome and final message enter the prompt, marked as untrusted. It defaults to true; omit it on EditAutomation to keep the current value.

CreateAutomation returns a webhook automation's receiver URL and its secret. The secret cannot be read back later; the URL can be found again in the web app. EditAutomation with rotateWebhookSecret invalidates the current secret at once and returns the replacement once, with the receiver URL. payloadRegex filters deliveries by their raw body. It takes a JavaScript regular expression, without flags, that RE2 can run, so lookahead, lookbehind, backreferences, and inline modifiers are rejected; on EditAutomation, payloadRegex: "" clears the filter. maxRunsPerHour caps the runs that deliveries start in each clock hour: an integer from 1 to 60, 10 by default.

For a Slack automation, messageSource is anyone (the default), humans, or bots. Omit messageSource on EditAutomation to keep its current value. With keywords, only a message that contains at least one of the phrases starts a run. A message that contains an excludedKeywords phrase, or comes from an excludedAuthors sender, never does, even when it matches keywords. On EditAutomation, addKeywords and removeKeywords, addExcludedKeywords and removeExcludedKeywords, addExcludedAuthors and removeExcludedAuthors, and addSlackChannelPatterns and removeSlackChannelPatterns change one list without replacing the rest of it.

CreateAutomation, EditAutomation, DeleteAutomation, and RunAutomation ask for your approval, subject to your autonomy level; ListAutomationTemplates, ListAutomations, and ReadAutomation do not, and neither does a call that only chooses Slack channels. In droid exec at the default autonomy, Droid can list templates, list automations, and read one. Creating, editing, or running an automation is medium risk. Deleting one, or creating one that runs as a service account, is high risk. In Airgap Mode, the seven automation tools are not available, and /automations is hidden and does not run.

Choose Slack channels

To have you pick a Slack automation's channels, Droid first calls CreateAutomation with only trigger: "slack", executionLocation: "remote", chooseSlackChannels: true, and an optional nameFilter, which matches part of a channel name, ignoring case; it is not a wildcard pattern. That call creates nothing. Called directly in an interactive CLI session that can ask you questions, it opens a channel picker and returns your selection. In the picker, Ctrl+R reloads the channels, and Esc cancels the picker and stops Droid's turn. Called from a Script, or in a session that cannot ask you questions, it returns the channels the Factory Slack app can see, and Droid confirms the set with you. Droid then creates the automation with the chosen channels as slackChannels.

For an existing Slack automation, EditAutomation with chooseSlackChannels: true and no other change edits nothing. Called directly in an interactive CLI session that can ask you questions, it opens the picker with the current channels selected and reports the channels added and removed; from a Script or elsewhere, it lists the channels the Factory Slack app can see, with the current ones marked. After a selection in the picker, the result lists separately the current channels the picker could not offer and treats them as unchanged. A channel can be missing because it is archived, the Factory Slack app is not in it, or it is a private channel you cannot see. Droid then applies the change with addSlackChannels and removeSlackChannels.

Read automation results

The automation tools return their results as text for Droid to read. When ReadAutomation finds the automation, the result ends with its full prompt between <prompt> tags, or says that this machine's daemon cannot supply a local automation's prompt. An automation it cannot find is reported as not found. For a webhook automation, it also reports the payload filter and up to five recent deliveries, newest first, which show why a delivery did not start a run. For a Slack automation, it lists the channels with their IDs, the channel patterns, keywords, and exclusions. For a cloud automation, it names the chained automations this one starts and the automations that trigger it; that list is unavailable for an automation someone else owns. If the delivery or trigger lookup fails, the read still succeeds and the result marks that part unavailable. ReadAutomation cannot read a CI automation.

In ListAutomations and ReadAutomation results, when Droid can read the model catalog, a model that is not in it is marked as falling back to the default; when it cannot read the catalog, no model is marked. A remote custom: model is not checked against this machine's models. delivers:this-session marks an automation that delivers into the current session, and delivers:<sessionId> names another session.

A create or edit can succeed even when reading the automation back fails. If an edit's other changes are saved but rotating the webhook secret fails, the result reports the saved changes and the rotation error. Retry the rotation on its own; until it succeeds, do not rely on either secret.

RunAutomation returns without waiting for the run to finish. If several automations match automationName, the result lists their IDs; call again with automationId. The run gets no input from the call; it sees only its own prompt. A paused automation still runs. If the automation is already running, the call is skipped rather than failed. Droid refuses a CI-triggered automation, which cannot start on demand, and the result says why. A local automation on a machine that is not a registered computer starts only from a session hosted by the daemon that owns it: the desktop app's daemon or a standalone droid daemon. Other sessions get a refusal that says why. A local automation on a registered self-hosted computer can also start from another session, through Droid, when you can use that computer. When this session's daemon hosts the automation, automationId can be its slug or its ID. A self-hosted computer must be online, because Droid cannot wake it to start the run, and a computer whose Droid is too old to start runs on demand is refused with a request to update it. A refusal can also mean that Droid paused the automation because its target cannot run, or that you cannot use the target; the result gives Droid's explanation. When the run ends, the chained automations it starts run as usual.

Renamed automation tools

The automation tools replace the earlier automations_ tools. A Script calls each one by its name:

Previous nameToolScript path
automations_templates_listListAutomationTemplatestools.ListAutomationTemplates
automations_listListAutomationstools.ListAutomations
automations_readReadAutomationtools.ReadAutomation
automations_createCreateAutomationtools.CreateAutomation
automations_editEditAutomationtools.EditAutomation
automations_deleteDeleteAutomationtools.DeleteAutomation
automations_runRunAutomationtools.RunAutomation

droid exec --remove-tools with a previous name fails as an unknown tool identifier. A tool selection that Droid re-resolves during a session skips a previous name, and a saved denial that names one does not deny the tool that replaced it. Update prompts, automation instructions, and tool selectors to the current names.

Autonomy levels

droid exec uses tiered autonomy to control what operations the agent can perform. Only raise access when the environment is safe.

LevelIntended forNotable allowances
(default)Read-only reconnaissanceFile reads, git diffs, environment inspection
--auto lowSafe editsCreate/edit files, run formatters, non-destructive commands
--auto mediumLocal developmentInstall dependencies, build/test, git commits, git push, opening pull requests
--auto highCI/CD & orchestrationGit force push, deploy scripts, long-running operations
--skip-permissions-unsafeIsolated sandboxes onlySkips all permission prompts; command blocks still apply

Examples:

Bash
# Default (read-only)
droid exec "Analyze the auth system and create a plan"
 
# Low autonomy - safe edits
droid exec --auto low "Add JSDoc comments to all functions"
 
# Medium autonomy - development work
droid exec --auto medium "Install deps, run tests, fix issues"
 
# High autonomy - deployment
droid exec --auto high "Run the tests and deploy to staging"
Warning

--skip-permissions-unsafe skips all permission prompts, but command blocks still apply. Use only in isolated, disposable environments such as throwaway containers. See Permission rules.

Model IDs

Use any available model ID with -m, --model or --spec-model. For custom models, see Custom Models (BYOK).

droid exec --model and --spec-model also accept provider tier aliases such as openai-latest-balanced, which follow Factory's recommended model for that provider and tier as new models ship.

Legacy models

When a newer version of a model is available to you, /model lists the older one in a collapsed Legacy Models section. Selecting a legacy model asks you to Switch to latest or Keep using legacy. Keeping it adds the model to legacyModelOverrides in your user settings.json, and Droid stops asking about it.

When Droid starts, it moves saved default models (including spec mode, subagent, mission, and compaction models) from a legacy model to its newer version, unless the model is in legacyModelOverrides. A model passed to droid exec --model runs as named.

Interactive mode features

Keyboard shortcuts

The interactive REPL supports a rich set of keyboard shortcuts for navigation, overlays, and input control:

ShortcutAction
Ctrl+CCancel the current operation / interrupt the agent. Press twice quickly to exit
Ctrl+ZSuspend the process (Unix only). Resume with fg
Ctrl+OToggle the detailed transcript view (full message details)
Ctrl+TToggle the Mission Control overlay (orchestrator sessions only)
Ctrl+NCycle through available models (when typing in chat input)
Ctrl+LCycle through autonomy levels (when typing in chat input)
Ctrl+YToggle the /btw scroll view (side-question history)
Ctrl+JToggle the changelog display (dismiss / restore)
Alt+EToggle the approval details view (Option+E on macOS)
Ctrl+VPaste an image from the clipboard as an attachment
TabCycle through the model's available reasoning-effort levels
Shift+TabToggle Normal Mode and Spec Mode
@File path autocomplete: typing @ triggers fuzzy file search
Up / DownNavigate input history (cycle through previously submitted messages)
Double EscapeSecond press clears the input draft; a third Escape opens the rewind menu
?Open the scrollable keyboard shortcuts pane (when the input is empty); close it with Esc
Ctrl+/Open the keyboard shortcuts pane (works even when the input has content)
Ctrl+AMove the cursor to the start of the line
Ctrl+WDelete the word before the cursor
Ctrl+KDelete from the cursor to the end of the line
Ctrl+UDelete from the cursor to the start of the line
Ctrl+DClear all attached images, or forward-delete the next character if none attached
Ctrl+FOpen the fork tree for the highlighted session (in the /sessions list view)
Ctrl+RRename the highlighted session (in the /sessions list view)
Ctrl+XArchive the highlighted session (in the /sessions list view); restores it on the Archived tab
Alt+UpScroll the transcript up (navigate any turn)
Alt+DownScroll the transcript down (navigate any turn)
Alt+PageUpScroll the transcript up to the previous user turn
Alt+PageDownScroll the transcript down to the next user turn
EscapeClose the active pane, overlay, or menu
Shift+EnterInsert a newline in the chat input (multiline editing)
!Toggle bash mode (when the input is empty)
Tip

Run /terminal-setup once to configure your terminal so Shift+Enter reliably produces a newline in the chat input.

Bash mode

Press ! when the input is empty to toggle bash mode. In bash mode, commands execute directly in your shell without AI interpretation, useful for quick operations like checking git status or running npm test.

  • Toggle on: Press ! (when input is empty)
  • Execute commands: Type any shell command and press Enter
  • Toggle off: Press Esc to return to normal AI chat mode

The prompt changes from > to $ when bash mode is active.

Mermaid diagram rendering

Droid automatically renders Mermaid diagram code blocks as ASCII art directly in the terminal, with no external viewer or browser required. When a response contains a fenced ```mermaid block of a supported diagram type, the diagram is drawn inline in the transcript.

Supported diagram types:

  • flowchart (and graph)
  • sequenceDiagram
  • stateDiagram
  • classDiagram
  • erDiagram

Unsupported diagram types (for example gantt, pie, mindmap, timeline, journey, gitGraph) fall back to displaying the raw Mermaid source and a link to view the diagram externally.

Markdown and math rendering

Droid renders supported inline Markdown styles in responses, including formatting inside table cells. It also converts inline and display TeX into Unicode math for terminal output.

Use \(...\) or $...$ for inline math. Use \[...\] or $$...$$ for display math. A completed code fence labeled latex, math, or tex also renders as display math:

```latex
\frac{a}{b}
```

Slash commands

Available when running droid in interactive mode. Type the command at the prompt:

CommandDescription
/accountOpen Factory account settings in browser
/agent-effectiveness-report [timeframe]Build an organization-level Agent Effectiveness report from Factory usage, pull requests, and work items; listed for Owners and Managers of organizations where it is enabled (details)
/archiveArchive the current session (restore it from the /sessions Archived tab)
/automationsOpen this machine's scheduled automations (details)
/billingView and manage billing settings
/btw <question>Ask a side question without polluting the main transcript
/bug [title]Create a bug report with session data and logs
/clearClear conversation context, keep current model & autonomy
/commandsManage custom slash commands
/compress [prompt]Compress session and move to new one with summary
/contextShow context window usage breakdown with progress bar
/copyCopy prompts, responses, turn ranges, or session ID
/costShow usage statistics
/create-skillCreate a reusable skill from current session
/cd <path>Change session working directory (alias for /cwd)
/cwd <path>Change session working directory
/diagnosticsShow settings configuration errors
/droidsManage custom droids
/missionsEnter Mission Mode
/fastEnable fast mode for current model (/fast off to disable)
/favoriteMark current session as a favorite
/forkCopy current session into a new session; you stay in the original and get a droid --resume <id> command for the fork
/helpShow available slash commands
/hooksManage lifecycle hooks
/ideConfigure IDE integrations
/install-code-reviewSet up automated code review
/install-slack-appInstall/connect Slack integration
/language <locale>Switch TUI display language
/limitsManage token usage limits and overage preferences
/link-work <url>Link this session to a Linear issue; /link-work shows the link and /link-work clear removes it. Listed where work item linking is enabled (details)
/loginSign in to Factory
/logoutSign out of Factory
/loop <interval> <prompt>Repeat a prompt on an interval from 1 minute to 24 hours; /loop status lists loops and /loop stop <id> stops one (details)
/mcpManage Model Context Protocol servers
/modelSwitch AI model mid-session
/newStart a fresh session, reset model & autonomy to defaults
/pluginsManage plugins and marketplaces
/quitExit droid (alias: exit, or press Ctrl+C)
/readiness-fixFix failing agent readiness signals from latest report
/readiness-reportGenerate readiness report
/renameRename current session
/reviewStart AI-powered code review workflow
/rewind-conversationUndo recent changes in the session
/sessionsList and resume previous sessions, with forks grouped under their parent (details)
/settingsConfigure application settings
/setup-incident-responseSet up Slack auto-run for incident-response channel
/shareShare session with organization
/skillsManage and invoke skills
/stats [period]Show usage statistics (supports relative periods, date ranges)
/statusShow current droid status and configuration
/statuslineConfigure custom status line
/terminal-setupConfigure terminal keybindings for Shift+Enter
/themesChoose a color theme
/treeBrowse, label, and filter the current session's fork tree, and resume or fork from any entry (details)
/vim [on|off]Toggle vim-style modal editing (INSERT/NORMAL) in the chat input

Slash commands stay usable while the agent is running: read-only and settings commands open right away over the live stream, commands that modify the conversation or session (such as /new, /clear, /compress) ask for confirmation before stopping the current run, and /model, /fast, and /archive apply only between turns. /fork also runs immediately: it copies the session in the background and keeps you in the original session, so there is nothing to interrupt.

Archiving hides a session from your session lists without deleting any data. Restore an archived session anytime from the Archived tab in /sessions (where Ctrl+X restores instead of archiving), or send a new message in the archived session to restore it automatically.

For detailed information on slash commands, see the interactive mode documentation.

Session list

/sessions lists your previous sessions and opens with the newest one selected. Press Enter to resume the selected session, or use the /sessions shortcuts to rename it, archive it, or open its fork tree.

Forks appear directly under the session they came from, marked with ↳, so a session and its forks stay together. Each fork family takes its place in the list from its most recently active member. Search keeps the grouping: when a search hides a fork's parent, the fork stays under its nearest ancestor that still matches.

A chain of sessions that each continue the last, such as the new session /compress starts, stays in one column. The indent grows only below a session that has more than one fork.

Session tree

/tree shows the current session's fork family as one tree: the messages of the original session and every fork, joined at the points where the forks branched off. ← current marks where you are, and ● <title> marks the latest entry of each session in the family.

A conversation with no forks renders flat. Rows indent only where the conversation branches: ├─ and └─ connect each branch to the row it branched from, and │ carries a branch past the rows of its siblings.

Select a row and press Enter to act on it:

  • On another session's latest entry, resume that session.
  • On a user message, fork just before it and prefill the message so you can edit and resend it.
  • On an assistant message, fork just after it and continue with an empty prompt.
KeyAction
Up / DownMove the selection
LeftCollapse the selected branch, or jump to the row it branched from
RightExpand a collapsed branch
EnterResume, edit and resend, or continue from the selected row
Shift+LAdd, edit, or clear the selected row's label
fCycle the filter: no tools, user only, all
tShow user messages, assistant replies, and compaction summaries (the default "no tools" filter)
uShow user messages only
aShow every entry, including tool calls and results
lShow only labeled rows; press again to return to "no tools"
EscapeClose the tree

The footer names the active filter. The filter keys work even when the current filter shows no rows.

Shift+L opens a one-line editor below the tree, prefilled with the row's label. Press Enter to save it as a [label] badge on the row, or Escape to cancel. Saving an empty label removes it. Letters you type in the editor never trigger tree shortcuts. A label holds one line of up to 32 characters; longer text ends in an ellipsis.

Labels last until you exit Droid. They survive closing /tree and switching or forking from it, and because forks share their history, one label marks the same entry in every session of the fork family. Labels are not saved to disk.

Git worktrees

Use -w, --worktree [name] to run a session inside a native git worktree so you can work on multiple branches of the same repository in parallel without file conflicts. This flag is available on both droid (interactive) and droid exec.

By default, Droid creates worktrees under the worktreeDirectory setting, which defaults to ~/.factory/worktrees. Each worktree uses the path <root>/<8-character group>/<repository name>/ and has its own checkout and dedicated branch.

Branch naming:

  • --worktree (no value): Creates/reuses a worktree on a branch named <current-branch>-wt.
  • --worktree <name>: Uses <name> as the branch. If the branch already exists, it is checked out in the worktree; otherwise it is created from HEAD.
  • If the target branch is already checked out in another worktree, the command fails with a clear error.

Examples:

Bash
# Interactive: derive branch from current branch (creates <current>-wt)
droid --worktree
 
# Interactive: explicit branch name
droid -w fix-auth-bug "start debugging the login flow"
 
# Headless: isolate an automated task on its own branch
droid exec --worktree refactor-tests --auto medium "migrate jest suites to vitest"
 
# Run two parallel sessions on the same repo, each on its own branch
droid --worktree feature-a &
droid --worktree feature-b &

Session lifecycle:

  • Interactive mode: The worktree persists after the session ends so you can resume work, inspect changes, or push the branch.
  • droid exec mode: On exit, a clean worktree (no uncommitted changes) is removed automatically; a dirty worktree is preserved and its path is printed so you can review the work.
  • The underlying git branch is never deleted by Droid; only the worktree directory is removed during cleanup.
Note

When --worktree is active, Droid operates entirely inside the worktree directory. Run follow-up commands (tests, builds, installs) from that directory rather than the original repo root. Fresh worktrees may not have dependencies installed yet (for example node_modules); set them up if builds or tests fail with missing-module errors.

Subcommand flags

In addition to the global flags above, several droid subcommands accept their own flags.

droid update flags

FlagDescriptionExample
-c, --checkCheck for updates without installingdroid update --check
-v, --version <version>Update to or roll back to a specific versiondroid update -v 0.174.0

droid search flags

FlagDescriptionExample
--kind <kind>Filter by entry kind: message_text, document, tool_use, tool_result, or alldroid search "auth" --kind document
--limit-sessions <n>Maximum number of sessions to returndroid search "auth" --limit-sessions 5
--limit-hits <n>Maximum number of matches per kind per sessiondroid search "auth" --limit-hits 3
--context-chars <n>Number of characters of context shown around each matchdroid search "auth" --context-chars 200
--jsonEmit results as JSONdroid search "auth" --json
--reindexDrop the search cache and rebuild the local indexdroid search "auth" --reindex

droid mcp add flags

FlagDescriptionExample
--type <type>Server transport: http (streamable HTTP), sse (legacy HTTP+SSE), or stdio (local)droid mcp add api https://api.example.com/mcp --type http
--env <KEY=VALUE>Set an environment variable for a stdio server (repeatable)droid mcp add gh "gh-mcp" --type stdio --env GH_TOKEN=$GH_TOKEN
--header <KEY: VALUE>Add an HTTP header for a remote server (repeatable)droid mcp add api https://api.example.com/mcp --type http --header "Authorization: Bearer $TOKEN"

droid plugin flags

FlagDescriptionExample
-s, --scope <scope>Installation scope: user (default) or projectdroid plugin install droid-control@factory-plugins --scope project

droid computer register flags

FlagDescriptionExample
-y, --yesSkip interactive prompts and accept registration defaultsdroid computer register laptop -y

MCP command reference

The /mcp slash command opens an interactive manager UI for browsing and managing MCP servers.

Quick start: Type /mcp and select "Add from Registry" to browse 40+ pre-configured servers (Linear, Sentry, Notion, Stripe, Vercel, and more). Select a server, authenticate if required, and you're ready to go.

CLI commands for scripting and automation:

Bash
droid mcp add <name> <url> --type http    # Add HTTP (streamable) server
droid mcp add <name> <url> --type sse     # Add legacy HTTP+SSE server
droid mcp add <name> "<command>"          # Add stdio server
droid mcp remove <name>                   # Remove a server
droid mcp auth                            # Sign in to every server that needs it

See MCP Configuration for the full registry list, CLI options (--env, --header), configuration files, and how user vs project config layering works.

Authentication

  1. 1
    Generate an API key in the Factory API keys settings
  2. 2
    Set the environment variable:
export FACTORY_API_KEY=fk-...

Persist the variable in your shell profile (~/.bashrc, ~/.zshrc, or PowerShell $PROFILE) for long-term use.

Warning

Never commit API keys to source control. Use environment variables or secure secret management.

Auto-updates

Standalone Droid installations check for and install CLI updates automatically. Run droid update to trigger an update on demand.

To keep a standalone installation pinned, disable its in-process updater:

Bash
export FACTORY_DROID_AUTO_UPDATE_ENABLED=false

With this variable set, automatic updates are disabled and droid update does not install another version. Set it in the environment that launches every Droid process, including droid daemon.

The npm distribution has auto-updates disabled at build time and does not require this variable. Running droid update from an npm installation reports that auto-update is unavailable. Setting FACTORY_DROID_AUTO_UPDATE_ENABLED=true explicitly overrides the npm build default.

Enterprise administrators can disable CLI auto-updates for all organization members with the disableAutoUpdate organization setting. See the release notes and organization controls.

Tip

Pin the CLI and disable auto-updates in reproducible environments. For local developer installations, leave auto-updates enabled to receive fixes and security updates.

Exit codes

CodeMeaning
0Success
1General runtime error
2Invalid CLI arguments/options

Common workflows

Code review

Interactive review inside a Droid session:

> /review

Non-interactive review through droid exec:

Bash
# Analysis only
droid exec "Review this PR for security issues"
 
# With modifications
droid exec --auto low "Review code and add missing type hints"

See the Local Code Review documentation for detailed guidance on review types, workflows, and best practices.

Testing and debugging

Bash
# Investigation
droid exec "Analyze failing tests and explain root cause"
 
# Fix and verify
droid exec --auto medium "Fix failing tests and run test suite"

Refactoring

Bash
# Planning
droid exec "Create refactoring plan for auth module"
 
# Execution
droid exec --auto low --use-spec "Refactor auth module"

Parallel sessions on one repo

Bash
# Work on two branches of the same repo at the same time, each in its own worktree
droid --worktree feature-a &
droid --worktree feature-b &
 
# Fan out headless tasks across branches without clobbering each other's files
droid exec -w migration-step-1 --auto medium "apply codemod A" &
droid exec -w migration-step-2 --auto medium "apply codemod B" &
wait

See Git worktrees for details.

CI/CD integration

YAML
# GitHub Actions example
- name: Run Droid Analysis
  env:
    FACTORY_API_KEY: ${{ secrets.FACTORY_API_KEY }}
  run: |
    droid exec --auto medium -f .github/prompts/deploy.md