Python CLI coding agent with Textual TUI, LLM backends, and ACP support
Find a file
sw7ft 94f3cdb120 Add README with install and startup instructions
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 15:58:56 -07:00
pi_agent.py Initial import: pi agent (pyAgent CLI) 2026-05-15 15:57:16 -07:00
README.md Add README with install and startup instructions 2026-05-15 15:58:56 -07:00
requirements.txt Initial import: pi agent (pyAgent CLI) 2026-05-15 15:57:16 -07:00

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

  1. Start the TUI: python pi_agent.py
  2. Type /help for commands.
  3. If you use Ollama, run Ollama locally, then try /model scan or /model add ollama/qwen2.5-coder (see /model add for presets).
  4. 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