How to Use Droid CLI to Automate Coding Tasks in 2026
Droid is a command-line coding agent from Factory AI that reads your repo, edits files, and runs commands from a single terminal chat. You install it with one npm command, point it at a model, and describe the task in plain English. A first working edit usually takes under 10 minutes.
What is Droid CLI?
Droid is an agentic developer tool that lives in your shell rather than an IDE. It scans the current directory, builds a plan, then writes code and executes shell commands with your approval. Factory ships it as a Node package, so Node 18 or newer is required. Unlike a chat window, Droid keeps the working tree in context, which is why it handles multi-file refactors without you pasting file contents.
How do you install Droid?
Run one command:
npm install -g @factory-ai/droid- Then start it inside a project:
cd my-app && droid
On first launch it asks for credentials. You can sign in with a Factory account or supply your own API key for Anthropic, OpenAI, or a local endpoint. The config lands in ~/.factory/config.json, so switching models later is a two-line edit rather than a reinstall.
How do you run your first task?
Open a repo you know well, then type a request that names the file and the outcome. For example: “Add input validation to the signup handler in api/auth.js and return 400 on a missing email.” Droid proposes a diff before touching disk. Press y to apply, n to reject, or type a correction to revise the plan.
Three habits make it reliable:
- Start on a clean git branch. Droid edits real files, and
git diffis your undo button. - Ask for one change at a time. Bundled requests produce bigger diffs and more review work.
- Let it run tests. Say “run the test suite and fix failures” and it will loop until the suite passes or it gets stuck.
Is Droid free?
The Droid CLI itself is free to install. You pay for the model behind it. A mid-sized refactor typically burns 20k-60k tokens, which on Claude Sonnet pricing lands around $0.10-$0.40 per task. If you already have an API key, there is no separate subscription. Teams that want centralized billing and shared context can use Factory’s paid plan, but solo developers can run it indefinitely on their own keys.
Droid vs other terminal agents
Droid competes with opencode and IDE-based tools like Cline. Droid leans toward autonomous multi-step work, while opencode stays lighter and more scriptable. If you mostly want inline autocomplete, neither beats an IDE plugin. Droid is best for people who already live in tmux and want an agent they can pipe into scripts.
Common pitfalls
Two things trip up new users. First, Droid can overwrite a file if you approve a diff without reading it, so glance at the hunk headers. Second, long tasks drift: if the agent starts editing unrelated files, stop it and restate the goal with a narrower scope.
Quick Summary
- Droid is Factory AI’s terminal coding agent, installed via
npm install -g @factory-ai/droid. - It needs Node 18+, edits files directly, and asks for approval before each change.
- The CLI is free; you pay only for model tokens, roughly $0.10-$0.40 per task.
- Works best on a clean git branch with one request at a time.
- Good fit for terminal-first developers; overkill if you just want autocomplete.
Last updated September 2026.
