Unix-style CLI for interacting with LLMs. One built-in tool (bash_exec), basic session support, and text embedding.
Note: pai is a thin wrapper around @mariozechner/pi-ai (https://github.com/badlogic/pi-mono/tree/main/packages/ai). Thanks to Mario Zechner for providing this amazing work.
- 20+ providers (OpenAI, Anthropic, Google, GitHub Copilot, Azure, Bedrock, etc.)
- API Key, OAuth, and cloud credential authentication
- Streaming and non-streaming output
- Session files (JSONL) for multi-turn conversations
bash_exectool — LLM can run shell commandsembedcommand — generate text embeddings- Human-readable (default) and machine-parseable (
--json) output
npm install -g @theclawlab/painpm install
npm run build
npm link# Configure a provider
pai model config --add --name openai --provider openai --set apiKey=sk-...
# Set as default
pai model default --name openai
# Chat
pai chat "Hello"
# Generate embeddings
pai model default --embed-provider openai --embed-model text-embedding-3-small
pai embed "hello world" --json| Command | Description |
|---|---|
pai chat [prompt] |
Chat with an LLM (supports tool calling, streaming, sessions) |
pai embed [text] |
Generate text embeddings (single or batch) |
pai model list |
List configured/available providers |
pai model config |
Add, update, delete, or show provider configuration |
pai model default |
View or set default provider and embedding model |
pai model login |
Interactive OAuth login for supported providers |
- USAGE.md — Full usage guide with all providers, options, and examples