Get the FREE Ultimate OpenClaw Setup Guide →

deepagents-cli

Use Caution
npx machina-cli add skill Gitmaxd/deepagents-cli-codex-skill/deepagents-cli --openclaw
Files (1)
SKILL.md
11.9 KB

Deep Agents CLI

Terminal coding agent with persistent memory, skills, sandboxed execution, and 20+ LLM providers. Built on LangGraph. See the official overview and CLI guide.

Routing: This file covers quick start, core concepts, and common workflows. For deeper details, read the appropriate reference file: CLI flags and shortcuts → references/cli-reference.md | Models and providers → references/providers.md | Skills → references/skills-system.md | Memory → references/memory-and-persistence.md | Sandboxes → references/sandboxes.md | SDK/programmatic usage → references/sdk-customization.md | Automation/CI → references/workflows.md | Streaming → references/streaming.md | Editor integrations → references/acp.md

Note: All official documentation content is included in the local reference files. Only fetch external URLs if the local content appears inaccurate or incomplete.

Quick Start

# Interactive session (default agent, default model)
deepagents

# Interactive with specific agent and model
deepagents -a myagent -M anthropic:claude-sonnet-4-5

# Non-interactive one-shot task
deepagents -n "Summarize README.md"

# Non-interactive with shell access
deepagents -n "List Python files and count lines" --shell-allow-list ls,wc,find

# Resume last session
deepagents -r

Core Concepts

Agents = Isolated Personas

Each agent has its own memory, skills, and AGENTS.md context file (default agent shown; use -a <name> for named agents):

~/.deepagents/default/
├── AGENTS.md          # Always-loaded context (preferences, conventions)
├── memories/          # Auto-saved topic memories
└── skills/            # User-level skills
deepagents -a researcher      # Use "researcher" agent
deepagents -a coder           # Use "coder" agent
deepagents list               # List all agents
deepagents reset --agent NAME # Clear agent memory

Memory vs Skills

AspectMemory (AGENTS.md + memories/)Skills (SKILL.md)
LoadingAlways injected at startupOn-demand via progressive disclosure
PurposePreferences, conventionsTask-specific workflows
Use whenContext is always relevantInstructions are large or situational

See Memory & Persistence and Skills System for details on each system.

Two Operating Modes

ModeCommandUse Case
InteractivedeepagentsExploration, conversation, complex tasks
Non-interactivedeepagents -n "task"Automation, scripting, CI/CD

Interactive Mode

Launch the REPL with deepagents. Key controls (see CLI Reference for the complete list):

ActionKey/Command
SubmitEnter
NewlineShift+Enter, Ctrl+J, Alt+Enter, or Ctrl+Enter
Expand/collapse tool outputCtrl+E
Toggle auto-approveShift+Tab or Ctrl+T
Select all textCtrl+A
File autocomplete@filename
Run shell command!git status
InterruptEscape or Ctrl+C
ExitCtrl+D or /quit

Slash Commands

/model               # Interactive model selector
/model provider:name # Switch to specific model
/remember [context]  # Update memory and skills from conversation
/tokens              # Show token usage
/clear               # Clear conversation history and start new thread
/threads             # Browse and resume previous threads
/trace               # Open current thread in LangSmith
/changelog           # Open CLI changelog in browser
/docs                # Open documentation in browser
/feedback            # File bug report or feature request
/version             # Show version
/quit                # Exit CLI (alias: /q)
/help                # Show all commands

Non-Interactive Mode

For automation and scripting — runs a single task and exits (see Workflows & Patterns for CI/CD recipes):

# Basic task
deepagents -n "Analyze this codebase for security issues"

# With shell access (default: no shell in non-interactive)
deepagents -n "Run tests and report failures" --shell-allow-list recommended
deepagents -n "Search logs for errors" --shell-allow-list ls,cat,grep

# Auto-approve all tool calls
deepagents --auto-approve -n "Generate docs for all modules"

# Specific model
deepagents -M ollama:qwen3:8b -n "Explain this code"

Shell access in non-interactive mode is disabled by default. Use --shell-allow-list:

  • recommended — safe defaults
  • ls,cat,grep,... — explicit comma-separated list

Piping and stdin

The CLI accepts piped input via stdin. When input is piped, the CLI automatically runs non-interactively:

# Pipe content for analysis
echo "Explain this code" | deepagents
cat error.log | deepagents -n "What's causing this error?"
git diff | deepagents -n "Review these changes"

# Clean output for piping to other commands
deepagents -n "Generate a .gitignore for Python" -q > .gitignore
deepagents -n "List dependencies" -q --no-stream | sort

When piped input is combined with -n or -m, the piped content is prepended to the flag's value. The maximum piped input size is 10 MiB.

Model Selection

See Providers & Models for all 20+ supported providers, API key setup, and config.toml format. See also the official providers guide.

At Launch

deepagents -M anthropic:claude-sonnet-4-5
deepagents -M openai:gpt-4o
deepagents -M ollama:qwen3:8b

During Session

/model                          # Interactive picker
/model anthropic:claude-opus-4-6  # Direct switch

Default Model

deepagents --default-model anthropic:claude-sonnet-4-5  # Set default
deepagents --default-model                               # Show current
deepagents --clear-default-model                         # Clear default

Resolution Order

  1. -M flag (always wins)
  2. [models].default in ~/.deepagents/config.toml
  3. [models].recent (last /model switch, auto-saved)
  4. First available API key: OPENAI_API_KEYANTHROPIC_API_KEYGOOGLE_API_KEYGOOGLE_CLOUD_PROJECT

