The first unofficial CLI for the world's first AI Software Engineer. Supports both the modern v3 API and the legacy v1 API with full multi-profile management.
Devin CLI is designed for high-velocity engineering teams. It strips away the friction of the web UI, allowing you to orchestrate autonomous agents, manage complex contexts, and automate multi-step development workflows through a robust, terminal-first interface.
Recommended: Via Homebrew (macOS)
brew tap revanthpobala/tap
brew install devin-cliVia pipx (Isolated environment)
pipx install devin-cliVia pip
pip install devin-clidevin configure
# Paste your API token (apk_... or cog_...) from https://preview.devin.ai/settings
# Select API version: v3 (default) or v1 (legacy)devin create-session "Identify and fix the race condition in our Redis cache layer"
devin watchFor external automation and AI agent architectures relying on the CLI, devin-cli supports a global --json flag. This will suppress all visual output/terminal colors and instead uniformly return raw JSON objects for stdout and API errors, making the CLI completely deterministic to parse.
devin --json sessions create "My prompt"
# { "session_id": "...", "status": "running" }devin configure --profile personal
devin configure --profile service
devin --profile service sessions list
devin --profile personal sessions create "Fix the failing tests"Profiles are stored in ~/.config/devin/config.json β fully isolated including session caches and active session IDs.
| Command | Description |
|---|---|
devin create-session "<prompt>" |
Create a new session |
devin watch |
Live-watch the active session |
devin status |
One-liner status of active session |
devin open |
Open active session URL in browser |
devin message "<text>" |
Send a message to active session |
devin message --file prompt.txt |
Send a message from file |
devin terminate |
Terminate active session |
devin list-sessions |
List recent sessions |
devin upload <file> |
Upload a file to Devin |
devin attach <file> "<prompt>" |
Upload file + start session with it |
devin list-knowledge |
List knowledge notes |
devin update-knowledge <id> |
Update a knowledge entry |
devin update-tags |
Update tags on a session |
devin history |
Show locally cached session ID |
devin messages |
Show conversation history |
devin get-session |
Show session details + structured output |
devin update-playbook <id> |
Update a playbook |
devin delete-playbook <id> |
Delete a playbook |
devin list-secrets |
List organization secrets |
devin delete-secret <id> |
Delete a secret |
devin chain |
Sequential playbook orchestration |
devin use <session_id> |
Switch active session |
devin configure |
Configure API token and profile |
| Command | Key Flags | Description |
|---|---|---|
create |
see below | Create a session |
list |
--limit, --json |
List sessions |
get |
[session_id] |
Get session details |
watch |
--interval |
Live-watch with exponential backoff |
message |
[text], --file |
Send message or file to session |
messages |
[session_id] |
Full conversation history |
terminate |
[session_id] |
Terminate a session |
insights |
[session_id] |
ACU / performance insights (v3) |
cost |
[session_id] |
ACU consumption |
| Flag | Type | Description |
|---|---|---|
[prompt] |
arg | Task prompt |
--file, -f |
path | Read prompt from file |
--title, -t |
str | Session title |
--wait, -w |
flag | Block until session finishes |
--interval |
int | Polling interval for --wait (default: 5s) |
--max-acu |
int | ACU spend cap |
--force |
flag | Skip duplicate detection |
--advanced-mode |
str | analyze | create_playbook | improve_playbook | batch | manage_knowledge |
--playbook-id |
str | Playbook to apply (v3) |
--child-playbook-id |
str | Playbook for each sub-session in batch mode (v3) |
--bypass-approval |
flag | Skip UI approval β child sessions start immediately (v3) |
--tag |
str (repeatable) | Session tags |
--repo |
str (repeatable) | Repo URLs to attach (v3) |
--knowledge-id |
str (repeatable) | Knowledge IDs to inject |
--secret-id |
str (repeatable) | Secret IDs to inject (v3) |
--session-link |
str (repeatable) | Session URLs as context (v3) |
--attachment-url |
str (repeatable) | Attachment URLs (v3) |
--structured-output-schema |
str | JSON schema for structured response (v3) |
--create-as-user-id |
str | Enterprise: impersonate a user (v3) |
--org |
str | Override org ID |
# No browser interaction required
devin sessions create \
--advanced-mode batch \
--playbook-id <orchestrator-id> \
--child-playbook-id <worker-id> \
--bypass-approval \
"Process each file in the attached CSV"| Command | Description |
|---|---|
list |
List all knowledge notes |
create |
Create a knowledge note |
delete <id> |
Delete a knowledge note |
| Command | Description |
|---|---|
list |
List all playbooks |
create |
Create a playbook |
update <id> |
Update a playbook |
delete <id> |
Delete a playbook |
| Command | Description |
|---|---|
list |
List organization secrets |
create |
Create a secret |
delete <id> |
Delete a secret |
| Command | Description |
|---|---|
list |
List schedules |
create |
Create a CRON schedule |
| Command | Description |
|---|---|
list |
List indexed repositories |
index |
Force-index a repository |
| Command | Description |
|---|---|
upload <file> |
Upload a file |
download <id> |
Download an attachment |
| Command | Description |
|---|---|
whoami |
Show current identity |
list-orgs |
List accessible organizations |
Orchestrate a sequential pipeline of playbooks:
# Inline
devin chain "Refactor utils.py" --playbooks "lint_check,unit_tests"
# YAML workflow file
devin chain --file workflow.ymlThe CLI caches a SHA-256 hash of your last 50 prompts per profile. Duplicate prompts are caught before wasting ACUs:
Duplicate Detected: You recently created a session with this exact prompt.
Existing Session ID: abc123...
Are you sure you want to create a duplicate session? [y/N]
Use --force to bypass.
env:
DEVIN_API_TOKEN: ${{ secrets.DEVIN_API_TOKEN }}
DEVIN_ORG_ID: ${{ secrets.DEVIN_ORG_ID }}
run: |
devin create-session "Review PR #${{ github.event.pull_request.number }}" --waitEnvironment variables:
| Variable | Description |
|---|---|
DEVIN_API_TOKEN |
API token (overrides config) |
DEVIN_ORG_ID |
Organization ID |
DEVIN_BASE_URL |
Override base URL |
DEVIN_API_VERSION |
Set v1 or v3 without configuring |
| Feature | v1 | v3 |
|---|---|---|
| Sessions (create, list, get, terminate) | β | β |
| Knowledge (create, update, delete) | β | β |
| Playbooks (create, update, delete) | β | β |
| Secrets (list, create, delete) | β | β |
| Attachments (upload, download) | β | β |
Advanced Mode (--advanced-mode) |
β | |
Batch sessions (--bypass-approval) |
β | |
| Session Insights | β | β |
| Schedules | β | β |
| Repositories | β | β |
| Enterprise endpoints | β | β |
v3-only flags are accepted but ignored on v1 profiles β the CLI prints a clear warning listing exactly which flags were dropped.
- Architecture: Full v3 API support (
v3beta1+enterprise) + v1 legacy proxy - Config:
~/.config/devin/config.json - Platform: Linux, macOS, WSL2
- Python: 3.9+
pip install -e ".[dev]"
PYTHONPATH=src python3 -m pytestMIT. Devin CLI is an unofficial community project and is not affiliated with Cognition AI.
