Skip to main content

Autonomous AI coding agent for your terminal โ€” Claude, GPT-4o, Groq, Ollama, and more

Project description

DevPilot ๐Ÿš€

PyPI Python License: MIT

An autonomous AI coding agent for your terminal. DevPilot gives Claude, GPT-4o, Groq, Mistral, or any local model a full suite of tools โ€” file read/write, bash execution, code search, git, MCP, and more โ€” orchestrated into a self-healing agentic loop inside a rich Textual TUI.

โ”Œโ”€ DevPilot โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  โœฆ claude-opus-4-5  โ”‚  agent/tools/fs.py  โ”‚  iteration 2/50    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  You โ€บ Add input validation to the write_file tool              โ”‚
โ”‚                                                                 โ”‚
โ”‚  โ— Calling read_file   agent/tools/fs.py                        โ”‚
โ”‚  โ— Calling edit_file   agent/tools/fs.py                        โ”‚
โ”‚    โœ“ Edited agent/tools/fs.py successfully.                     โ”‚
โ”‚                                                                 โ”‚
โ”‚  Done โ€” added a size cap and path-escape guard. The diff is     โ”‚
โ”‚  above. Want me to run the tests?                               โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Features

Category Capability
File ops read_file, write_file, edit_file (surgical replace), list_files
Shell run_bash with timeout, blocked-command guard, and auto-heal loop
Code search Regex search_code
Pre-flight linting Syntax-checks Python (ast.parse) and JS/TS (node --check) before writing
Git git_status, git_commit with surgical file staging
Documentation doc_gen (markdown), diagram (Mermaid)
Web search web_search via Tavily (optional)

| MCP | Connect any MCP server via mcp_servers.json | | A2A | Agent-to-agent task delegation over HTTP | | Providers | Anthropic, OpenAI, Groq, Together AI, Mistral, Ollama, any OpenAI-compatible endpoint |


Quickstart

Requires Python โ‰ฅ 3.11.

pip install devpilot-agentic-cli
devpilot

That's it. On first run DevPilot launches a setup wizard โ€” pick your provider, enter your API key, choose a model. It saves everything to a .env file and opens the TUI. Every subsequent run starts immediately.

Optional Features

PDF Documentation Generation Enable the generate_docs tool to export PDFs:

pip install devpilot-agentic-cli[pdf]

Note: You also need to install the wkhtmltopdf system binary.


Providers

DevPilot works with any of these out of the box โ€” the setup wizard walks you through each one:

Provider Models Get API key
Anthropic claude-opus-4-5, claude-sonnet-4-5, claude-haiku-4-5 console.anthropic.com
OpenAI gpt-4o, gpt-4o-mini, o3, o4-mini platform.openai.com
Groq llama-3.3-70b, mixtral-8x7b, gemma2-9b console.groq.com
Together AI Llama 3, Mixtral, and more api.together.xyz
Mistral AI mistral-large, codestral console.mistral.ai
Ollama Any local model โ€” no API key needed ollama.com
Other Any OpenAI-compatible endpoint โ€”

Configuration

All settings live in a .env file in your project directory. The setup wizard creates this on first run. You can edit it manually anytime โ€” or re-run the wizard with devpilot --setup.

Full settings reference

Variable Default Description
ANTHROPIC_API_KEY โ€” API key for Anthropic provider
OPENAI_API_KEY โ€” API key for OpenAI / Groq / Together / Mistral / Ollama
DEVPILOT_PROVIDER anthropic anthropic or openai
DEVPILOT_MODEL claude-opus-4-5 Model name
DEVPILOT_BASE_URL โ€” Custom endpoint, e.g. http://localhost:11434/v1 for Ollama
DEVPILOT_NO_CONFIRM false Skip confirmation prompts (useful for CI)
DEVPILOT_MAX_ITERATIONS 50 Max tool-use iterations before loop aborts
DEVPILOT_WORKDIR cwd Root directory for file operations
DEVPILOT_SESSIONS_DIR .devpilot_sessions Where session JSON files are saved
DEVPILOT_THINKING false Enable extended thinking (Claude only)
DEVPILOT_THINKING_BUDGET 10000 Token budget for extended thinking

Override priority

CLI flags  โ†’  env vars  โ†’  .env file  โ†’  defaults

Per-run override example:

DEVPILOT_MODEL=claude-haiku-4-5-20251101 devpilot --task "fix typos"

CLI Reference

devpilot [OPTIONS]

Options:
  --provider {anthropic,openai}   Model provider
  --model MODEL                   Model name
  --base-url URL                  OpenAI-compatible base URL (e.g. Ollama)
  --no-confirm                    Skip confirmation prompts
  --thinking                      Enable extended thinking (Claude only)
  --thinking-budget N             Token budget for extended thinking (default: 10000)
  --workdir PATH                  Working directory for file operations
  --task TASK                     Run a single task and exit (CI mode)
  --resume SESSION_ID             Resume a previous session
  --a2a-port PORT                 A2A server port (default: 8000)
  --no-a2a                        Disable A2A server
  --no-web-search                 Disable Tavily web search

  --setup                         Re-run the setup wizard