Skills Management

See Skills System for the full SKILL.md format and progressive disclosure. See also the official skills docs.

deepagents skills create my-skill             # Create user skill
deepagents skills create my-skill --project   # Create project skill
deepagents skills list                        # List user skills
deepagents skills list --project              # List project skills
deepagents skills info my-skill               # Show skill details
deepagents skills delete my-skill             # Delete user skill
deepagents skills delete my-skill --project   # Delete project skill

User skills: ~/.deepagents/<agent>/skills/ Project skills: <project>/.deepagents/skills/ (requires .git in project root)

Project skills override user skills with the same name.

Sandbox Execution

Run agent code in isolated environments (see Sandboxes for setup guides and official sandbox docs):

deepagents --sandbox modal --sandbox-setup ./setup.sh
deepagents --sandbox runloop
deepagents --sandbox daytona
deepagents --sandbox langsmith
deepagents --sandbox-id EXISTING_ID    # Reuse sandbox

Sandbox providers: Modal (ML/GPU), Runloop (disposable devboxes), Daytona (fast cold starts), LangSmith (cloud deployment).

Built-in Tools

ToolDescriptionApproval Required
lsList files/directories
read_fileRead file contents; supports images (.png, .jpg, .jpeg, .gif, .webp)
write_fileCreate/overwrite files
edit_fileTargeted string replacements
globFind files by pattern
grepSearch file contents
shellExecute shell commands (local)
executeExecute in sandbox
web_searchSearch web (Tavily)
fetch_urlFetch web pages as markdown
taskDelegate to subagents
write_todosTask planning/tracking

Use --auto-approve or Shift+Tab in REPL to bypass approval prompts.

Common Workflows

Code Analysis (Safe, Read-Only)

deepagents -n "Analyze src/ for code quality issues"

Code Generation with File Writing

deepagents --auto-approve -n "Generate unit tests for src/auth.py"

Research with Memory Persistence

deepagents -a researcher -m "Research best practices for Python async"
# Agent saves findings to memories/ automatically
# Next session:
deepagents -a researcher -m "What did we learn about async?"

Project-Scoped Agent

cd my-project
# Create .deepagents/AGENTS.md with project conventions
mkdir -p .deepagents
echo "# Project uses FastAPI, PostgreSQL, pytest" > .deepagents/AGENTS.md
deepagents -m "Help me add a new API endpoint"

Configuration

Global config: ~/.deepagents/config.toml (see Providers & Models for the full config.toml schema)

[models]
default = "anthropic:claude-sonnet-4-5"

[models.providers.ollama]
base_url = "http://localhost:11434"
models = ["qwen3:8b", "llama3"]

[models.providers.ollama.params]
temperature = 0
num_ctx = 8192

References

For detailed documentation:

Tips

  • @filename in REPL auto-completes and injects file contents into your prompt
  • !command runs shell commands directly without agent interpretation
  • /remember [context] explicitly triggers memory/skill updates — pass optional context to guide the update
  • -n mode has no shell by default — add --shell-allow-list recommended for safe commands
  • Local models (Ollama) work for simple tasks but may struggle with complex tool-calling — use Anthropic/OpenAI for multi-step work
  • Reset an agent with deepagents reset --agent NAME if memories accumulate irrelevant info

Source

git clone https://github.com/Gitmaxd/deepagents-cli-codex-skill/blob/main/templates/skills/deepagents-cli/SKILL.mdView on GitHub

Overview

Deep Agents CLI is a LangGraph-based terminal coding agent with persistent memory and sandboxed execution. It supports interactive and non-interactive sessions, 20+ LLM providers, and a comprehensive skill and memory system, all orchestrated via AGENTS.md and memories. This makes it ideal for building scripted workflows, CI tasks, and complex terminal automation.

How This Skill Works

Built on LangGraph, the CLI stores agent data under ~/.deepagents, loading AGENTS.md and auto-saving memories. You can switch agents with -a and models with -M, run interactive sessions with deepagents or non-interactive tasks with -n, and tasks run in a sandboxed environment with support for subagents, streaming, and the Agent Client Protocol.

When to Use It

  • Automating terminal tasks in CI/CD pipelines with non-interactive runs.
  • Prototype and test terminal coding tasks interactively.
  • Switch between multiple agents with different skills and memories.
  • Run long-running tasks in a sandboxed environment.
  • Experiment with 20+ LLM providers and different model configurations.

Quick Start

  1. Step 1: Start an interactive session with deepagents
  2. Step 2: Choose agent and model with -a and -M, e.g., deepagents -a myagent -M anthropic:claude-sonnet-4-5
  3. Step 3: Run a non-interactive task or resume with -n or -r, e.g., deepagents -n 'Summarize README.md' or deepagents -r

Best Practices

  • Define per-agent context in ~/.deepagents/<name>/AGENTS.md for consistent behavior.
  • Use -a to switch agents and -M to lock a provider/model per task.
  • Use non-interactive -n for automation and CI tasks; reserve -r to resume sessions.
  • Keep shell usage within sandbox rules; enable --shell-allow-list as needed.
  • Monitor streaming output (Ctrl+E) to manage long results and errors.

Example Use Cases

  • deepagents - start an interactive session.
  • deepagents -a researcher -M anthropic:claude-sonnet-4-5
  • deepagents -n 'Summarize README.md'
  • deepagents -n 'List Python files and count lines' --shell-allow-list ls,wc,find
  • deepagents -r

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers