
- File operations - read, write, and edit files with tools that enable agents to manage and modify code and documentation.
- Shell execution - execute commands to run tests, build projects, manage dependencies, and interact with version control.
- Web search - search the web for up-to-date information and documentation (requires Tavily API key).
- HTTP requests - make HTTP requests to APIs and external services for data fetching and integration tasks.
- Task planning and tracking - break down complex tasks into discrete steps and track progress.
- Memory storage and retrieval - store and retrieve information across sessions, enabling agents to remember project conventions and learned patterns.
- Context compaction & offloading - summarize older conversation messages and offload originals to storage, freeing context window space during long sessions.
- Human-in-the-loop - require human approval for sensitive tool operations.
- Skills - extend agent capabilities with custom expertise and instructions.
- MCP tools - load external tools from Model Context Protocol servers.
- Tracing - trace agent operations in LangSmith for observability and debugging.
Full list of built-in tools
Full list of built-in tools
Built-in tools
The agent comes with the following built-in tools which are available without configuration:-n or piped stdin), shell execution is disabled by default even with -y/--auto-approve. Use -S/--shell-allow-list to allowlist specific commands (e.g., -S "pytest,git,make"), recommended for safe defaults, or all to permit any command. The DEEPAGENTS_CLI_SHELL_ALLOW_LIST environment variable is also supported. See Non-interactive mode and piping for more details./conversation_history/{thread_id}.md), replacing them in context with the summary. The agent can still retrieve the full history from the offloaded file if needed. The compact_conversation tool lets the agent (or you) trigger offloading on demand. When called as a tool, it requires user approval by default.Quickstart
Install and launch
Add provider credentials
/auth inside the TUI to paste an API key for any provider — see Provider credentials for the full flow and storage details. Environment variables (e.g. OPENAI_API_KEY, ANTHROPIC_API_KEY, …) work for CI and headless runs.For the full list of providers and the credentials they expect, see Providers.Give the agent a task
Enable tracing (optional)
~/.deepagents/.env or export the variables in your shell:Providers
OpenAI, Anthropic, and Google are included out of the box. Other providers are installed separately so you only pull in what you need.Interactive mode
Type naturally as you would in a chat interface. The agent will use its built-in tools, skills, and memory to help you with tasks.Slash commands
Slash commands
/model- Switch models or open the interactive model selector. See Switch models for details/agents- Hot-swap between pre-configured agents without relaunching. See Switch agents for details/auth- Manage stored API keys for model providers. See Provider credentials for details/remember [context]- Review conversation and update memory and skills. Optionally pass additional context/skill:<name> [args]- Directly invoke a skill by name. The skill’sSKILL.mdinstructions are injected into the prompt along with any arguments you provide/skill-creator [args]- Guide for creating effective agent skills/offload(alias/compact) - Free up context window space by offloading messages to storage with a summary placeholder. The agent can retrieve the full history from the offloaded file if needed/tokens- Display current context window token usage breakdown/clear- Clear conversation history and start a new thread/threads- Browse and resume previous conversation threads/mcp- Show active MCP servers and tools/reload- Re-read.envfiles, refresh configuration, and re-discover skills without restarting. Conversation state is preserved. SeeDEEPAGENTS_CLI_prefix for override behavior/theme- Open the interactive theme selector to switch color themes. Built-in themes are available plus any user-defined themes/update- Check for and install CLI updates inline. Detects your install method (uv, Homebrew, pip) and runs the appropriate upgrade command/auto-update- Toggle automatic updates on or off/trace- Open the current thread in LangSmith (requiresLANGSMITH_API_KEY)/editor- Open the current prompt in your external editor ($VISUAL/$EDITOR). See External editor/changelog- Open the CLI changelog in your browser/docs- Open the documentation in your browser/feedback- Open the GitHub issues page to file a bug report or feature request/version- Show installeddeepagents-cliand SDK versions/help- Show help and available commands/quit- Exit the CLI
Shell commands
Shell commands
! to enter shell mode, then type your command.Keyboard shortcuts
Keyboard shortcuts
Non-interactive mode and piping
Use-n to run a single task without launching the interactive UI:
-n or -m, the piped content appears first, followed by the text you pass to the flag.
-S/--shell-allow-list to enable specific commands (e.g., -S "pytest,git,make"), recommended for safe defaults, or all to permit any command.
Cap turn count with `--max-turns`
Cap turn count with `--max-turns`
--max-turns N gives operators a hard upper bound without having to touch SDK internals:N must be a positive integer, and overrides the internal safety default that otherwise caps runaway loops. Exits with code 124 (matching GNU timeout) when the budget is exceeded, so CI can distinguish a budget hit from a generic failure. Requires -n or piped stdin; otherwise exits with code 2.Clean output and buffering
Clean output and buffering
-q for clean output suitable for piping into other commands, and --no-stream to buffer the full response (instead of streaming) before writing to stdout:npm init -y, apt-get install -y).Shell execution examples
Shell execution examples
Run a command at startup
Use--startup-cmd to run a shell command once before the session accepts its first prompt. The output is shown to you at the top of the session, which is handy for checking git status, listing files, or verifying environment setup before typing the first prompt.
-m prompt or --skill invocation is dispatched and respects your shell environment. Non-zero exits and timeouts emit a warning but do not abort the session. In non-interactive mode, the command has a 60-second timeout.
git diff | deepagents -n "Review these changes").Switch models
You can switch models during a session without restarting the CLI using the/model command, or at launch with the --model flag:
/model to open an interactive model selector that displays available models grouped by provider.
For full details on switching models, setting a default, and adding custom model providers, see Model providers.
Model parameters
Override model invocation parameters (e.g. reasoning effort, thinking budget, max output tokens, etc.) by passing JSON to--model-params at launch or to /model --model-params mid-session:
--model-params cannot be combined with --default. For persistent provider-level defaults, per-model overrides, and provider-specific examples, see Model parameters on the providers page.
Switch agents
Run/agents to open the agent selector and hot-swap between agents without relaunching. Switching resets the conversation thread and refreshes skill discovery. Ctrl+S on the highlighted row pins that agent as your default so deepagents launches resume it. -a/--agent always overrides; -r/--resume restores the thread’s original agent.
Configuration
The CLI stores all configuration under~/.deepagents/. Within that directory, each agent gets its own subdirectory (default: agent):
config.toml schema, provider parameters, profile overrides, and hook configuration — see Configuration.
Memory
There are two primary ways to customize any agent:-
Memory:
AGENTS.mdfiles and auto-saved memories that persist across sessions. Use memory for general coding style, preferences, and learned conventions. - Skills: Global and project-specific context, conventions, guidelines, or instructions. Use skills for context that is only required when performing specific tasks.
/remember to explicitly prompt the agent to update its memory and skills from the current conversation.
Automatic memory
As you use the agent, it automatically stores information in~/.deepagents/<agent_name>/memories/ as markdown files using a memory-first protocol:
- Research: Searches memory for relevant context before starting tasks
- Response: Checks memory when uncertain during execution
- Learning: Automatically saves new information for future sessions
AGENTS.md files
AGENTS.md files provide persistent context that is always loaded at session start:
- Global:
~/.deepagents/<agent_name>/AGENTS.md— loaded every session. - Project:
.deepagents/AGENTS.mdin any git project root — loaded when the CLI is run from within that project.
How memory works
How memory works
AGENTS.md as you provide information on how it should behave, feedback on its work, or instructions to remember something.
It will also update its memory if it identifies patterns or preferences from your interactions.To add more structured project knowledge in additional memory files, add them in .deepagents/ and reference them in the AGENTS.md file.
You must reference additional files in the AGENTS.md file for the agent to be aware of them.
The additional files will not be read on startup but the agent can reference and update them when needed.When to use global vs. project AGENTS.md
When to use global vs. project AGENTS.md
AGENTS.md (~/.deepagents/agent/AGENTS.md)- Your personality, style, and universal coding preferences
- General tone and communication style
- Universal coding preferences (formatting, type hints, etc.)
- Tool usage patterns that apply everywhere
- Workflows and methodologies that don’t change per-project
AGENTS.md (.deepagents/AGENTS.md in project root)- Project-specific context and conventions
- Project architecture and design patterns
- Coding conventions specific to this codebase
- Testing strategies and deployment processes
- Team guidelines and project structure
Use skills
Skills are reusable agent capabilities that provide specialized workflows and domain knowledge. You can use skills to provide your deep agent with new capabilities and expertise. Deep agent skills follow the Agent Skills standard. Once you have added skills your deep agent will automatically make use of them and update them as you use the agent and provide it with additional information. Use/remember to explicitly prompt the agent to update skills and memory from the current conversation.
Add skills
Add skills
-
Create a skill:
This generates:
-
Open the generated
SKILL.mdand edit the file to include your instructions. -
Optionally add additional scripts or other resources to the
test-skillfolder. For more information, see Examples.
Install community skills
Install community skills
-g) symlink skills into ~/.deepagents/agent/skills/ — the default agent’s user-level skills directory. Project-level installs (omit -g) place skills in .deepagents/skills/ relative to the current directory, making them available to any agent running in that project regardless of agent name.agent directory only. If you use a custom-named agent, either use project-level installs or manually symlink the skill into ~/.deepagents/{your-agent}/skills/.Skill discovery
Skill discovery
.git folder.
When you start the CLI from anywhere within the project’s folder, the CLI will find the project’s root folder by checking for a containing .git folder.For each skill, the CLI reads the name and the description from the SKILL.md file’s frontmatter.
As you use the CLI, if a task matches the skill’s description, the agent will read the skill file and follow its instructions.You can also invoke a skill directly with /skill:<name> [args]. Skill discovery runs at startup and again on /reload.Invoke a skill from the command line
Invoke a skill from the command line
--skill to invoke a skill at launch without typing a slash command interactively:--skill also works in non-interactive mode:--skill with --quiet or --no-stream requires -n (non-interactive mode).List skills
List skills
Subagents
Define custom subagents as markdown files so the CLI agent can delegate specialized tasks to them. Each subagent lives in its own folder with anAGENTS.md file:
name and description (same as the SubAgent dictionary spec). The markdown body becomes the subagent’s system_prompt. In addition to the base spec, AGENTS.md files support an optional model frontmatter field that overrides the main agent’s model for this subagent. Uses the provider:model-name format (e.g., anthropic:claude-opus-4-6, openai:gpt-5.5). Omit to inherit the main agent’s model.
SubAgent fields (tools, middleware, interrupt_on, skills) are currently not configurable via AGENTS.md frontmatter — custom subagents defined this way inherit the main agent’s tools. Use the SDK directly for full control.File format
File format
AGENTS.md files use YAML frontmatter followed by a markdown body:Example: cost-efficient subagents
Example: cost-efficient subagents
Use MCP tools
Extend the CLI with tools from external MCP (Model Context Protocol) servers. Place a.mcp.json at your project root and the CLI discovers it automatically. Servers that require OAuth (Slack, GitHub, Linear, Notion, …) can be authenticated once with deepagents mcp login <server>. See the MCP tools guide for configuration format, OAuth login, auto-discovery, and troubleshooting.
Use remote sandboxes
The CLI uses the sandbox as tool pattern: the CLI process (LLM loop, memory, tool dispatch) runs on your machine, but agent tool calls (read_file, write_file, execute, etc.) target the remote sandbox, not your local filesystem. To get files into the sandbox, use a setup script or the provider’s file transfer APIs (see Working with files).
For a deeper look at sandbox architecture, integration patterns, and security best practices, see Sandboxes.
Install provider dependency
- LangSmith
- Daytona
- Modal
- Runloop
- AgentCore
deepagents-cli. No extra installation needed.Set provider credentials
- LangSmith
- Daytona
- Modal
- Runloop
- AgentCore
Run the CLI with a sandbox
- LangSmith
- Daytona
- Modal
- Runloop
- AgentCore
Sandbox flags and examples
Sandbox flags and examples
Setup scripts
Setup scripts
--sandbox-setup to run a shell script inside the sandbox after creation. This is useful for cloning repos, installing dependencies, and configuring environment variables.${VAR} references in setup scripts using your local environment variables. Store secrets in a local .env file for the setup script to access.Tracing with LangSmith
Enable LangSmith tracing to see agent operations, tool calls, and decisions in a LangSmith project. Add your tracing keys to~/.deepagents/.env so tracing is enabled in every session without per-shell exports:
.env in the project directory. See environment variables for the full loading order.
You can also set these as shell environment variables if you prefer. Shell exports always take precedence over .env values, so this is a good option for temporary overrides or testing:
Separate agent traces from app traces
Separate agent traces from app traces
DEEPAGENTS_CLI_LANGSMITH_PROJECT:LANGSMITH_PROJECT for your parent application’s traces:DEEPAGENTS_CLI_ prefix (e.g., DEEPAGENTS_CLI_LANGSMITH_API_KEY)./trace to print the URL and open it in your browser.
Command reference
Command-line options
Command-line options
CLI commands
CLI commands
--json for machine-readable output. See command-line options for details.Destructive commands (agents reset, skills delete, threads delete) support --dry-run to preview what would happen without making changes. In JSON mode, --dry-run returns the same envelope with a dry_run: true field.
