Series: Deepagent (10/10)

Deep Agents CLI: A Coding Agent in Your Terminal That Actually Plans
The first eight articles covered all the core capabilities of Deep Agents SDK — planning, filesystem, backends, subagents, memory, and skills.
This article looks at one concrete implementation of the SDK: Deep Agents CLI — a coding agent that runs directly in your terminal.
No need to build your own agent, no need to write create_deep_agent() — install it and start using it immediately.
What Deep Agents CLI Is
The CLI is a coding agent built on the deepagents SDK, with the SDK's full capability set right out of the box:
write_todosautomatically plans task steps- Filesystem tools manage context and intermediate outputs
- Long-term memory remembers your preferences and project state across sessions
- Skills support loads the guidelines you've defined
- Sandbox execution runs code in an isolated environment
This isn't just "ChatGPT in your terminal" — it's a coding assistant with a complete agent infrastructure underneath.
Installation and Startup
pip install deepagents
# Set up LLM API key (use whichever model's key you need)
export OPENAI_API_KEY="your-key"
# Start the CLI
deepagentsThe first launch will walk you through an initialization setup, where you choose which LLM backend to use (OpenAI, Anthropic, Ollama, and others are all supported).
Basic Usage
After startup, it's an interactive conversation — just type what you want to do:
> Refactor src/utils.py, extract the duplicate logic, add type hints
> Analyze the architecture of this codebase and give me documentation
> Write a REST API endpoint to handle user login with JWT authentication and error handling
The agent will:
- First list the execution plan (
write_todos) - Read relevant code (filesystem
read_file) - Execute modifications or additions
- Run tests to verify nothing broke (if you've set up a sandbox)
- Report completion
Setting Up Your Skills
Create Markdown documents in ~/.deepagents/skills/ and the CLI will auto-load them:
mkdir -p ~/.deepagents/skills
# Create a Python development standards skill
cat > ~/.deepagents/skills/python-standards.md << 'EOF'
# Python Development Standards
## When to Apply
All Python-related tasks
## Standards
- Use type hints
- Add try/except to all I/O operations
- Use pytest for testing, naming convention: test_{func}_{situation}
- No global variables
## Architecture Preferences
- Business logic goes in services/, not in routes/
- Database operations centralized in repositories/
EOFAfter this, every time you start the CLI, these standards automatically take effect — no need to explain them again.
Configuring the Sandbox Execution Environment
If you want the agent to actually run code rather than just generate it, set up the sandbox backend:
# ~/.deepagents/config.yaml
filesystem_backend: modal # or daytona, deno
sandbox:
provider: modal
timeout: 60 # secondsOnce configured, the agent can:
- Directly execute your code to verify output
- Run the test suite to confirm modifications didn't break existing functionality
- Try different implementation approaches in an isolated environment
Compared to "have the agent generate code, then run it yourself to see what happens" — the ability to execute directly makes the entire development loop much faster.
Human-in-the-Loop: Ask You When Uncertain
The CLI supports human-in-the-loop — the agent pauses and asks you in certain situations:
- When the task scope is unclear ("Did you mean refactoring all of src/ or just utils.py?")
- When there's a destructive operation ("This operation will delete config.json — continue?")
- When a judgment call is needed ("There are two implementation approaches here — which do you prefer?")
This design lets the agent act autonomously where it's confident, and not guess where it has doubts — not asking about everything (that's just a chatbot), and not deciding everything on its own (that leads to mistakes).
CLI vs. SDK: Which to Use When
| Deep Agents CLI | Deep Agents SDK | |
|---|---|---|
| Best for | Personal development assistant, interactive coding | Building products, custom agent behavior |
| Time to get started | Install and go | Requires writing code to configure |
| Customization level | Skills + config file | Fully programmable |
| Tool integration | Built-in coding tools | Any custom tools |
| Usage style | Terminal interaction | invoke / stream API |
Simply put: the CLI is for your own use, the SDK is for building products with.
One Sentence Summary
Deep Agents CLI is the conclusion of this entire series — integrating planning, filesystem, memory, and skills into a coding agent you can use directly in the terminal.
No need to build infrastructure, no need to write boilerplate. Install it, set up your skills, then tell it what you want to do.
Complete Series Index
| # | Topic | Link |
|---|---|---|
| 00 | Series overview | Deep Agents SDK Beginner Course |
| 01 | Design philosophy | What Is Deep Agents SDK? |
| 02 | Getting started | Quickstart: Build Your First Agent in 5 Minutes |
| 03 | Task planning | write_todos: Make the Agent Think Before It Acts |
| 04 | Context management | Filesystem Tools: Don't Let Tokens Explode |
| 05 | Backend selection | In-Memory, Disk, LangGraph Store — How to Choose |
| 06 | Subagents | Subagents: Delegate Tasks with the task Tool |
| 07 | Long-term memory | Remember Important Information Across Conversations |
| 08 | Skills | Teach Your Agent Your Standards and Preferences |
| 09 | CLI | This article |
Previous: The Skills System: Teach Your Agent Your Standards and Preferences