deepagent-code 0.1.0__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.
- deepagent_code-0.1.0/LICENSE +21 -0
- deepagent_code-0.1.0/PKG-INFO +161 -0
- deepagent_code-0.1.0/README.md +128 -0
- deepagent_code-0.1.0/deepagent_code/__init__.py +46 -0
- deepagent_code-0.1.0/deepagent_code/cli.py +796 -0
- deepagent_code-0.1.0/deepagent_code/utils.py +653 -0
- deepagent_code-0.1.0/deepagent_code.egg-info/PKG-INFO +161 -0
- deepagent_code-0.1.0/deepagent_code.egg-info/SOURCES.txt +14 -0
- deepagent_code-0.1.0/deepagent_code.egg-info/dependency_links.txt +1 -0
- deepagent_code-0.1.0/deepagent_code.egg-info/entry_points.txt +2 -0
- deepagent_code-0.1.0/deepagent_code.egg-info/requires.txt +11 -0
- deepagent_code-0.1.0/deepagent_code.egg-info/top_level.txt +1 -0
- deepagent_code-0.1.0/pyproject.toml +74 -0
- deepagent_code-0.1.0/setup.cfg +4 -0
- deepagent_code-0.1.0/tests/test_cli.py +67 -0
- deepagent_code-0.1.0/tests/test_utils.py +694 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 langgraph-utils-cli contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: deepagent-code
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A Claude Code-style CLI for running LangGraph agents from the terminal
|
|
5
|
+
Author-email: Kedar Dabhadkar <kdabhadk@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/dkedar7/deepagent-code
|
|
8
|
+
Project-URL: Repository, https://github.com/dkedar7/deepagent-code
|
|
9
|
+
Project-URL: Issues, https://github.com/dkedar7/deepagent-code/issues
|
|
10
|
+
Keywords: langgraph,cli,agents,llm,ai,claude-code
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
19
|
+
Requires-Python: >=3.11
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Requires-Dist: langgraph>=0.2.0
|
|
23
|
+
Requires-Dist: click>=8.0.0
|
|
24
|
+
Requires-Dist: python-dotenv
|
|
25
|
+
Requires-Dist: deepagents
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
28
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
29
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
30
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
31
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
32
|
+
Dynamic: license-file
|
|
33
|
+
|
|
34
|
+
# deepagent-code
|
|
35
|
+
|
|
36
|
+
A Claude Code-style CLI for running LangGraph agents from the terminal.
|
|
37
|
+
|
|
38
|
+

