A fast, minimal AI coding agent in Rust. Any OpenAI-compatible provider, persistent sessions, skill-based subagents, and sandboxed shell execution.
Disclaimer: This project is actively developed. While it supports any OpenAI-compatible API, not all models have been thoroughly tested.
mlx-community/gemma-4-e4b-it-4bit(Gemma 4) is used as the primary model for development and testing.
# Interactive mode — just start talking
pie
# resume your last conversation in this directory
pie -r # or pie --resume
# Pipe a question
echo "what does src/main.rs do?" | pie --md
# Use a specific model
pie -m mlx-community/gemma-4-e4b-it-4bit- Persistent sessions — conversations saved per directory, resume with
pie -r - Any provider — works with OpenAI, Anthropic, Groq, Ollama, or any OpenAI-compatible API
- Skills & subagents — markdown-based skills from agentskills.io, auto-loaded from queries
- Native Sandboxing — shell commands run with built-in OS isolation (sandbox-exec on macOS, bubblewrap on Linux)
- Streaming TUI — real-time tool calls, markdown rendering, command history
- Scriptable —
--jsonand--mdflags for single-shot mode
# Interactive (default)
pie
# Resume last session
pie -r
# Single-shot output
pie --md "explain this function"
pie --json "list files" # pipe into jq, etc.
# Use a specific skill
pie "/explore summarize this repo"| Input | Action |
|---|---|
<query> |
Ask a question (auto-detects skills) |
/<skill> <query> |
Use a specific skill |
? |
Show help |
Ctrl+C |
Abort stream / quit |
Pie is configured via environment variables, a pie.toml file, or CLI flags.
The fastest way to get started is with environment variables:
export OPENAI_API_KEY="sk-..."
export OPENAI_MODEL="mlx-community/gemma-4-e4b-it-4bit"
export OPENAI_BASE_URL="http://localhost:1234/v1"
# For providers that support Anthropic-compatible endpoints (e.g. zai)
export ANTHROPIC_BASE_URL="https://api.z.ai/api/anthropic"For managing multiple providers or project-specific settings, use pie.toml.
Pie searches for this file in:
~/.pie/pie.toml(Global configuration)./.pie/pie.toml(Project-specific configuration)
For a full list of configuration options, see .pie/pie.toml.example.
default_provider = "local"
[provider.local]
model = "mlx-community/gemma-4-e4b-it-4bit"
base_url = "http://localhost:1234/v1"
api_key = "sk-..."
[provider.zai]
model = "glm-5.1"
base_url = "https://api.z.ai/api/paas/v4/"
anthropic_url = "https://api.z.ai/api/anthropic"
api_key = "..."[agent] max_steps = 25 # Max tool-call iterations per query
To use a specific provider from your config:
```bash
pie -p ollama "how are you?"
| Flag | Description |
|---|---|
-m, --model |
Model name |
--base-url |
API base URL |
--api-key |
API key |
-p, --provider |
Config provider name |
-r, --resume |
Continue last session |
--md |
Markdown output (single-shot) |
--json |
JSON output (single-shot) |
-d, --debug |
Debug logging |
- Sandbox: Configure restrictions in
pie.tomlunder[sandbox]. - Skills: Add custom skills to
.pie/skills/<name>/SKILL.md. - Instructions: Add project-level instructions to
AGENTS.md.
brew tap dineshdb/pie https://github.com/dineshdb/pie
brew install dineshdb/pie/piecargo build --releaseMIT