Documentation Index Fetch the complete documentation index at: https://docs.factory.ai/llms.txt
Use this file to discover all available pages before exploring further.
Installation
curl -fsSL https://app.factory.ai/cli | sh
The CLI operates in two modes:
Interactive (droid) - Chat-first REPL with slash commands
Non-interactive (droid exec) - Single-shot execution for automation and scripting
CLI commands
Command Description Example droidStart interactive REPL droiddroid "query"Start REPL with initial prompt droid "explain this project"droid exec "query"Execute task without interactive mode droid exec "summarize src/auth"droid exec -f prompt.mdLoad prompt from file droid exec -f .factory/prompts/review.mdcat file | droid execProcess piped content git diff | droid exec "draft release notes"droid exec -s <id> "query"Resume existing session in exec mode droid exec -s session-123 "continue"droid exec --list-toolsList available tools, then exit droid exec --list-toolsdroid updateManually update the CLI to latest version droid update
CLI flags
Customize droid’s behavior with command-line flags:
Flag Description Example -f, --file <path>Read prompt from a file droid exec -f plan.md-m, --model <id>Select a specific model (see model IDs ) droid exec -m claude-opus-4-6-s, --session-id <id>Continue an existing session droid 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 run droid exec --disabled-tools execute-cli--list-toolsPrint available tools and exit droid 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-json, stream-jsonrpc for multi-turn) droid exec --input-format stream-jsonrpc -o stream-jsonrpc-r, --reasoning-effort <level>Override reasoning effort (off, none, low, medium, high) droid exec -r high "debug flaky test"--spec-model <id>Use a different model for specification planning droid exec --spec-model claude-sonnet-4-5-20250929--spec-reasoning-effort <level>Override reasoning effort for spec mode droid 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 directory droid exec --cwd ../service "run tests"--tag <spec>Session tag (name or JSON, repeatable) droid exec --tag code-review--log-group-id <id>Log group ID for filtering logs droid exec --log-group-id grp-123-v, --versionDisplay CLI version droid -v-h, --helpShow help information droid --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.
Level Intended for Notable allowances (default) Read-only reconnaissance File reads, git diffs, environment inspection --auto lowSafe edits Create/edit files, run formatters, non-destructive commands --auto mediumLocal development Install dependencies, build/test, local git commits --auto highCI/CD & orchestration Git push, deploy scripts, long-running operations --skip-permissions-unsafeIsolated sandboxes only Removes 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.
Available models
Model ID Name Reasoning support Default reasoning claude-opus-4-7Claude Opus 4.7 Yes (Off/Low/Medium/High/Max) high claude-opus-4-6Claude Opus 4.6 Yes (Off/Low/Medium/High/Max) high claude-opus-4-6-fastClaude Opus 4.6 Fast Yes (Off/Low/Medium/High/Max) high claude-opus-4-5-20251101Claude Opus 4.5 Yes (Off/Low/Medium/High) off claude-sonnet-4-6Claude Sonnet 4.6 Yes (Off/Low/Medium/High/Max) high claude-sonnet-4-5-20250929Claude Sonnet 4.5 Yes (Off/Low/Medium/High) off claude-haiku-4-5-20251001Claude Haiku 4.5 Yes (Off/Low/Medium/High) off gpt-5.5GPT-5.5 Yes (None/Low/Medium/High/Extra High) medium gpt-5.5-fastGPT-5.5 Fast Yes (None/Low/Medium/High/Extra High) medium gpt-5.5-proGPT-5.5 Pro Yes (None/Low/Medium/High/Extra High) medium gpt-5.4GPT-5.4 Yes (None/Low/Medium/High/Extra High) medium gpt-5.3-codexGPT-5.3-Codex Yes (None/Low/Medium/High/Extra High) medium gpt-5.2-codexGPT-5.2-Codex Yes (None/Low/Medium/High/Extra High) medium gpt-5.2GPT-5.2 Yes (Off/Low/Medium/High/Extra High) low gemini-3.1-pro-previewGemini 3.1 Pro Yes (Low/Medium/High) high gemini-3-flash-previewGemini 3 Flash Yes (Minimal/Low/Medium/High) high glm-5.1Droid Core (GLM-5.1) None only none kimi-k2.5Droid Core (Kimi K2.5) None only none kimi-k2.6Droid Core (Kimi K2.6) Yes (Off/High) high minimax-m2.7Droid Core (MiniMax M2.7) Yes (Low/Medium/High) high
Custom models configured via BYOK use the format: custom:<alias>
See Choosing Your Model for detailed guidance on which model to use for different tasks.
Interactive mode features
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.
Slash commands
Available when running droid in interactive mode. Type the command at the prompt:
Command Description /accountOpen Factory account settings in browser /billingView and manage billing settings /bg-processManage background processes /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 /costShow token usage statistics /create-skillCreate a reusable skill from current session /droidsManage custom droids /missionsEnter Mission mode /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 /loginSign in to Factory /logoutSign out of Factory /mcpManage Model Context Protocol servers /missionOpen Mission Control /missionsList and select missions to resume /modelSwitch AI model mid-session /newStart a new session /pluginsManage plugins and marketplaces /quitExit droid (alias: exit, or press Ctrl+C) /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 /shareShare session with organization /skillsManage and invoke skills /statusShow current droid status and configuration /statuslineConfigure custom status line /terminal-setupConfigure terminal keybindings for Shift+Enter /wrappedShow Droid usage statistics
For detailed information on slash commands, see the interactive mode documentation .
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 < nam e > < ur l > --type http # Add HTTP server
droid mcp add < nam e > "<command>" # Add stdio server
droid mcp remove < nam e > # 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
Generate an API key at app.factory.ai/settings/api-keys
Set the environment variable:
macOS/Linux
Windows (PowerShell)
Windows (CMD)
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
Code Meaning 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"
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