|
|
39
|
+
|
|
40
|
+
## Installation
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pip install deepagent-code
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Or install directly from GitHub:
|
|
47
|
+
```bash
|
|
48
|
+
pip install git+https://github.com/dkedar7/deepagent-code.git
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Quick Start
|
|
52
|
+
|
|
53
|
+
Run with the default agent (requires `ANTHROPIC_API_KEY`):
|
|
54
|
+
```bash
|
|
55
|
+
export ANTHROPIC_API_KEY="your_api_key"
|
|
56
|
+
deepagent-code
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Or specify your own agent:
|
|
60
|
+
```bash
|
|
61
|
+
deepagent-code path/to/your_agent.py:graph
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
This launches an interactive conversation loop with your agent.
|
|
65
|
+
|
|
66
|
+
## Usage
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# Use the default agent
|
|
70
|
+
deepagent-code
|
|
71
|
+
|
|
72
|
+
# Specify a custom agent file
|
|
73
|
+
deepagent-code my_agent.py:graph
|
|
74
|
+
|
|
75
|
+
# Use a module path
|
|
76
|
+
deepagent-code mypackage.agents:chatbot
|
|
77
|
+
|
|
78
|
+
# With an initial message
|
|
79
|
+
deepagent-code -m "Hello, agent!"
|
|
80
|
+
|
|
81
|
+
# Non-interactive mode (auto-approve tool calls)
|
|
82
|
+
deepagent-code --no-interactive
|
|
83
|
+
|
|
84
|
+
# Verbose output
|
|
85
|
+
deepagent-code -v
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Commands
|
|
89
|
+
|
|
90
|
+
In the interactive loop:
|
|
91
|
+
- `/q` or `/quit` - Exit
|
|
92
|
+
- `/c` - Clear conversation history
|
|
93
|
+
- `/h` or `/help` - Show help
|
|
94
|
+
|
|
95
|
+
## Environment Variables
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# Agent location (path/to/file.py:variable_name or module:variable)
|
|
99
|
+
export DEEPAGENT_AGENT_SPEC="my_agent.py:graph"
|
|
100
|
+
deepagent-code
|
|
101
|
+
|
|
102
|
+
# Working directory
|
|
103
|
+
export DEEPAGENT_WORKSPACE_ROOT="/path/to/workspace"
|
|
104
|
+
|
|
105
|
+
# Configuration
|
|
106
|
+
export DEEPAGENT_CONFIG='{"configurable": {"thread_id": "1"}}'
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## CLI Options
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
Usage: deepagent-code [OPTIONS] [AGENT_SPEC]
|
|
113
|
+
|
|
114
|
+
Arguments:
|
|
115
|
+
AGENT_SPEC Agent location (path/to/file.py:graph or module:graph)
|
|
116
|
+
|
|
117
|
+
Options:
|
|
118
|
+
-g, --graph-name TEXT Graph variable name (default: "graph")
|
|
119
|
+
-m, --message TEXT Initial message
|
|
120
|
+
-c, --config TEXT Config JSON or file path
|
|
121
|
+
--interactive/--no-interactive Handle interrupts (default: interactive)
|
|
122
|
+
--async-mode/--sync-mode Async streaming (default: sync)
|
|
123
|
+
-v, --verbose Verbose output
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Creating Your Own Agent
|
|
127
|
+
|
|
128
|
+
Your agent file should export a compiled LangGraph graph:
|
|
129
|
+
|
|
130
|
+
```python
|
|
131
|
+
# my_agent.py
|
|
132
|
+
from deepagents import create_deep_agent
|
|
133
|
+
from langgraph.checkpoint.memory import MemorySaver
|
|
134
|
+
|
|
135
|
+
agent = create_deep_agent(
|
|
136
|
+
name="My Agent",
|
|
137
|
+
model="anthropic:claude-sonnet-4-20250514",
|
|
138
|
+
checkpointer=MemorySaver(),
|
|
139
|
+
)
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Then run it:
|
|
143
|
+
```bash
|
|
144
|
+
deepagent-code my_agent.py:agent
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Programmatic Use
|
|
148
|
+
|
|
149
|
+
```python
|
|
150
|
+
from deepagent_code import stream_graph_updates, prepare_agent_input
|
|
151
|
+
|
|
152
|
+
input_data = prepare_agent_input(message="Hello!")
|
|
153
|
+
|
|
154
|
+
for chunk in stream_graph_updates(graph, input_data):
|
|
155
|
+
if chunk.get("chunk"):
|
|
156
|
+
print(chunk["chunk"], end="")
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## License
|
|
160
|
+
|
|
161
|
+
MIT License - see LICENSE file for details.
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# deepagent-code
|
|
2
|
+
|
|
3
|
+
A Claude Code-style CLI for running LangGraph agents from the terminal.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install deepagent-code
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Or install directly from GitHub:
|
|
14
|
+
```bash
|
|
15
|
+
pip install git+https://github.com/dkedar7/deepagent-code.git
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Quick Start
|
|
19
|
+
|
|
20
|
+
Run with the default agent (requires `ANTHROPIC_API_KEY`):
|
|
21
|
+
```bash
|
|
22
|
+
export ANTHROPIC_API_KEY="your_api_key"
|
|
23
|
+
deepagent-code
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Or specify your own agent:
|
|
27
|
+
```bash
|
|
28
|
+
deepagent-code path/to/your_agent.py:graph
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
This launches an interactive conversation loop with your agent.
|
|
32
|
+
|
|
33
|
+
## Usage
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Use the default agent
|
|
37
|
+
deepagent-code
|
|
38
|
+
|
|
39
|
+
# Specify a custom agent file
|
|
40
|
+
deepagent-code my_agent.py:graph
|
|
41
|
+
|
|
42
|
+
# Use a module path
|
|
43
|
+
deepagent-code mypackage.agents:chatbot
|
|
44
|
+
|
|
45
|
+
# With an initial message
|
|
46
|
+
deepagent-code -m "Hello, agent!"
|
|
47
|
+
|
|
48
|
+
# Non-interactive mode (auto-approve tool calls)
|
|
49
|
+
deepagent-code --no-interactive
|
|
50
|
+
|
|
51
|
+
# Verbose output
|
|
52
|
+
deepagent-code -v
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Commands
|
|
56
|
+
|
|
57
|
+
In the interactive loop:
|
|
58
|
+
- `/q` or `/quit` - Exit
|
|
59
|
+
- `/c` - Clear conversation history
|
|
60
|
+
- `/h` or `/help` - Show help
|
|
61
|
+
|
|
62
|
+
## Environment Variables
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# Agent location (path/to/file.py:variable_name or module:variable)
|
|
66
|
+
export DEEPAGENT_AGENT_SPEC="my_agent.py:graph"
|
|
67
|
+
deepagent-code
|
|
68
|
+
|
|
69
|
+
# Working directory
|
|
70
|
+
export DEEPAGENT_WORKSPACE_ROOT="/path/to/workspace"
|
|
71
|
+
|
|
72
|
+
# Configuration
|
|
73
|
+
export DEEPAGENT_CONFIG='{"configurable": {"thread_id": "1"}}'
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## CLI Options
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
Usage: deepagent-code [OPTIONS] [AGENT_SPEC]
|
|
80
|
+
|
|
81
|
+
Arguments:
|
|
82
|
+
AGENT_SPEC Agent location (path/to/file.py:graph or module:graph)
|
|
83
|
+
|
|
84
|
+
Options:
|
|
85
|
+
-g, --graph-name TEXT Graph variable name (default: "graph")
|
|
86
|
+
-m, --message TEXT Initial message
|
|
87
|
+
-c, --config TEXT Config JSON or file path
|
|
88
|
+
--interactive/--no-interactive Handle interrupts (default: interactive)
|
|
89
|
+
--async-mode/--sync-mode Async streaming (default: sync)
|
|
90
|
+
-v, --verbose Verbose output
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Creating Your Own Agent
|
|
94
|
+
|
|
95
|
+
Your agent file should export a compiled LangGraph graph:
|
|
96
|
+
|
|
97
|
+
```python
|
|
98
|
+
# my_agent.py
|
|
99
|
+
from deepagents import create_deep_agent
|
|
100
|
+
from langgraph.checkpoint.memory import MemorySaver
|
|
101
|
+
|
|
102
|
+
agent = create_deep_agent(
|
|
103
|
+
name="My Agent",
|
|
104
|
+
model="anthropic:claude-sonnet-4-20250514",
|
|
105
|
+
checkpointer=MemorySaver(),
|
|
106
|
+
)
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Then run it:
|
|
110
|
+
```bash
|
|
111
|
+
deepagent-code my_agent.py:agent
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Programmatic Use
|
|
115
|
+
|
|
116
|
+
```python
|
|
117
|
+
from deepagent_code import stream_graph_updates, prepare_agent_input
|
|
118
|
+
|
|
119
|
+
input_data = prepare_agent_input(message="Hello!")
|
|
120
|
+
|
|
121
|
+
for chunk in stream_graph_updates(graph, input_data):
|
|
122
|
+
if chunk.get("chunk"):
|
|
123
|
+
print(chunk["chunk"], end="")
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## License
|
|
127
|
+
|
|
128
|
+
MIT License - see LICENSE file for details.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"""
|
|
2
|
+
deepagent_code - A Claude Code-style CLI for running LangGraph agents.
|
|
3
|
+
|
|
4
|
+
This package provides utilities for streaming from LangGraph agents,
|
|
5
|
+
handling interrupts, and running agents from the command line.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from deepagent_code.utils import (
|
|
9
|
+
parse_interrupt_value,
|
|
10
|
+
serialize_action_request,
|
|
11
|
+
serialize_review_config,
|
|
12
|
+
process_interrupt,
|
|
13
|
+
extract_todos_from_content,
|
|
14
|
+
extract_reflection_from_content,
|
|
15
|
+
serialize_tool_calls,
|
|
16
|
+
clean_content_from_tool_dicts,
|
|
17
|
+
process_message_content,
|
|
18
|
+
process_tool_message,
|
|
19
|
+
process_ai_message,
|
|
20
|
+
prepare_agent_input,
|
|
21
|
+
stream_graph_updates,
|
|
22
|
+
resume_graph_from_interrupt,
|
|
23
|
+
astream_graph_updates,
|
|
24
|
+
aresume_graph_from_interrupt,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
__version__ = "0.1.0"
|
|
28
|
+
|
|
29
|
+
__all__ = [
|
|
30
|
+
"parse_interrupt_value",
|
|
31
|
+
"serialize_action_request",
|
|
32
|
+
"serialize_review_config",
|
|
33
|
+
"process_interrupt",
|
|
34
|
+
"extract_todos_from_content",
|
|
35
|
+
"extract_reflection_from_content",
|
|
36
|
+
"serialize_tool_calls",
|
|
37
|
+
"clean_content_from_tool_dicts",
|
|
38
|
+
"process_message_content",
|
|
39
|
+
"process_tool_message",
|
|
40
|
+
"process_ai_message",
|
|
41
|
+
"prepare_agent_input",
|
|
42
|
+
"stream_graph_updates",
|
|
43
|
+
"resume_graph_from_interrupt",
|
|
44
|
+
"astream_graph_updates",
|
|
45
|
+
"aresume_graph_from_interrupt",
|
|
46
|
+
]
|