Skip to main content

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.

deepagent-code

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:

  • /q or /quit - Exit
  • /c - Clear conversation history
  • /h or /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

deepagent_code-0.1.1.tar.gz (20.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deepagent_code-0.1.1-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file deepagent_code-0.1.1.tar.gz.

File metadata

  • Download URL: deepagent_code-0.1.1.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.8

File hashes

Hashes for deepagent_code-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8937c876578fe6092931447e24bc8fbb166cd7f80cb1e4ed920c4910a2f4ab6c
MD5 ac71f00264ecf2dffd24475c583d1f02
BLAKE2b-256 5a274709291c1cf9fc68762c2c6db40d057a0edd7b3cc8b75addcbb0d021350d

See more details on using hashes here.

File details

Details for the file deepagent_code-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for deepagent_code-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e5518357629eb6098e6bf6928c9f79e96680df650a2a9f72de4edf6ada3ea17b
MD5 d1fcd3c268af8176e7c9e49ff508db2c
BLAKE2b-256 cc576c4e2f1848080854d292d14ca35643eaa8ff0636fe5f090250e4b1d6d986

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page