Skip to content

revanthpobala/devin-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

48 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Devin CLI Logo

Devin CLI (Unofficial) β€” The Professional Terminal Interface for Devin AI

PyPI version Homebrew Tap Build Status

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.


⚑ Quick Start

1. Installation

Recommended: Via Homebrew (macOS)

brew tap revanthpobala/tap
brew install devin-cli

Via pipx (Isolated environment)

pipx install devin-cli

Via pip

pip install devin-cli

2. Configuration

devin configure
# Paste your API token (apk_... or cog_...) from https://preview.devin.ai/settings
# Select API version: v3 (default) or v1 (legacy)

3. Your First Session

devin create-session "Identify and fix the race condition in our Redis cache layer"
devin watch

Authentication & Usage

AI Agent Integration (JSON Output)

For 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" }

Multi-Profile Support

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.


πŸ€– All Commands

Flat Commands (0.1.x style β€” quick access)

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

Sessions (devin sessions <cmd>)

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

sessions create / create-session β€” Full Flag Reference

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

Full Batch Automation Example

# 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"

Knowledge (devin knowledge <cmd>)

Command Description
list List all knowledge notes
create Create a knowledge note
delete <id> Delete a knowledge note

Playbooks (devin playbooks <cmd>)

Command Description
list List all playbooks
create Create a playbook
update <id> Update a playbook
delete <id> Delete a playbook

Secrets (devin secrets <cmd>)

Command Description
list List organization secrets
create Create a secret
delete <id> Delete a secret

Schedules (devin schedules <cmd>)

Command Description
list List schedules
create Create a CRON schedule

Repositories (devin repos <cmd>)

Command Description
list List indexed repositories
index Force-index a repository

Attachments (devin attachments <cmd>)

Command Description
upload <file> Upload a file
download <id> Download an attachment

Enterprise (devin enterprise <cmd>)

Command Description
whoami Show current identity
list-orgs List accessible organizations

Chain (devin chain)

Orchestrate a sequential pipeline of playbooks:

# Inline
devin chain "Refactor utils.py" --playbooks "lint_check,unit_tests"

# YAML workflow file
devin chain --file workflow.yml

πŸ›‘ Session Deduplication

The 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.


πŸ“Ÿ CI/CD Integration

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 }}" --wait

Environment 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

πŸ•Ή v1 / v3 Profile Compatibility

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) ⚠️ warned βœ…
Batch sessions (--bypass-approval) ⚠️ warned βœ…
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.


βš™οΈ Engineering Specs

  • Architecture: Full v3 API support (v3beta1 + enterprise) + v1 legacy proxy
  • Config: ~/.config/devin/config.json
  • Platform: Linux, macOS, WSL2
  • Python: 3.9+

πŸ§ͺ Developer Hub

pip install -e ".[dev]"
PYTHONPATH=src python3 -m pytest

πŸ“„ License

MIT. Devin CLI is an unofficial community project and is not affiliated with Cognition AI.

About

Unofficial CLI for Devin

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages