Installation
- Interactive (
droid) - Chat-first REPL with slash commands - Non-interactive (
droid exec) - Single-shot execution for automation and scripting
Droid CLI commands
Droid CLI flags
Customize droid’s behavior with command-line flags:Autonomy levels
droid exec uses tiered autonomy to control what operations the agent can perform. Only raise access when the environment is safe.
Examples:
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: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
Escto return to normal AI chat mode
> 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(andgraph)sequenceDiagramstateDiagramclassDiagramerDiagram
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 runningdroid in interactive mode. Type the command at the prompt:
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 fromHEAD.- If the target branch is already checked out in another worktree, the command fails with a clear error.
- Interactive mode — The worktree persists after the session ends so you can resume work, inspect changes, or push the branch.
droid execmode — 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, severaldroid subcommands accept their own flags.
droid search flags
droid mcp add flags
droid plugin flags
droid computer register flags
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:
--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:
~/.bashrc, ~/.zshrc, or PowerShell $PROFILE) for long-term use.
Exit codes
Common workflows
Code review
Testing and debugging
Refactoring
Parallel sessions on one repo
CI/CD integration
See also
- Quickstart guide - Getting started with the Droid CLI
- Interactive mode - Shortcuts, input modes, and features
- Choosing your model - Model selection guidance
- Settings - Configuration options
- Custom commands - Create your own shortcuts
- Custom droids - Build specialized agents
- Droid Exec overview - Detailed automation guide
- MCP configuration - External tool integration
