deepagents-cli 0.0.13a1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. deepagents_cli-0.0.13a1/PKG-INFO +402 -0
  2. deepagents_cli-0.0.13a1/README.md +376 -0
  3. deepagents_cli-0.0.13a1/deepagents_cli/__init__.py +5 -0
  4. deepagents_cli-0.0.13a1/deepagents_cli/__main__.py +6 -0
  5. deepagents_cli-0.0.13a1/deepagents_cli/_version.py +3 -0
  6. deepagents_cli-0.0.13a1/deepagents_cli/agent.py +469 -0
  7. deepagents_cli-0.0.13a1/deepagents_cli/app.py +703 -0
  8. deepagents_cli-0.0.13a1/deepagents_cli/clipboard.py +96 -0
  9. deepagents_cli-0.0.13a1/deepagents_cli/config.py +512 -0
  10. deepagents_cli-0.0.13a1/deepagents_cli/default_agent_prompt.md +78 -0
  11. deepagents_cli-0.0.13a1/deepagents_cli/file_ops.py +444 -0
  12. deepagents_cli-0.0.13a1/deepagents_cli/image_utils.py +209 -0
  13. deepagents_cli-0.0.13a1/deepagents_cli/input.py +429 -0
  14. deepagents_cli-0.0.13a1/deepagents_cli/integrations/__init__.py +1 -0
  15. deepagents_cli-0.0.13a1/deepagents_cli/integrations/daytona.py +117 -0
  16. deepagents_cli-0.0.13a1/deepagents_cli/integrations/modal.py +126 -0
  17. deepagents_cli-0.0.13a1/deepagents_cli/integrations/runloop.py +124 -0
  18. deepagents_cli-0.0.13a1/deepagents_cli/integrations/sandbox_factory.py +348 -0
  19. deepagents_cli-0.0.13a1/deepagents_cli/local_context.py +566 -0
  20. deepagents_cli-0.0.13a1/deepagents_cli/main.py +363 -0
  21. deepagents_cli-0.0.13a1/deepagents_cli/project_utils.py +56 -0
  22. deepagents_cli-0.0.13a1/deepagents_cli/py.typed +0 -0
  23. deepagents_cli-0.0.13a1/deepagents_cli/sessions.py +214 -0
  24. deepagents_cli-0.0.13a1/deepagents_cli/shell.py +138 -0
  25. deepagents_cli-0.0.13a1/deepagents_cli/skills/__init__.py +18 -0
  26. deepagents_cli-0.0.13a1/deepagents_cli/skills/commands.py +491 -0
  27. deepagents_cli-0.0.13a1/deepagents_cli/skills/load.py +68 -0
  28. deepagents_cli-0.0.13a1/deepagents_cli/textual_adapter.py +616 -0
  29. deepagents_cli-0.0.13a1/deepagents_cli/tools.py +183 -0
  30. deepagents_cli-0.0.13a1/deepagents_cli/ui.py +243 -0
  31. deepagents_cli-0.0.13a1/deepagents_cli/widgets/__init__.py +27 -0
  32. deepagents_cli-0.0.13a1/deepagents_cli/widgets/approval.py +199 -0
  33. deepagents_cli-0.0.13a1/deepagents_cli/widgets/autocomplete.py +523 -0
  34. deepagents_cli-0.0.13a1/deepagents_cli/widgets/chat_input.py +537 -0
  35. deepagents_cli-0.0.13a1/deepagents_cli/widgets/diff.py +194 -0
  36. deepagents_cli-0.0.13a1/deepagents_cli/widgets/history.py +152 -0
  37. deepagents_cli-0.0.13a1/deepagents_cli/widgets/loading.py +161 -0
  38. deepagents_cli-0.0.13a1/deepagents_cli/widgets/messages.py +517 -0
  39. deepagents_cli-0.0.13a1/deepagents_cli/widgets/status.py +237 -0
  40. deepagents_cli-0.0.13a1/deepagents_cli/widgets/tool_renderers.py +135 -0
  41. deepagents_cli-0.0.13a1/deepagents_cli/widgets/tool_widgets.py +221 -0
  42. deepagents_cli-0.0.13a1/deepagents_cli/widgets/welcome.py +45 -0
  43. deepagents_cli-0.0.13a1/deepagents_cli.egg-info/PKG-INFO +402 -0
  44. deepagents_cli-0.0.13a1/deepagents_cli.egg-info/SOURCES.txt +48 -0
  45. deepagents_cli-0.0.13a1/deepagents_cli.egg-info/dependency_links.txt +1 -0
  46. deepagents_cli-0.0.13a1/deepagents_cli.egg-info/entry_points.txt +3 -0
  47. deepagents_cli-0.0.13a1/deepagents_cli.egg-info/requires.txt +18 -0
  48. deepagents_cli-0.0.13a1/deepagents_cli.egg-info/top_level.txt +1 -0
  49. deepagents_cli-0.0.13a1/pyproject.toml +132 -0
  50. deepagents_cli-0.0.13a1/setup.cfg +4 -0