CI / single-task mode

devpilot --task "Run the test suite and fix any failures" --no-confirm

Using Ollama (Local Models)

# Pull and serve a model
ollama pull qwen2.5-coder:7b
ollama serve

# Run devpilot and pick Ollama in the setup wizard
devpilot --setup

Or set env vars directly:

DEVPILOT_PROVIDER=openai \
DEVPILOT_BASE_URL=http://localhost:11434/v1 \
DEVPILOT_MODEL=qwen2.5-coder:7b \
devpilot

MCP Integration

DevPilot connects to any Model Context Protocol server. Edit mcp_servers.json in your project root:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/dir"]
    }
  }
}

Tools from connected MCP servers are automatically available to the agent on startup.


Architecture

agent/
โ”œโ”€โ”€ cli.py                Entry point โ€” args, setup wizard, wires everything
โ”œโ”€โ”€ setup_wizard.py       First-run interactive configuration wizard
โ”œโ”€โ”€ loop.py               Core agentic loop (plan โ†’ act โ†’ verify โ†’ heal)
โ”œโ”€โ”€ config.py             Config dataclass โ€” all settings from env vars
โ”œโ”€โ”€ context.py            RepoContext โ€” file awareness, AST map
โ”œโ”€โ”€ history.py            Conversation history + smart context pruning
โ”œโ”€โ”€ providers/
โ”‚   โ”œโ”€โ”€ anthropic_provider.py
โ”‚   โ”œโ”€โ”€ openai_provider.py
โ”‚   โ”œโ”€โ”€ system_prompt.py  PLANโ†’ACTโ†’VERIFY prompt, platform-aware shell rules
โ”‚   โ””โ”€โ”€ factory.py
โ”œโ”€โ”€ tools/
โ”‚   โ”œโ”€โ”€ fs.py             read_file, write_file (pre-flight lint), edit_file, list_files
โ”‚   โ”œโ”€โ”€ shell.py          run_bash
โ”‚   โ”œโ”€โ”€ search_code.py    regex search
โ”‚   โ”œโ”€โ”€ git_ops.py        git_status, git_commit
โ”‚   โ”œโ”€โ”€ doc_gen.py        doc_gen
โ”‚   โ”œโ”€โ”€ diagram.py        diagram (Mermaid)
โ”‚   โ”œโ”€โ”€ web_search.py     web_search (Tavily)

โ”‚   โ”œโ”€โ”€ a2a.py            A2A delegation
โ”‚   โ””โ”€โ”€ registry.py       ToolRegistry + PermissionGuard
โ””โ”€โ”€ tui/
    โ””โ”€โ”€ app.py            Textual TUI โ€” chat log, project map, tool drawer

Running Tests

pip install devpilot-agentic-cli[dev]
pytest

48 tests โ€” unit tests for every tool plus end-to-end integration tests with a mocked provider.


Development / Contributing

git clone https://github.com/Thijeshpraveen-V/DevPilot
cd DevPilot
pip install -e ".[dev]"
devpilot --setup

PR checklist:

  • pytest passes (48 tests, 0 failures)
  • No new hard dependencies without discussion
  • New tools follow the BaseTool pattern in agent/tools/base.py

License

MIT ยฉ Thijesh Praveen V

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

devpilot_agentic_cli-1.0.0.tar.gz (64.9 kB view details)

Uploaded Source

Built Distribution

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

devpilot_agentic_cli-1.0.0-py3-none-any.whl (61.8 kB view details)

Uploaded Python 3

File details

Details for the file devpilot_agentic_cli-1.0.0.tar.gz.

File metadata

  • Download URL: devpilot_agentic_cli-1.0.0.tar.gz
  • Upload date:
  • Size: 64.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for devpilot_agentic_cli-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f68a81593bb3715d28d52e9f6995b94af6ee48d74ef9e4722ecdf9f73ae7816b
MD5 65429b97ecd6f8b0e6a4bd8d509b75f1
BLAKE2b-256 4ba3a09c051e3be3cfcb13e6cf972235eed90c01078c0c428872a811076ce905

See more details on using hashes here.

File details

Details for the file devpilot_agentic_cli-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for devpilot_agentic_cli-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 881cf9fe13c23247e57b2e40ccd80ab47ba14ea531ffc766b4f285bd7d2ab715
MD5 9191ca32dd20811ac9f58dd2d7be4b12
BLAKE2b-256 950d24ebae573fdeebe241cfa5806500787292cd71d0de79f43b0a9780668fa2

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