Autonomous AI coding agent for your terminal โ Claude, GPT-4o, Groq, Ollama, and more
Project description
DevPilot ๐
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:
pytestpasses (48 tests, 0 failures)- No new hard dependencies without discussion
- New tools follow the
BaseToolpattern inagent/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
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 devpilot_agentic_cli-1.0.2.tar.gz.
File metadata
- Download URL: devpilot_agentic_cli-1.0.2.tar.gz
- Upload date:
- Size: 65.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59e8ffc6e9a404e3fd6496618732015b5704b1931955af341fd67ec5f4c5f9d5
|
|
| MD5 |
55775c12aa01b05eafbbf266aec683c6
|
|
| BLAKE2b-256 |
8f5302d491c990087ec489c3a62b2beeacf0f7f0f1dc8d32d5668c2b3eb65548
|
File details
Details for the file devpilot_agentic_cli-1.0.2-py3-none-any.whl.
File metadata
- Download URL: devpilot_agentic_cli-1.0.2-py3-none-any.whl
- Upload date:
- Size: 62.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd93ba6191a930b811117f6fd2d0cbad8096a721a8083ac4ae443eb0b66dfdf5
|
|
| MD5 |
ed3845146850cca0faabf4bf59462a0a
|
|
| BLAKE2b-256 |
35e4563052db3c0f88b48eb74a44ab061d78aaf1bea4381f1937a931f5a51207
|