deepagent-code 0.1.4__tar.gz → 0.1.5__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.4 → deepagent_code-0.1.5}/PKG-INFO +14 -10
- {deepagent_code-0.1.4 → deepagent_code-0.1.5}/README.md +13 -9
- {deepagent_code-0.1.4 → deepagent_code-0.1.5}/deepagent_code/cli.py +47 -11
- {deepagent_code-0.1.4 → deepagent_code-0.1.5}/deepagent_code.egg-info/PKG-INFO +14 -10
- {deepagent_code-0.1.4 → deepagent_code-0.1.5}/pyproject.toml +1 -1
- {deepagent_code-0.1.4 → deepagent_code-0.1.5}/LICENSE +0 -0
- {deepagent_code-0.1.4 → deepagent_code-0.1.5}/deepagent_code/__init__.py +0 -0
- {deepagent_code-0.1.4 → deepagent_code-0.1.5}/deepagent_code/utils.py +0 -0
- {deepagent_code-0.1.4 → deepagent_code-0.1.5}/deepagent_code.egg-info/SOURCES.txt +0 -0
- {deepagent_code-0.1.4 → deepagent_code-0.1.5}/deepagent_code.egg-info/dependency_links.txt +0 -0
- {deepagent_code-0.1.4 → deepagent_code-0.1.5}/deepagent_code.egg-info/entry_points.txt +0 -0
- {deepagent_code-0.1.4 → deepagent_code-0.1.5}/deepagent_code.egg-info/requires.txt +0 -0
- {deepagent_code-0.1.4 → deepagent_code-0.1.5}/deepagent_code.egg-info/top_level.txt +0 -0
- {deepagent_code-0.1.4 → deepagent_code-0.1.5}/setup.cfg +0 -0
- {deepagent_code-0.1.4 → deepagent_code-0.1.5}/tests/test_cli.py +0 -0
- {deepagent_code-0.1.4 → deepagent_code-0.1.5}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: deepagent-code
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.5
|
|
4
4
|
Summary: A Claude Code-style CLI for running LangGraph agents from the terminal
|
|
5
5
|
Author-email: Kedar Dabhadkar <kdabhadk@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -57,7 +57,7 @@ deepagent-code
|
|
|
57
57
|
|
|
58
58
|
Or specify your own agent:
|
|
59
59
|
```bash
|
|
60
|
-
deepagent-code path/to/your_agent.py:graph
|
|
60
|
+
deepagent-code -a path/to/your_agent.py:graph
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
This launches an interactive conversation loop with your agent.
|
|
@@ -68,14 +68,17 @@ This launches an interactive conversation loop with your agent.
|
|
|
68
68
|
# Use the default agent
|
|
69
69
|
deepagent-code
|
|
70
70
|
|
|
71
|
+
# Send a message directly
|
|
72
|
+
deepagent-code "Hello, agent!"
|
|
73
|
+
|
|
71
74
|
# Specify a custom agent file
|
|
72
|
-
deepagent-code my_agent.py:graph
|
|
75
|
+
deepagent-code -a my_agent.py:graph
|
|
73
76
|
|
|
74
77
|
# Use a module path
|
|
75
|
-
deepagent-code mypackage.agents:chatbot
|
|
78
|
+
deepagent-code -a mypackage.agents:chatbot
|
|
76
79
|
|
|
77
|
-
#
|
|
78
|
-
deepagent-code -
|
|
80
|
+
# Read message from a file
|
|
81
|
+
deepagent-code -f ./prompt.md
|
|
79
82
|
|
|
80
83
|
# Non-interactive mode (auto-approve tool calls)
|
|
81
84
|
deepagent-code --no-interactive
|
|
@@ -108,14 +111,15 @@ export DEEPAGENT_CONFIG='{"configurable": {"thread_id": "1"}}'
|
|
|
108
111
|
## CLI Options
|
|
109
112
|
|
|
110
113
|
```
|
|
111
|
-
Usage: deepagent-code [OPTIONS] [
|
|
114
|
+
Usage: deepagent-code [OPTIONS] [MESSAGE]
|
|
112
115
|
|
|
113
116
|
Arguments:
|
|
114
|
-
|
|
117
|
+
MESSAGE Optional input to send to the agent immediately
|
|
115
118
|
|
|
116
119
|
Options:
|
|
120
|
+
-a, --agent TEXT Agent spec (path/to/file.py:graph or module:graph)
|
|
117
121
|
-g, --graph-name TEXT Graph variable name (default: "graph")
|
|
118
|
-
-
|
|
122
|
+
-f, --file PATH Read message from a file (any extension)
|
|
119
123
|
-c, --config TEXT Config JSON or file path
|
|
120
124
|
--interactive/--no-interactive Handle interrupts (default: interactive)
|
|
121
125
|
--async-mode/--sync-mode Async streaming (default: sync)
|
|
@@ -140,7 +144,7 @@ agent = create_deep_agent(
|
|
|
140
144
|
|
|
141
145
|
Then run it:
|
|
142
146
|
```bash
|
|
143
|
-
deepagent-code my_agent.py:agent
|
|
147
|
+
deepagent-code -a my_agent.py:agent
|
|
144
148
|
```
|
|
145
149
|
|
|
146
150
|
## Programmatic Use
|
|
@@ -25,7 +25,7 @@ deepagent-code
|
|
|
25
25
|
|
|
26
26
|
Or specify your own agent:
|
|
27
27
|
```bash
|
|
28
|
-
deepagent-code path/to/your_agent.py:graph
|
|
28
|
+
deepagent-code -a path/to/your_agent.py:graph
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
This launches an interactive conversation loop with your agent.
|
|
@@ -36,14 +36,17 @@ This launches an interactive conversation loop with your agent.
|
|
|
36
36
|
# Use the default agent
|
|
37
37
|
deepagent-code
|
|
38
38
|
|
|
39
|
+
# Send a message directly
|
|
40
|
+
deepagent-code "Hello, agent!"
|
|
41
|
+
|
|
39
42
|
# Specify a custom agent file
|
|
40
|
-
deepagent-code my_agent.py:graph
|
|
43
|
+
deepagent-code -a my_agent.py:graph
|
|
41
44
|
|
|
42
45
|
# Use a module path
|
|
43
|
-
deepagent-code mypackage.agents:chatbot
|
|
46
|
+
deepagent-code -a mypackage.agents:chatbot
|
|
44
47
|
|
|
45
|
-
#
|
|
46
|
-
deepagent-code -
|
|
48
|
+
# Read message from a file
|
|
49
|
+
deepagent-code -f ./prompt.md
|
|
47
50
|
|
|
48
51
|
# Non-interactive mode (auto-approve tool calls)
|
|
49
52
|
deepagent-code --no-interactive
|
|
@@ -76,14 +79,15 @@ export DEEPAGENT_CONFIG='{"configurable": {"thread_id": "1"}}'
|
|
|
76
79
|
## CLI Options
|
|
77
80
|
|
|
78
81
|
```
|
|
79
|
-
Usage: deepagent-code [OPTIONS] [
|
|
82
|
+
Usage: deepagent-code [OPTIONS] [MESSAGE]
|
|
80
83
|
|
|
81
84
|
Arguments:
|
|
82
|
-
|
|
85
|
+
MESSAGE Optional input to send to the agent immediately
|
|
83
86
|
|
|
84
87
|
Options:
|
|
88
|
+
-a, --agent TEXT Agent spec (path/to/file.py:graph or module:graph)
|
|
85
89
|
-g, --graph-name TEXT Graph variable name (default: "graph")
|
|
86
|
-
-
|
|
90
|
+
-f, --file PATH Read message from a file (any extension)
|
|
87
91
|
-c, --config TEXT Config JSON or file path
|
|
88
92
|
--interactive/--no-interactive Handle interrupts (default: interactive)
|
|
89
93
|
--async-mode/--sync-mode Async streaming (default: sync)
|
|
@@ -108,7 +112,7 @@ agent = create_deep_agent(
|
|
|
108
112
|
|
|
109
113
|
Then run it:
|
|
110
114
|
```bash
|
|
111
|
-
deepagent-code my_agent.py:agent
|
|
115
|
+
deepagent-code -a my_agent.py:agent
|
|
112
116
|
```
|
|
113
117
|
|
|
114
118
|
## Programmatic Use
|
|
@@ -54,7 +54,7 @@ SPINNER_FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇",
|
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
# Version info
|
|
57
|
-
__version__ = "0.1.
|
|
57
|
+
__version__ = "0.1.5"
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
# Slash command registry
|
|
@@ -1202,10 +1202,13 @@ def run_conversation_loop(
|
|
|
1202
1202
|
verbose: bool = False,
|
|
1203
1203
|
stream_mode: str = "updates",
|
|
1204
1204
|
initial_message: Optional[str] = None,
|
|
1205
|
+
single_shot: bool = False,
|
|
1205
1206
|
):
|
|
1206
1207
|
"""
|
|
1207
1208
|
Run a continuous conversation loop with the LangGraph agent.
|
|
1208
1209
|
Styled after Claude Code / nanocode.
|
|
1210
|
+
|
|
1211
|
+
If single_shot is True and initial_message is provided, exit after processing.
|
|
1209
1212
|
"""
|
|
1210
1213
|
# Set up tab completion for slash commands
|
|
1211
1214
|
setup_readline_completion()
|
|
@@ -1242,6 +1245,10 @@ def run_conversation_loop(
|
|
|
1242
1245
|
print_timing(duration, verbose)
|
|
1243
1246
|
print()
|
|
1244
1247
|
|
|
1248
|
+
# Exit after single-shot execution
|
|
1249
|
+
if single_shot:
|
|
1250
|
+
return
|
|
1251
|
+
|
|
1245
1252
|
# Main conversation loop
|
|
1246
1253
|
while True:
|
|
1247
1254
|
try:
|
|
@@ -1322,16 +1329,24 @@ def run_conversation_loop(
|
|
|
1322
1329
|
|
|
1323
1330
|
|
|
1324
1331
|
@click.command()
|
|
1325
|
-
@click.argument("
|
|
1332
|
+
@click.argument("message", required=False)
|
|
1333
|
+
@click.option(
|
|
1334
|
+
"--agent",
|
|
1335
|
+
"-a",
|
|
1336
|
+
"agent_spec",
|
|
1337
|
+
help="Agent spec: path/to/file.py, path/to/file.py:graph, or module.path:graph",
|
|
1338
|
+
)
|
|
1326
1339
|
@click.option(
|
|
1327
1340
|
"--graph-name",
|
|
1328
1341
|
"-g",
|
|
1329
1342
|
help="Name of the graph variable (default: 'graph', overridden if spec includes :name)",
|
|
1330
1343
|
)
|
|
1331
1344
|
@click.option(
|
|
1332
|
-
"--
|
|
1333
|
-
"-
|
|
1334
|
-
|
|
1345
|
+
"--file",
|
|
1346
|
+
"-f",
|
|
1347
|
+
"prompt_file",
|
|
1348
|
+
type=click.Path(exists=True),
|
|
1349
|
+
help="Read input message from a file (any extension)",
|
|
1335
1350
|
)
|
|
1336
1351
|
@click.option(
|
|
1337
1352
|
"--config",
|
|
@@ -1360,9 +1375,10 @@ def run_conversation_loop(
|
|
|
1360
1375
|
help="Show verbose output including node names",
|
|
1361
1376
|
)
|
|
1362
1377
|
def main(
|
|
1378
|
+
message: Optional[str],
|
|
1363
1379
|
agent_spec: Optional[str],
|
|
1364
1380
|
graph_name: Optional[str],
|
|
1365
|
-
|
|
1381
|
+
prompt_file: Optional[str],
|
|
1366
1382
|
config: Optional[str],
|
|
1367
1383
|
interactive: bool,
|
|
1368
1384
|
use_async: bool,
|
|
@@ -1372,7 +1388,9 @@ def main(
|
|
|
1372
1388
|
"""
|
|
1373
1389
|
Run a LangGraph agent from the command line.
|
|
1374
1390
|
|
|
1375
|
-
|
|
1391
|
+
MESSAGE is an optional input to send to the agent immediately.
|
|
1392
|
+
|
|
1393
|
+
Agent spec (-a/--agent) can be:
|
|
1376
1394
|
\b
|
|
1377
1395
|
- path/to/file.py (uses default graph name 'graph')
|
|
1378
1396
|
- path/to/file.py:agent (specifies graph variable name)
|
|
@@ -1391,12 +1409,28 @@ def main(
|
|
|
1391
1409
|
|
|
1392
1410
|
\b
|
|
1393
1411
|
Examples:
|
|
1394
|
-
deepagent-code
|
|
1395
|
-
deepagent-code my_agent.py
|
|
1396
|
-
deepagent-code
|
|
1397
|
-
deepagent-code -
|
|
1412
|
+
deepagent-code "Hello, agent!"
|
|
1413
|
+
deepagent-code -a my_agent.py "What can you do?"
|
|
1414
|
+
deepagent-code -a my_agent.py:graph
|
|
1415
|
+
deepagent-code -f ./prompt.md
|
|
1398
1416
|
"""
|
|
1399
1417
|
try:
|
|
1418
|
+
# Handle -f/--file option: read message from file
|
|
1419
|
+
if prompt_file and message:
|
|
1420
|
+
print(f"{RED}⏺ Error: Cannot use both MESSAGE argument and -f/--file option{RESET}")
|
|
1421
|
+
sys.exit(1)
|
|
1422
|
+
|
|
1423
|
+
if prompt_file:
|
|
1424
|
+
try:
|
|
1425
|
+
with open(prompt_file, 'r', encoding='utf-8') as f:
|
|
1426
|
+
message = f.read().strip()
|
|
1427
|
+
if not message:
|
|
1428
|
+
print(f"{RED}⏺ Error: File '{prompt_file}' is empty{RESET}")
|
|
1429
|
+
sys.exit(1)
|
|
1430
|
+
except Exception as e:
|
|
1431
|
+
print(f"{RED}⏺ Error reading file '{prompt_file}': {e}{RESET}")
|
|
1432
|
+
sys.exit(1)
|
|
1433
|
+
|
|
1400
1434
|
# Get environment variables (DEEPAGENT_SPEC preferred, DEEPAGENT_AGENT_SPEC for backwards compat)
|
|
1401
1435
|
env_agent_spec = os.getenv('DEEPAGENT_SPEC') or os.getenv('DEEPAGENT_AGENT_SPEC')
|
|
1402
1436
|
env_workspace_root = os.getenv('DEEPAGENT_WORKSPACE_ROOT')
|
|
@@ -1465,6 +1499,7 @@ def main(
|
|
|
1465
1499
|
agent_description = get_agent_description(graph)
|
|
1466
1500
|
|
|
1467
1501
|
# Run the conversation loop
|
|
1502
|
+
# Single-shot mode: exit after processing if message was provided via CLI
|
|
1468
1503
|
run_conversation_loop(
|
|
1469
1504
|
graph=graph,
|
|
1470
1505
|
config=config_dict,
|
|
@@ -1475,6 +1510,7 @@ def main(
|
|
|
1475
1510
|
verbose=verbose,
|
|
1476
1511
|
stream_mode=final_stream_mode,
|
|
1477
1512
|
initial_message=message,
|
|
1513
|
+
single_shot=bool(message),
|
|
1478
1514
|
)
|
|
1479
1515
|
|
|
1480
1516
|
except FileNotFoundError as e:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: deepagent-code
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.5
|
|
4
4
|
Summary: A Claude Code-style CLI for running LangGraph agents from the terminal
|
|
5
5
|
Author-email: Kedar Dabhadkar <kdabhadk@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -57,7 +57,7 @@ deepagent-code
|
|
|
57
57
|
|
|
58
58
|
Or specify your own agent:
|
|
59
59
|
```bash
|
|
60
|
-
deepagent-code path/to/your_agent.py:graph
|
|
60
|
+
deepagent-code -a path/to/your_agent.py:graph
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
This launches an interactive conversation loop with your agent.
|
|
@@ -68,14 +68,17 @@ This launches an interactive conversation loop with your agent.
|
|
|
68
68
|
# Use the default agent
|
|
69
69
|
deepagent-code
|
|
70
70
|
|
|
71
|
+
# Send a message directly
|
|
72
|
+
deepagent-code "Hello, agent!"
|
|
73
|
+
|
|
71
74
|
# Specify a custom agent file
|
|
72
|
-
deepagent-code my_agent.py:graph
|
|
75
|
+
deepagent-code -a my_agent.py:graph
|
|
73
76
|
|
|
74
77
|
# Use a module path
|
|
75
|
-
deepagent-code mypackage.agents:chatbot
|
|
78
|
+
deepagent-code -a mypackage.agents:chatbot
|
|
76
79
|
|
|
77
|
-
#
|
|
78
|
-
deepagent-code -
|
|
80
|
+
# Read message from a file
|
|
81
|
+
deepagent-code -f ./prompt.md
|
|
79
82
|
|
|
80
83
|
# Non-interactive mode (auto-approve tool calls)
|
|
81
84
|
deepagent-code --no-interactive
|
|
@@ -108,14 +111,15 @@ export DEEPAGENT_CONFIG='{"configurable": {"thread_id": "1"}}'
|
|
|
108
111
|
## CLI Options
|
|
109
112
|
|
|
110
113
|
```
|
|
111
|
-
Usage: deepagent-code [OPTIONS] [
|
|
114
|
+
Usage: deepagent-code [OPTIONS] [MESSAGE]
|
|
112
115
|
|
|
113
116
|
Arguments:
|
|
114
|
-
|
|
117
|
+
MESSAGE Optional input to send to the agent immediately
|
|
115
118
|
|
|
116
119
|
Options:
|
|
120
|
+
-a, --agent TEXT Agent spec (path/to/file.py:graph or module:graph)
|
|
117
121
|
-g, --graph-name TEXT Graph variable name (default: "graph")
|
|
118
|
-
-
|
|
122
|
+
-f, --file PATH Read message from a file (any extension)
|
|
119
123
|
-c, --config TEXT Config JSON or file path
|
|
120
124
|
--interactive/--no-interactive Handle interrupts (default: interactive)
|
|
121
125
|
--async-mode/--sync-mode Async streaming (default: sync)
|
|
@@ -140,7 +144,7 @@ agent = create_deep_agent(
|
|
|
140
144
|
|
|
141
145
|
Then run it:
|
|
142
146
|
```bash
|
|
143
|
-
deepagent-code my_agent.py:agent
|
|
147
|
+
deepagent-code -a my_agent.py:agent
|
|
144
148
|
```
|
|
145
149
|
|
|
146
150
|
## Programmatic Use
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|