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, 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. Works in PowerShell, CMD, and any modern terminal.

โ”Œโ”€ 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 ~/.devpilot/.env 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-7, claude-opus-4-5-20251101, claude-sonnet-4-5-20250929, claude-haiku-4-5-20251001 console.anthropic.com
OpenAI gpt-5.5, gpt-5.4, gpt-5.4-mini, gpt-5.4-nano platform.openai.com
Groq llama-3.3-70b-versatile, llama-4-scout-17b, qwen3-32b console.groq.com
Together AI Llama 4 Maverick/Scout, Llama 3.3 70B Turbo api.together.xyz
Mistral AI mistral-large-latest, mistral-small-latest, codestral-latest console.mistral.ai
Ollama qwen2.5-coder:7b, deepseek-coder-v2:16b, llama3.3:70b โ€” no API key needed ollama.com
Other Any OpenAI-compatible endpoint โ€”

Configuration

All settings live in ~/.devpilot/.env โ€” a persistent file in your home directory that works regardless of which folder you run devpilot from. 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
GROQ_API_KEY โ€” API key for Groq (optional โ€” can reuse as OPENAI_API_KEY)
DEVPILOT_PROVIDER anthropic anthropic or openai
DEVPILOT_MODEL claude-opus-4-5-20251101 Model name
DEVPILOT_BASE_URL โ€” Custom endpoint, e.g. https://api.groq.com/openai/v1
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  โ†’  ~/.devpilot/.env  โ†’  defaults

Per-run override example:

DEVPILOT_MODEL=llama-3.3-70b-versatile 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 project 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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

devpilot_agentic_cli-1.0.4-py3-none-any.whl (66.5 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for devpilot_agentic_cli-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5a2918c67f0c39e2b91c71da0bde32b834966e8a1c340dc1f7a0a85bb35c2858
MD5 0e4ebb73b65e8d278699a1a009433fe4
BLAKE2b-256 bf4818a9c7cae404e6dbc4b291f4acbb23742fcf7debd13af0e328c6c0c16866

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