A Claude Code-style CLI for running LangGraph agents from the terminal
Project description
deepagent-code
A Claude Code-style CLI for running LangGraph agents from the terminal.
Installation
pip install deepagent-code
Or install directly from GitHub:
pip install git+https://github.com/dkedar7/deepagent-code.git
Quick Start
Run with the default agent (requires ANTHROPIC_API_KEY):
export ANTHROPIC_API_KEY="your_api_key"
deepagent-code
Or specify your own agent:
deepagent-code path/to/your_agent.py:graph
This launches an interactive conversation loop with your agent.
Usage
# Use the default agent
deepagent-code
# Specify a custom agent file
deepagent-code my_agent.py:graph
# Use a module path
deepagent-code mypackage.agents:chatbot
# With an initial message
deepagent-code -m "Hello, agent!"
# Non-interactive mode (auto-approve tool calls)
deepagent-code --no-interactive
# Verbose output
deepagent-code -v
Commands
In the interactive loop:
/qor/quit- Exit/c- Clear conversation history/hor/help- Show help
Environment Variables
# Agent location (path/to/file.py:variable_name or module:variable)
export DEEPAGENT_AGENT_SPEC="my_agent.py:graph"
deepagent-code
# Working directory
export DEEPAGENT_WORKSPACE_ROOT="/path/to/workspace"
# Configuration
export DEEPAGENT_CONFIG='{"configurable": {"thread_id": "1"}}'
CLI Options
Usage: deepagent-code [OPTIONS] [AGENT_SPEC]
Arguments:
AGENT_SPEC Agent location (path/to/file.py:graph or module:graph)
Options:
-g, --graph-name TEXT Graph variable name (default: "graph")
-m, --message TEXT Initial message
-c, --config TEXT Config JSON or file path
--interactive/--no-interactive Handle interrupts (default: interactive)
--async-mode/--sync-mode Async streaming (default: sync)
-v, --verbose Verbose output
Creating Your Own Agent
Your agent file should export a compiled LangGraph graph:
# my_agent.py
from deepagents import create_deep_agent
from langgraph.checkpoint.memory import MemorySaver
agent = create_deep_agent(
name="My Agent",
model="anthropic:claude-sonnet-4-20250514",
checkpointer=MemorySaver(),
)
Then run it:
deepagent-code my_agent.py:agent
Programmatic Use
from deepagent_code import stream_graph_updates, prepare_agent_input
input_data = prepare_agent_input(message="Hello!")
for chunk in stream_graph_updates(graph, input_data):
if chunk.get("chunk"):
print(chunk["chunk"], end="")
License
MIT License - see LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file deepagent_code-0.1.0.tar.gz.
File metadata
- Download URL: deepagent_code-0.1.0.tar.gz
- Upload date:
- Size: 20.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22a410fa5eb613519815045d4fdfaf6a2edcdc2e61f3fa355243986aef15a85e
|
|
| MD5 |
2c15a77e6864adabd3af27c6dd8b29ad
|
|
| BLAKE2b-256 |
024291672b131ee1b800192689e403cb3b2764c9456b9ddbe5628d183cd7465f
|
File details
Details for the file deepagent_code-0.1.0-py3-none-any.whl.
File metadata
- Download URL: deepagent_code-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
129b498e4baaa1733bf5cb2695e5f938cc893f2201e30ad6385fb74d2b0c0f2d
|
|
| MD5 |
145b7fe707eadcecdab2231b1d26e939
|
|
| BLAKE2b-256 |
fc6592ec7fc3a760ae9c01097ae636b3827cf8ffaf15f8ee21a2c6edce61d4aa
|