Devin for Terminal: Setup and CLI Command Reference
Devin for Terminal provides a command line interface to execute local and cloud-based AI agent sessions directly from your shell. This guide explains how to install the Devin CLI, manage sessions, configure permission modes for security, and extend the agent with custom skills and lifecycle hooks. We also explain how Fast.io provides a persistent workspace layer for agent files, semantic search, and human handoff.
Why Developers Are Moving to Devin AI Terminal
When Devin AI first entered the software engineering landscape, it resolved 13.86% of real-world GitHub issues on the SWE-bench dataset unassisted [Cognition AI 2024]. This milestone demonstrated that autonomous agents could resolve complex codebase bugs without constant human guidance. While web-based chat interfaces are suitable for high-level prompts, advanced developers require command line tools that run directly inside local shells to access files and run local compilers.
Devin for Terminal is a CLI interface that allows developers to run local and cloud-based agent sessions directly from a shell environment. This developer-centric approach bridges the gap between sandboxed cloud spaces and local machines. By executing commands from your own shell, you grant the agent direct, controlled access to your files and compiler environments. This accelerates the feedback loop during code generation and troubleshooting.
Operating within the terminal also allows developers to integrate Devin into custom scripts and continuous integration workflows. Instead of manually uploading codebase files to a web page, the command line interface reads the repository state directly and runs builds locally. This terminal integration changes Devin from an isolated assistant into a natural extension of your shell.
How to Install and Initialize the Devin CLI
Setting up the Devin CLI requires installing the binary and configuring configuration profiles. The installation scripts install the command line tools and configure your path automatically.
For macOS, Linux, or Windows Subsystem for Linux (WSL), execute the following curl command in your terminal:
curl -fsSL https://cli.devin.ai/install.sh | bash
For Windows environments, open PowerShell and execute the following setup script:
irm https://static.devin.ai/cli/setup.ps1 | iex
Avoid executing this PowerShell command inside Git Bash or Command Prompt (CMD) environments, as they lack the compatibility layers required for the installer. Once the installation finishes, restart your terminal or source your shell profile (such as .bashrc or .zshrc) to register the devin command.
To link the CLI to your account, run the configuration command:
devin configure
The command line will prompt you for an API token. You can generate this token in the developer settings of the Devin web application. The token begins with either an apk_ or cog_ prefix. Paste the token when prompted, then select your target API version. The CLI uses version v3 as the default, which contains the latest endpoint definitions for session control.
If you manage multiple client environments or organization accounts, you can define separate configuration profiles. Run the configuration command with the profile flag to save distinct tokens:
devin configure --profile client-alpha
The CLI stores these configurations locally in ~/.config/devin/config.json. To run commands under a specific profile, pass the profile flag before the main command:
devin --profile client-alpha sessions list
Guide to Essential CLI Commands and Execution Modes
The Devin CLI supports both interactive sessions and automated, non-interactive execution. Developers can control the agent and resume previous work using specific commands.
To start a quick interactive session, run devin without arguments. The CLI opens a prompt where you describe your task. If you want to supply the initial prompt directly from the shell, append it after double dashes:
devin -- "Refactor the user registration controller to validate email addresses"
For automation scripts or continuous integration pipelines, run the CLI in single-turn print-and-exit mode with the -p flag:
devin -p "Run npm run lint and report any styling errors"
In this mode, the agent executes the task and prints the final response to the stdout. This is useful for pre-commit checks or automatic code reviews. If you need to stop a run, run devin terminate with the target session identifier. You can retrieve these identifiers by running devin sessions list.
Handoff to Cloud Devin
Inside an interactive session, you can run the /handoff command to transfer your task from your local machine to Cognition's cloud environment. This is highly useful for long-running builds or when you need to close your laptop but want the agent to continue working.
When you run /handoff followed by a task description, the CLI packages your current local context. This packages the active git branch and any uncommitted edits. It then uploads this context to a secure cloud sandbox. Devin continues execution in the cloud, and you can monitor the run via the web UI or the terminal watch tools.
To verify that your local changes are preserved after a handoff, the cloud environment replicates your local directory state exactly. Once Devin completes the task in the cloud, the agent opens a pull request on your git provider. This allows you to pull the completed work back to your local environment.
How to Configure Safety Limits with Permission Modes
To protect your local environment from unintended modifications, Devin CLI features permission settings to control command safety limits. You define these limits using the --permission-mode flag.
Permission Modes:
normal(Default): Auto-approves read-only tools like file searching or reading inside your project directory. Any write actions or shell command executions require explicit user approval via terminal prompts.accept-edits: Auto-approves file writes and edits within the designated workspace directory. Shell command executions still require user verification.bypass(Aliases:/yolo,/dangerous): Auto-approves all tool calls. Use this mode with caution, only when executing trusted prompts in clean directories.autonomous: Auto-approves shell executions and file updates, but forces them to run within a secure, OS-level sandbox. You must pair this mode with the--sandboxflag.
For example, to run an automated dependency update script without manual confirmation prompts, execute:
devin -p "npm update" --permission-mode bypass
If you run the agent in the default normal mode, the CLI halts whenever Devin attempts to run a shell command or write a file. The terminal displays the proposed command, and you must press y or n to continue. While this check ensures system safety, it requires constant developer presence.
For local tasks that involve executing compilers or installing packages, use the --sandbox flag. This isolates Devin's shell executions within a secure container, preventing the agent from modifying your global system files or accessing private credentials.
Configuring Directory Restrictions and Enterprise Policies
While individual developers can set local permission modes, organizations often require strict controls over which folders Devin can access. You can define directory restrictions in your global configuration file to restrict Devin to specific paths.
If you set directory restrictions, Devin CLI automatically blocks the agent from reading or writing files outside those paths, regardless of whether you run the session in bypass or dangerous mode. Additionally, enterprise administrators can define global policy rules in the organization dashboard. These settings are enforced at the API level and cannot be overridden by local flags, ensuring consistent safety standards across the development team.
Persist Devin CLI sessions with shared workspaces
Deploy an intelligent workspace with a built-in MCP server for Devin and your development team, with semantic search and RAG indexing. Start your 14-day free trial on our Starter ($29/mo), Business ($99/mo), or Growth ($299/mo) plans today.
Extending Devin: Skills, Hooks, and Rules
Advanced users can customize Devin's behavior and enforce execution policies using rule files and custom skills.
Rule Files:
Devin natively reads an AGENTS.md file located at the project root directory during startup. This file acts as a persistent instructions guide, defining coding style rules and project-specific testing commands. If the file is present, the agent reviews it before executing any user prompts.
Custom Skills:
Skills are reusable prompts and tools workflows defined as Markdown files with YAML frontmatter. You can scope skills to a specific project by placing them in .devin/skills/ or define them globally for your user account in ~/.config/devin/skills/.
Here is an example skill file (.devin/skills/minify/SKILL.md) that defines a code optimization command:
---
name: minify
description: Optimize and compress build artifacts
allowed-tools:
- read
- write
- exec
model: swe-1.6
triggers:
- user
---
Find all Javascript files in the build directory, run the local minifier script, and overwrite them with the compressed output. Verify that the application still loads.
Once written, you can invoke this skill inside an interactive Devin session by running the slash command /minify. The agent loads the predefined prompts and executes the workflow using the specified model.
Enforcing Quality Gates with Lifecycle Hooks
Hooks in Devin CLI allow teams to configure execution policies and automated validation gates. Hooks are defined as scripts or command strings that Devin executes at specific lifecycle events. For example, a hook can inspect the agent's proposed command before execution to check for banned scripts or security violations.
To configure a hook that runs after a task finishes, add a hook that executes your project verification scripts:
#!/bin/bash
npm run lint && npm run test
If the script exits with a non-zero code, the hook reports a failure to Devin CLI. The agent is blocked from completing the session and is prompted to fix the failing code. This ensures that the agent cannot submit broken code or failing tests for review, which maintains repository quality.
Workspace Persistence: Local vs Cloud Storage
Ephemeral virtual environments are created for Devin CLI cloud handoffs, and local directories can become cluttered with temp files when running multiple local agents. Developers need a reliable system to persist session states and review agent logs.
Traditional storage options present significant limitations. Local folders are prone to accidental deletion and cannot be shared easily with teammates. Basic cloud drives and object storage like Amazon S3 lack semantic search and granular agent permissions.
To resolve these storage and collaboration challenges, developers use Fast.io to configure persistent, intelligent workspaces. Fast.io provides org-owned workspaces that serve as a shared directory for human developers and AI agents.
Fast.io Key Features:
MCP-Native Access: Fast.io exposes a consolidated MCP toolset with Streamable HTTP endpoints (specifically
/mcp) and legacy SSE endpoints (specifically/sse). Coding agents can read and manage workspace files programmatically. Setup instructions are detailed in the Fast.io MCP server guide, and agent onboarding is documented athttps://fast.io/llms.txt.Intelligence Mode: Enabling Intelligence Mode automatically indexes your workspace files for semantic search and RAG queries, allowing agents to find relevant functions and files using natural language.
Metadata Views: This feature converts unstructured files into a structured database. Developers specify the fields they want extracted, and Fast.io designs a typed schema (including Text, Integer, Decimal, Boolean, URL, JSON, Date & Time) to extract data from PDFs, images, and notes. Learn more at the Metadata Views page.
Collaborative Notes: Developers and agents co-edit design docs and notes in real time, with active cursors showing concurrent edits.
Version History: Every file maintains a per-file version history. If an agent overwrites a file incorrectly, developers can restore the prior version instantly, keeping the audit trail clear.
Ownership Transfer: Agents can build workspaces and then hand them off to human clients via a claim link, while maintaining administrator access.
Fast.io plans start with a 14-day free trial that requires a credit card. Subscriptions include the Starter plan at $29/mo, the Business plan at $99/mo, and the Growth plan at $299/mo. Learn more on the pricing page.
Integrating Fast.io with your Devin workflow ensures that all agent outputs are persisted and version-controlled, providing a reliable operational layer for developer-agent collaboration.
Frequently Asked Questions
How do I install Devin CLI?
You can install the Devin CLI on macOS, Linux, or WSL by running curl -fsSL https://cli.devin.ai/install.sh | bash. For Windows environments, run irm https://static.devin.ai/cli/setup.ps1 | iex in PowerShell.
What commands are available in Devin terminal?
The Devin CLI includes devin configure for setup, devin sessions create for launching sessions, devin sessions list for reviewing active runs, devin watch to stream logs, and devin terminate to halt sessions.
How do I run Devin from the command line?
To run an interactive Devin session from the command line, execute devin in your terminal. You can pass an initial prompt directly by running devin -- "your prompt" or execute a non-interactive single-turn task with devin -p "your prompt".
How do I configure permission modes in Devin CLI?
Use the --permission-mode flag when launching a session. Available modes include normal, accept-edits, bypass (dangerous), and autonomous. Enterprise policies set by your administrator will always override these local settings.
Related Resources
Persist Devin CLI sessions with shared workspaces
Deploy an intelligent workspace with a built-in MCP server for Devin and your development team, with semantic search and RAG indexing. Start your 14-day free trial on our Starter ($29/mo), Business ($99/mo), or Growth ($299/mo) plans today.