Devin CLI Commands: A Complete Reference & Cheat Sheet
Running Devin directly from the terminal requires precise filesystem boundaries, permission scoping, and session controls to avoid local configuration pollution. This reference provides the exact CLI commands, global flags, and interactive slash commands needed to manage sandboxes and session histories. We also map how to use Fastio's persistent workspace and MCP server to retain agent outputs across ephemeral cloud runs.
How to Manage Terminal Operations and Cloud Sandbox Safety
Running an autonomous coding agent directly in your local terminal without sandbox boundaries is a recipe for broken system packages, accidental script execution, and git history pollution. The fix is not to restrict the agent to a web UI, but to master the Devin CLI configuration, command-line flags, and interactive slash commands that structure exactly how, when, and where the agent is allowed to execute. The Devin CLI provides terminal commands to start sessions, diagnose system health, configure authentication, and run interactive slash commands that control the agent's behavior during execution. By mastering these commands, developers can control permission levels in real time while maintaining a clean, isolated local environment.
The official Devin CLI acts as the bridge between your local development environment and the autonomous agent's cloud runtime. Unlike simple command wrappers, the official CLI includes features for managing local filesystems, handling authentication, and orchestrating virtualized sandboxes. When configuring the tool for the first time, you must authenticate it with your account credentials. The default installation handles authentication through a browser-based OAuth flow, but this requires an active graphical user interface. If you are configuring Devin in a headless environment, such as a remote server, an SSH session, or a container, you can bypass the graphical interface by using specific setup flags.
Running the command devin setup launches an interactive wizard that guides you through API token authentication and Model Context Protocol settings. For remote systems, appending the --force-manual-token-flow flag redirects the authentication flow to a manual token prompt in the terminal, allowing you to paste your token directly. For teams that want to run the CLI without setting up official API keys or managing cloud sandboxes, there are community-built tools. For example, the unofficial revanthpobala/devin-cli repository on GitHub was developed to allow developers to query Devin and monitor sessions using the v3 and v1 APIs, providing multi-profile management to handle different configuration environments. However, the official Devin CLI is required to use Cognition's secure sandbox environment and native lifecycle hooks.
Related guides
- Claude Code Commands: Complete CLI and Slash Command ReferenceClaude Code ships over 70 slash commands, 50+ CLI flags, and a fully customizable keybinding system. Most developers...
- Claude Code Cheat Sheet: Commands, Shortcuts, and Quick ReferenceClaude Code ships with 30+ slash commands and 10+ keyboard shortcuts, yet most developers stick to the same five or...
- How to Install and Use the Devin AI CLICognition positions Devin AI CLI as a local coding agent that runs on your machine, separate from cloud Devin in a VM....
- Devin for Terminal: Setup and CLI Command ReferenceDevin for Terminal provides a command line interface to execute local and cloud-based AI agent sessions directly from...
- Devin AI vs OpenAI Codex: Autonomous Cloud Agent vs CLI AssistantDevin AI runs as an autonomous software engineering platform in isolated cloud sandboxes with browser and terminal...
- How to Set Up Devin AI Desktop App with Persistent WorkspacesCoordinating local files and cloud agent fleets often leads to overwrites and lost context. This guide explains how to...
More on this subject: Devin (103 guides)
Steps to Configure Devin CLI Commands and Launch Sessions
The Devin CLI is designed to run tasks in either interactive or non-interactive modes depending on your workflow requirements. When you run devin with no arguments, the CLI opens an interactive terminal interface. This interface behaves like a chat session where you can enter prompts, watch Devin's steps, view file edits, and approve commands. If you already know the task you want to execute and want to kick it off immediately, you can append the prompt directly in your terminal command. Using the syntax devin -- <your prompt> opens the interactive interface with your initial message pre-loaded.
For script integration, automated builds, or quick queries, you can run Devin in a non-interactive, single-turn mode. Using the flag -p or --print followed by your prompt tells the CLI to execute the task, write the final output to stdout, and exit the session immediately. This is useful for piping Devin's output to other command-line utilities or running automated code audits. If you need to stop a task mid-execution, you can hit Ctrl+C or Esc to cancel the agent's run.
To manage your active sessions and configure the CLI behavior, you can use the following terminal commands:
devin: Opens the interactive chat session (REPL) in your terminal.devin setup: Launches the interactive setup wizard for authentication and API tokens.devin update: Checks for updates and installs the latest version of the CLI.devin update --force: Re-installs the current version of the CLI even if it is already up to date.devin doctor: Runs diagnostics to verify network paths and model endpoint connectivity.devin sandbox setup: Installs and configures sandboxing dependencies for your local platform.devin uninstall: Removes the CLI and associated binaries from your machine.
When starting a session, you can modify its runtime constraints using several global command-line flags:
-p <prompt>or--print <prompt>: Runs the task in single-turn mode, prints the result, and exits.-c: Resumes the most recent session detected in the current directory.-r <SESSION_ID>: Resumes a specific session using its unique ID.--sandbox: Forces the session to run with OS-level sandbox isolation.--permission-mode <mode>: Sets the initial permission level (such asnormal,accept-edits,smart, orbypass).--model <model_name>: Specifies the target language model to drive the session.--profile <profile_name>: Loads configuration settings from a specific profile.--json: Formats the CLI output as raw JSON objects and suppresses terminal colors.--clean: Used with the uninstall command to wipe all configurations, histories, and logs.
Interactive Slash Commands for Active Sessions
Once you launch an interactive Devin session, the CLI displays a prompt input where you can direct the agent's work in real time. Rather than relying entirely on natural language instructions, you can use slash commands to modify the agent's settings, check its state, or branch your work. When you type a slash in the prompt, the CLI opens an autocomplete menu that lists all available commands. You can navigate this menu using your arrow keys or keep typing to filter the commands.
One of the most common uses of slash commands is adjusting permission boundaries on the fly. If you want to review every action Devin takes, you can switch to normal mode. In normal mode, Devin auto-approves read-only tools but prompts you for confirmation before writing files or running shell commands. If you are comfortable letting the agent write files but still want to gate command execution, you can use the accept-edits command. If you want the agent to execute all commands without prompting, you can switch to bypass mode, which operates as a YOLO mode. You can also switch the agent to smart mode, which auto-approves safe actions but asks for permission when running risky commands like deleting directories or installing packages.
Inside the active prompt, you can use the following interactive slash commands to control the session:
/normal: Switches the agent to normal permission mode, prompting for all write and execute tools./accept-edits: Switches to accept-edits mode, auto-approving file edits but prompting for shell runs./smart: Switches to smart mode, prompting only for high-risk actions./bypass: Switches to bypass mode, auto-approving all actions without user confirmation./plan: Sets the agent to plan mode, focusing on outlining steps before execution./ask <question>: Runs a quick side query against the codebase without changing the current mode./btw <question>: Asks a side question in a separate thread. This runs a sidechain using the current context and displays the answer in a boxed container, keeping the main conversation history clean./loop <prompt>: Executes a prompt and automatically reviews the resulting diff in a loop, which is useful for linting or test-fix cycles. This command requires a clean git state before running./fork [step_number]: Branches the current session into a new session. If you provide a step number, the fork starts from that specific point in the history./steps: Lists all conversation steps with their IDs, allowing you to select the correct point to fork./shortcuts: Opens an interactive list of keyboard shortcuts where you can rebind actions./hooks: Displays all currently loaded lifecycle hooks, showing their IDs and event triggers./workspace: Lists all directories and files currently loaded into Devin's active context./exitor/quit: Terminates the current interactive session and returns to your main terminal.
Using these commands gives you a granular level of control over Devin's execution. If the agent gets stuck in a loop, you can cancel the current run using Esc or Ctrl+C, run /steps to review what went wrong, and then use /fork to restart the session from a clean state prior to the error.
Persist Devin AI files across sessions
Set up a shared workspace with an MCP endpoint for your agent's reads and writes, complete with file version history and semantic search. Starts with a 14-day trial.
Persisting Ephemeral Sandbox Data in Fastio Workspaces
While running Devin in a cloud sandbox keeps your local machine secure, it introduces a challenge with data persistence. Devin's cloud Devbox is designed as an ephemeral container. Once the active session ends, the virtual machine is shut down, and any files not committed to Git or exported to a remote repository are lost. This makes it difficult to retrieve intermediate build artifacts, coverage reports, log files, or databases that are generated during the run. To keep these files, developers often rely on copying files to local folders via SFTP, uploading artifacts to Amazon S3, or using consumer cloud tools like Google Drive or Dropbox. However, these systems require writing custom upload scripts and do not integrate directly with the agent's runtime.
A team can solve this persistence problem by using Fastio shared workspaces as a durable storage layer. Fastio provides shared workspaces where agents and human developers collaborate on the same files. Instead of treating storage as a simple folder, Fastio is an intelligent workspace platform. When you enable Intelligence Mode on a workspace, Fastio automatically indexes all files for semantic search, auto-summarization, and RAG chat. An agent can read and write files directly using the Fastio Model Context Protocol (MCP) server over Streamable HTTP at https://mcp.fast.io/mcp/code.
For authenticated connections, you can configure your agent to connect to the MCP server endpoint at https://mcp.fast.io/mcp/code by providing a scoped API key in the request headers. For details on configuring this endpoint, consult the Fastio documentation. For example, if you are configuring a remote agent with an MCP settings file, you would define the server using the url property:
{
"mcpServers": {
"fastio": {
"url": "https://mcp.fast.io/mcp/code",
"headers": {
"Authorization": "Bearer <YOUR_FASTIO_API_KEY>"
}
}
}
}
By connecting Devin to a Fastio workspace via MCP, the agent can write its logs and reports directly to a persistent, versioned storage system. Fastio keeps a complete per-file version history, ensuring that if an agent overwrites a file or writes corrupt data, you can restore prior versions. The workspace also includes Collaborative Notes, allowing humans and agents to co-edit project boards and checklists in real time. If you need to extract structured data from test logs or build files, you can use Fastio Metadata Views to turn your files into a queryable database. You can define columns using natural language (such as Integer, Date & Time, and Boolean types), and Fastio will automatically extract the values from your files, making them queryable via the MCP server.
Fastio operates on a paid subscription model. Organizations can choose from the Starter plan at $9.99/mo, the Business plan at $49.99/mo, or the Enterprise plan at $199.99/mo (see the pricing page for details). Every organization starts with a 14-day free trial that requires a credit card. An agent can sign up for free, set up the workspace, and then use the ownership transfer feature to send a claim link to a human sponsor. The human then registers their credit card, starts the 14-day trial, and takes full ownership of the workspace while the agent retains developer access.
Troubleshooting Guide for Local Sandboxing and Environments
Using the Devin CLI in complex development environments can sometimes lead to connectivity errors, environment conflicts, or configuration issues. One common issue occurs when trying to run Devin's execution tool with OS-level sandboxing on local machines. Running devin sandbox setup will print the specific prerequisites needed for your platform. On macOS, sandboxing works natively via Seatbelt. However, on Linux, the sandbox requires you to install Bubblewrap and Socat on your host system. If these packages are missing, the CLI will output an error and block execution. On Windows, native sandboxing is not supported, meaning you must run the Devin CLI inside a WSL 2 distribution to isolate its commands.
Another common source of confusion is shell integration. In older preview versions of the Devin CLI, running setup configured terminal aliases and shell integrations. However, this shell integration was removed in version v3000.4.16. If you have leftover configuration blocks in your shell files, they can cause path resolution errors or slow down your terminal startup. To resolve this, you can run the command devin shell remove to clean up any old blocks from your shell configuration files (such as .zshrc, .bashrc, or .config/fish/config.fish).
For network and model connectivity issues, particularly in air-gapped corporate environments, you can run devin doctor. This command runs a series of diagnostic checks on your environment, verifying proxy settings, credential stores, and endpoint routing. If you are scripting a setup routine, you can run devin doctor --json to receive the diagnostic output as a raw JSON object, allowing you to parse the status programmatically. If you hit database migration errors after upgrading the CLI, you should run devin update --force to force-reinstall the current version and align your local session database with the latest schema.
Sources
References used to verify factual claims in this guide.
-
The unofficial devin-cli repository is a community-developed tool for interacting with Devin AI.
-
Devin CLI preview shell integration was removed in version v3000.4.16.
-
The Devin CLI can be run in either interactive or non-interactive mode depending on the session requirements.
Frequently Asked Questions
What are the Devin CLI commands?
The Devin CLI provides terminal commands to manage your environment and configure execution settings. Core commands include `devin setup` for authentication, `devin update` to check for and install updates, `devin doctor` to run connectivity diagnostics, `devin sandbox setup` to prepare OS-level container isolation, and `devin uninstall` to remove the tool and its configuration.
How do I run Devin from the terminal?
To run Devin from the terminal, execute the `devin` command in your project directory. This starts an interactive REPL session. You can pass an initial prompt using the syntax `devin -- <prompt>`, or run a non-interactive task that prints directly to stdout and exits using `devin -p <prompt>`. To resume a past session, use the `-r <SESSION_ID>` flag.
How do I use slash commands in Devin?
Within an active interactive Devin terminal session, type a forward slash `/` to open an autocomplete menu of available commands. Slash commands allow you to modify permission modes (such as `/normal`, `/accept-edits`, `/smart`, and `/bypass`), branch your work from a specific point using `/fork [step]`, and run side queries with `/btw <question>` without polluting your main conversation history.
Related Resources
Persist Devin AI files across sessions
Set up a shared workspace with an MCP endpoint for your agent's reads and writes, complete with file version history and semantic search. Starts with a 14-day trial.