Skip to main content

Documentation Index

Fetch the complete documentation index at: https://factory-changelog-may20.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Installation

curl -fsSL https://app.factory.ai/cli | sh
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

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 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 plugin install <plugin>Install a plugin. Alias: droid plugin idroid plugin install factory/code-review
droid plugin uninstall <plugin>Uninstall a plugin. Alias: droid plugin removedroid plugin uninstall factory/code-review
droid plugin update <plugin>Update a plugin to the latest versiondroid plugin update factory/code-review
droid plugin listList installed pluginsdroid plugin list
droid plugin marketplaceManage plugin marketplacesdroid plugin marketplace
droid computer register [name]Register this machine as a Bring-Your-Own-Machine (BYOM) computerdroid computer register laptop
droid computer removeRemove this machine’s BYOM registrationdroid computer remove
droid computer listList registered BYOM computersdroid computer list
droid computer ssh <name>SSH into a registered BYOM computerdroid computer ssh laptop
droid daemonRun the Factory daemon serverdroid daemon
droid updateManually update the CLI to latest versiondroid update

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-4-7
-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"
--enabled-tools <ids>Force-enable specific tools (comma or space separated)droid exec --enabled-tools ApplyPatch,Bash
--disabled-tools <ids>Disable specific tools for this rundroid exec --disabled-tools execute-cli
--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 (stream-jsonrpc for multi-turn)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 (off, none, low, medium, high). 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-sonnet-4-6
--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 (⚠️ use with extreme caution)droid exec --skip-permissions-unsafe
--cwd <path>Execute from a specific working directorydroid exec --cwd ../service "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)droid exec --mission -f mission.md
--worker-model <id>Model used for mission worker agentsdroid exec --mission --worker-model claude-sonnet-4-6
--worker-reasoning-effort <level>Reasoning effort for mission worker agents (off, none, low, medium, high)droid exec --mission --worker-reasoning-effort medium
--validator-model <id>Model used for mission validator agentsdroid exec --mission --validator-model claude-opus-4-7
--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
-v, --versionDisplay CLI versiondroid -v
-h, --helpShow help informationdroid --help
Use --output-format json for scripting and automation, allowing you to parse droid’s responses programmatically.

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, local git commits
--auto highCI/CD & orchestrationGit push, deploy scripts, long-running operations
--skip-permissions-unsafeIsolated sandboxes onlyRemoves all guardrails (⚠️ use only in disposable containers)
Examples:
# 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 tests, commit, and push changes"
--skip-permissions-unsafe removes all safety checks. Use only in isolated environments like Docker containers.

Model IDs

Use any available model ID with -m, --model or --spec-model. For custom models, see Bring Your Own Key (BYOK). See Choosing Your Model for detailed guidance on which model to use for different tasks.

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+PToggle the blog post viewer
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)
Ctrl+EToggle the approval details view
Ctrl+VPaste an image from the clipboard as an attachment
TabCycle reasoning effort (lowmediumhighoff)
Shift+TabCycle interaction modes (Auto → Spec → Mission)
@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
?Toggle the help popup (when the input is empty)
Ctrl+/Toggle the help popup (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+RRename the highlighted session (in the /sessions list view)
Ctrl+XArchive the highlighted session (in the /sessions list view)
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 overlay or menu
Shift+EnterInsert a newline in the chat input (multiline editing)
!Toggle bash mode (when the input is empty)
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 — 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.

Slash commands

Available when running droid in interactive mode. Type the command at the prompt:
CommandDescription
/accountOpen Factory account settings in browser
/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
/clearStart a new session (alias for /new)
/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
/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
/forkDuplicate current session with all messages into a new session
/generate_blogGenerate semantic diff blog post
/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
/loginSign in to Factory
/logoutSign out of Factory
/mcpManage Model Context Protocol servers
/modelSwitch AI model mid-session
/newStart a new session
/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 select previous sessions
/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
For detailed information on slash commands, see the interactive mode documentation.

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. Each worktree is created as a sibling directory next to your repo (../<repo>-wt-<branch>/) with 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:
# 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.
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 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) 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 factory/code-review --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:
droid mcp add <name> <url> --type http    # Add HTTP server
droid mcp add <name> "<command>"          # Add stdio server
droid mcp remove <name>                   # Remove a server
See MCP Configuration for the full registry list, CLI options (--env, --header), configuration files, and how user vs project config layering works.

Authentication

  1. Generate an API key at app.factory.ai/settings/api-keys
  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.
Never commit API keys to source control. Use environment variables or secure secret management.

Exit codes

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

Common workflows

Code review

# Local review workflow
> /review

# Analysis via exec (non-interactive)
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

# 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

# Planning
droid exec "Create refactoring plan for auth module"

# Execution
droid exec --auto low --use-spec "Refactor auth module"

Parallel sessions on one repo

# 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

# 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

See also