@@ -0,0 +1,402 @@
1
+ Metadata-Version: 2.4
2
+ Name: deepagents-cli
3
+ Version: 0.0.13a1
4
+ Summary: Deepagents CLI
5
+ License: MIT
6
+ Requires-Python: <4.0,>=3.11
7
+ Description-Content-Type: text/markdown
8
+ Requires-Dist: deepagents==0.3.6
9
+ Requires-Dist: langchain<2.0.0,>=1.2.3
10
+ Requires-Dist: langchain-openai<2.0.0,>=1.1.7
11
+ Requires-Dist: langgraph-checkpoint-sqlite<4.0.0,>=3.0.0
12
+ Requires-Dist: requests
13
+ Requires-Dist: rich>=13.0.0
14
+ Requires-Dist: prompt-toolkit>=3.0.52
15
+ Requires-Dist: tavily-python
16
+ Requires-Dist: python-dotenv
17
+ Requires-Dist: daytona>=0.113.0
18
+ Requires-Dist: modal>=0.65.0
19
+ Requires-Dist: markdownify>=0.13.0
20
+ Requires-Dist: runloop-api-client>=0.69.0
21
+ Requires-Dist: pillow>=10.0.0
22
+ Requires-Dist: pyyaml>=6.0
23
+ Requires-Dist: textual>=1.0.0
24
+ Requires-Dist: textual-autocomplete>=3.0.0
25
+ Requires-Dist: aiosqlite>=0.19.0
26
+
27
+ # 🚀🧠 Deep Agents CLI
28
+
29
+ The [deepagents](https://github.com/langchain-ai/deepagents) CLI is an open source coding assistant that runs in your terminal, similar to Claude Code.
30
+
31
+ **Key Features:**
32
+
33
+ - **Built-in Tools**: File operations (read, write, edit, glob, grep), shell commands, web search, and subagent delegation
34
+ - **Customizable Skills**: Add domain-specific capabilities through a progressive disclosure skill system
35
+ - **Persistent Memory**: Agent remembers your preferences, coding style, and project context across sessions
36
+ - **Project-Aware**: Automatically detects project roots and loads project-specific configurations
37
+
38
+ <img src="cli-banner.jpg" alt="deep agent" width="100%"/>
39
+
40
+ ## 🚀 Quickstart
41
+
42
+ `deepagents-cli` is a Python package that can be installed via pip or uv.
43
+
44
+ **Install via pip:**
45
+
46
+ ```bash
47
+ pip install deepagents-cli
48
+ ```
49
+
50
+ **Or using uv (recommended):**
51
+
52
+ ```bash
53
+ # Create a virtual environment
54
+ uv venv
55
+
56
+ # Install the package
57
+ uv pip install deepagents-cli
58
+ ```
59
+
60
+ **Run the agent in your terminal:**
61
+
62
+ ```bash
63
+ deepagents
64
+ ```
65
+
66
+ **Get help:**
67
+
68
+ ```bash
69
+ deepagents help
70
+ ```
71
+
72
+ **Common options:**
73
+
74
+ ```bash
75
+ # Use a specific agent configuration
76
+ deepagents --agent mybot
77
+
78
+ # Use a specific model (auto-detects provider)
79
+ deepagents --model claude-sonnet-4-5-20250929
80
+ deepagents --model gpt-4o
81
+
82
+ # Auto-approve tool usage (skip human-in-the-loop prompts)
83
+ deepagents --auto-approve
84
+
85
+ # Execute code in a remote sandbox
86
+ deepagents --sandbox modal # or runloop, daytona
87
+ deepagents --sandbox-id dbx_123 # reuse existing sandbox
88
+ ```
89
+
90
+ 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.
91
+
92
+ ## Model Configuration
93
+
94
+ The CLI supports three LLM providers with automatic provider detection based on model name:
95
+
96
+ **Supported Providers:**
97
+
98
+ - **OpenAI** - Models like `gpt-4o`, `gpt-5-mini`, `o1-preview`, `o3-mini` (default: `gpt-5-mini`)
99
+ - **Anthropic** - Models like `claude-sonnet-4-5-20250929`, `claude-3-opus-20240229` (default: `claude-sonnet-4-5-20250929`)
100
+ - **Google** - Models like `gemini-3-pro-preview`, `gemini-2.5-pro` (default: `gemini-3-pro-preview`)
101
+
102
+ **Specify model at startup:**
103
+
104
+ ```bash
105
+ # Auto-detects Anthropic from model name pattern
106
+ deepagents --model claude-sonnet-4-5-20250929
107
+
108
+ # Auto-detects OpenAI from model name pattern
109
+ deepagents --model gpt-4o
110
+ ```
111
+
112
+ **Or use environment variables:**
113
+
114
+ ```bash
115
+ # Set provider-specific model defaults
116
+ export ANTHROPIC_MODEL="claude-sonnet-4-5-20250929"
117
+ export OPENAI_MODEL="gpt-4o"
118
+ export GOOGLE_MODEL="gemini-2.5-pro"
119
+
120
+ # Set API keys (required)
121
+ export ANTHROPIC_API_KEY="your-key"
122
+ export OPENAI_API_KEY="your-key"
123
+ export GOOGLE_API_KEY="your-key"
124
+ ```
125
+
126
+ **Model name conventions:**
127
+
128
+ Model names follow each provider's official naming convention:
129
+
130
+ - **OpenAI**: See [OpenAI Models Documentation](https://platform.openai.com/docs/models)
131
+ - **Anthropic**: See [Anthropic Models Documentation](https://docs.anthropic.com/en/docs/about-claude/models)
132
+ - **Google**: See [Google Gemini Models Documentation](https://ai.google.dev/gemini-api/docs/models/gemini)
133
+
134
+ The active model is displayed at startup in the CLI interface.
135
+
136
+ ## Built-in Tools
137
+
138
+ The agent comes with the following built-in tools (always available without configuration):
139
+
140
+ | Tool | Description |
141
+ |------|-------------|
142
+ | `ls` | List files and directories |
143
+ | `read_file` | Read contents of a file |
144
+ | `write_file` | Create or overwrite a file |
145
+ | `edit_file` | Make targeted edits to existing files |
146
+ | `glob` | Find files matching a pattern (e.g., `**/*.py`) |
147
+ | `grep` | Search for text patterns across files |
148
+ | `shell` | Execute shell commands (local mode) |
149
+ | `execute` | Execute commands in remote sandbox (sandbox mode) |
150
+ | `web_search` | Search the web using Tavily API |
151
+ | `fetch_url` | Fetch and convert web pages to markdown |
152
+ | `task` | Delegate work to subagents for parallel execution |
153
+ | `write_todos` | Create and manage task lists for complex work |
154
+
155
+ > [!WARNING]
156
+ > **Human-in-the-Loop (HITL) Approval Required**
157
+ >
158
+ > Potentially destructive operations require user approval before execution:
159
+ >
160
+ > - **File operations**: `write_file`, `edit_file`
161
+ > - **Command execution**: `shell`, `execute`
162
+ > - **External requests**: `web_search`, `fetch_url`
163
+ > - **Delegation**: `task` (subagents)
164
+ >
165
+ > Each operation will prompt for approval showing the action details. Use `--auto-approve` to skip prompts:
166
+ >
167
+ > ```bash
168
+ > deepagents --auto-approve
169
+ > ```
170
+
171
+ ## Agent Configuration
172
+
173
+ Each agent has its own configuration directory at `~/.deepagents/<agent_name>/`, with default `agent`.
174
+
175
+ ```bash
176
+ # List all configured agents
177
+ deepagents list
178
+
179
+ # Create a new agent
180
+ deepagents create <agent_name>
181
+ ```
182
+
183
+ ### Environment Variables
184
+
185
+ #### LangSmith Tracing
186
+
187
+ Enable LangSmith tracing to see agent operations in your LangSmith dashboard:
188
+
189
+ ```bash
190
+ export LANGSMITH_API_KEY="your-api-key"
191
+ export LANGSMITH_TRACING=true
192
+ export DEEPAGENTS_LANGSMITH_PROJECT="my-project"
193
+
194
+ deepagents
195
+ ```
196
+
197
+ When configured, the CLI displays:
198
+
199
+ ```
200
+ ✓ LangSmith tracing: 'my-project'
201
+ ```
202
+
203
+ **Advanced: Separate Projects**
204
+
205
+ If you're building a LangChain app with deepagents and want to separate agent traces from your app's traces:
206
+
207
+ ```bash
208
+ export DEEPAGENTS_LANGSMITH_PROJECT="agent-traces" # Deepagents operations
209
+ export LANGSMITH_PROJECT="my-app-traces" # Your app's LangChain calls
210
+ ```
211
+
212
+ ## Customization
213
+
214
+ There are two primary ways to customize any agent: **memory** and **skills**.
215
+
216
+ Each agent has its own global configuration directory at `~/.deepagents/<agent_name>/`:
217
+
218
+ ```
219
+ ~/.deepagents/<agent_name>/
220
+ ├── AGENTS.md # Auto-loaded global personality/style
221
+ └── skills/ # Auto-loaded agent-specific skills
222
+ ├── web-research/
223
+ │ └── SKILL.md
224
+ └── langgraph-docs/
225
+ └── SKILL.md
226
+ ```
227
+
228
+ Projects can extend the global configuration with project-specific instructions and skills:
229
+
230
+ ```
231
+ my-project/
232
+ ├── .git/
233
+ └── .deepagents/
234
+ ├── AGENTS.md # Project-specific instructions
235
+ └── skills/ # Project-specific skills
236
+ └── custom-tool/
237
+ └── SKILL.md
238
+ ```
239
+
240
+ The CLI automatically detects project roots (via `.git`) and loads:
241
+
242
+ - Project-specific `AGENTS.md` from `[project-root]/.deepagents/AGENTS.md`
243
+ - Project-specific skills from `[project-root]/.deepagents/skills/`
244
+
245
+ Both global and project configurations are loaded together, allowing you to:
246
+
247
+ - Keep general coding style/preferences in global AGENTS.md
248
+ - Add project-specific context, conventions, or guidelines in project AGENTS.md
249
+ - Share project-specific skills with your team (committed to version control)
250
+ - Override global skills with project-specific versions (when skill names match)
251
+
252
+ ### AGENTS.md files
253
+
254
+ `AGENTS.md` files provide persistent memory that is always loaded at session start. Both global and project-level `AGENTS.md` files are loaded together and injected into the system prompt.
255
+
256
+ **Global `AGENTS.md`** (`~/.deepagents/agent/AGENTS.md`)
257
+
258
+ - Your personality, style, and universal coding preferences
259
+ - General tone and communication style
260
+ - Universal coding preferences (formatting, type hints, etc.)
261
+ - Tool usage patterns that apply everywhere
262
+ - Workflows and methodologies that don't change per-project
263
+
264
+ **Project `AGENTS.md`** (`.deepagents/AGENTS.md` in project root)
265
+
266
+ - Project-specific context and conventions
267
+ - Project architecture and design patterns
268
+ - Coding conventions specific to this codebase
269
+ - Testing strategies and deployment processes
270
+ - Team guidelines and project structure
271
+
272
+ **How it works:**
273
+
274
+ - Loads memory files at startup and injects into system prompt as `<agent_memory>`
275
+ - Includes guidelines on when/how to update memory files via `edit_file`
276
+
277
+ **When the agent updates memory:**
278
+
279
+ - IMMEDIATELY when you describe how it should behave
280
+ - IMMEDIATELY when you give feedback on its work
281
+ - When you explicitly ask it to remember something
282
+ - When patterns or preferences emerge from your interactions
283
+
284
+ The agent uses `edit_file` to update memories when learning preferences or receiving feedback.
285
+
286
+ ### Project memory files
287
+
288
+ Beyond `AGENTS.md`, you can create additional memory files in `.deepagents/` for structured project knowledge. These work similarly to [Anthropic's Memory Tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/memory-tool). The agent receives instructions on when to read and update these files.
289
+
290
+ **How it works:**
291
+
292
+ 1. Create markdown files in `[project-root]/.deepagents/` (e.g., `api-design.md`, `architecture.md`, `deployment.md`)
293
+ 2. The agent checks these files when relevant to a task (not auto-loaded into every prompt)
294
+ 3. The agent uses `write_file` or `edit_file` to create/update memory files when learning project patterns
295
+
296
+ **Example workflow:**
297
+
298
+ ```bash
299
+ # Agent discovers deployment pattern and saves it
300
+ .deepagents/
301
+ ├── AGENTS.md # Always loaded (personality + conventions)
302
+ ├── architecture.md # Loaded on-demand (system design)
303
+ └── deployment.md # Loaded on-demand (deploy procedures)
304
+ ```
305
+
306
+ **When the agent reads memory files:**
307
+
308
+ - At the start of new sessions (checks what files exist)
309
+ - Before answering questions about project-specific topics
310
+ - When you reference past work or patterns
311
+ - When performing tasks that match saved knowledge domains
312
+
313
+ **Benefits:**
314
+
315
+ - **Persistent learning**: Agent remembers project patterns across sessions
316
+ - **Team collaboration**: Share project knowledge through version control
317
+ - **Contextual retrieval**: Load only relevant memory when needed (reduces token usage)
318
+ - **Structured knowledge**: Organize information by domain (APIs, architecture, deployment, etc.)
319
+
320
+ ### Skills
321
+
322
+ Skills are reusable agent capabilities that provide specialized workflows and domain knowledge. Example skills are provided in the `examples/skills/` directory:
323
+
324
+ - **web-research** - Structured web research workflow with planning, parallel delegation, and synthesis
325
+ - **langgraph-docs** - LangGraph documentation lookup and guidance
326
+
327
+ To use an example skill globally with the default agent, just copy them to the agent's skills global or project-level skills directory:
328
+
329
+ ```bash
330
+ mkdir -p ~/.deepagents/agent/skills
331
+ cp -r examples/skills/web-research ~/.deepagents/agent/skills/
332
+ ```
333
+
334
+ To manage skills:
335
+
336
+ ```bash
337
+ # List all skills (global + project)
338
+ deepagents skills list
339
+
340
+ # List only project skills
341
+ deepagents skills list --project
342
+
343
+ # Create a new global skill from template
344
+ deepagents skills create my-skill
345
+
346
+ # Create a new project skill
347
+ deepagents skills create my-tool --project
348
+
349
+ # View detailed information about a skill
350
+ deepagents skills info web-research
351
+
352
+ # View info for a project skill only
353
+ deepagents skills info my-tool --project
354
+ ```
355
+
356
+ To use skills (e.g., the langgraph-docs skill), just type a request relevant to a skill and the skill will be used automatically.
357
+
358
+ ```bash
359
+ deepagents
360
+ "create a agent.py script that implements a LangGraph agent"
361
+ ```
362
+
363
+ Skills follow Anthropic's [progressive disclosure pattern](https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills) - the agent knows skills exist but only reads full instructions when needed.
364
+
365
+ 1. **At startup** - SkillsMiddleware scans `~/.deepagents/agent/skills/` and `.deepagents/skills/` directories
366
+ 2. **Parse metadata** - Extracts YAML frontmatter (name + description) from each `SKILL.md` file
367
+ 3. **Inject into prompt** - Adds skill list with descriptions to system prompt: "Available Skills: web-research - Use for web research tasks..."
368
+ 4. **Progressive loading** - Agent reads full `SKILL.md` content with `read_file` only when a task matches the skill's description
369
+ 5. **Execute workflow** - Agent follows the step-by-step instructions in the skill file
370
+
371
+ ## Development
372
+
373
+ ### Running Tests
374
+
375
+ To run the test suite:
376
+
377
+ ```bash
378
+ uv sync --all-groups
379
+
380
+ make test
381
+ ```
382
+
383
+ ### Running During Development
384
+
385
+ ```bash
386
+ # From libs/deepagents-cli directory
387
+ uv run deepagents
388
+
389
+ # Or install in editable mode
390
+ uv pip install -e .
391
+ deepagents
392
+ ```
393
+
394
+ ### Modifying the CLI
395
+
396
+ - **UI changes** → Edit `ui.py` or `input.py`
397
+ - **Add new tools** → Edit `tools.py`
398
+ - **Change execution flow** → Edit `execution.py`
399
+ - **Add commands** → Edit `commands.py`
400
+ - **Agent configuration** → Edit `agent.py`
401
+ - **Skills system** → Edit `skills/` modules
402
+ - **Constants/colors** → Edit `config.py`