mirror of
https://github.com/sw7ft/pi-agent.git
synced 2026-07-20 03:13:21 +01:00
Python CLI coding agent with Textual TUI, LLM backends, and ACP support
- Python 100%
|
|
||
|---|---|---|
| pi_agent.py | ||
| README.md | ||
| requirements.txt | ||
pi-agent
Terminal coding assistant (pyAgent): Textual UI, pluggable chat-completions backends (Ollama, OpenAI-compatible APIs, and more), optional ACP HTTP server.
Security: This repository does not ship any API keys. Keys are stored only in a local SQLite database on your machine after you configure them inside the app.
Requirements
- Python 3.10+ (uses modern type syntax)
- A running LLM endpoint unless you only want to try fallback mode (for example Ollama on
http://localhost:11434)
Install
From the repository root:
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
Start
Interactive UI (default):
python pi_agent.py
Run this from the project or directory you want the agent to use as its working directory; file tools are relative to that folder.
One-shot prompt (no UI):
python pi_agent.py --run "list the files here"
ACP server (JSON-RPC agent, other tools can call it):
python pi_agent.py --serve --host 0.0.0.0 --port 8080
Optional: set where config and logs live (default is ~/.pyagent):
export PYAGENT_DIR="$HOME/.pyagent"
python pi_agent.py
First-time model setup
- Start the TUI:
python pi_agent.py - Type
/helpfor commands. - If you use Ollama, run Ollama locally, then try
/model scanor/model add ollama/qwen2.5-coder(see/model addfor presets). - For OpenAI (or compatible) endpoints, add a preset with
/model add, then set the key with/model key <id> <your-key>(the key is stored in your local DB only, not in this repo).
Database override
python pi_agent.py --db /path/to/custom.db