← Documentation
CLI Tool
Command-line interface for terminal workflows, scripts, and CI/CD pipelines.
Installation
macOS and Linux
curl -fsSL https://iri-ai.com/install.sh | sh
Installs to ~/.local/bin
Windows (PowerShell)
irm https://iri-ai.com/install.ps1 | iex
Run as Administrator
npm
npm install -g @iri-ai/cli
Requires Node.js 18+
Verify installation: iri --version
Authentication
Connect the CLI to your iri AI account:
- Run
iri login - A browser window opens for authentication
- Sign in to your iri AI account
- The browser redirects back and you're logged in
$ iri login
Opening browser for authentication...
Waiting for authorization...
Successfully logged in as username
SSH/Headless Environments
For SSH or headless environments, copy the URL shown and open it in a browser. After signing in, copy the token displayed and paste it in the terminal.
Commands
iri loginConnect to your iri AI accountiri logoutDisconnect from iri AIiri statusCheck login status and current organizationiri orgsList your organizationsiri orgs switch [name]Switch to a different organizationiri savingsView cost savings summaryiri cache clearClear the local response cacheiri proxy startStart the local optimization proxyiri proxy stopStop the proxyIntegration Examples
Start the local proxy and configure your AI tools to use it:
Claude Code
iri proxy start
export ANTHROPIC_BASE_URL=http://localhost:9876/v1
OpenAI Python
import openai
client = openai.OpenAI(
base_url="http://localhost:9876/v1"
)
cURL
curl http://localhost:9876/v1/chat/completions \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{"model": "gpt-4", "messages": [...]}'
Environment Variables
IRI_API_URLOverride the iri AI server URLIRI_PROXY_PORTDefault proxy port (default: 9876)IRI_CONFIG_DIRConfig directory (default: ~/.config/iri-ai)IRI_NO_COLORDisable colored outputTroubleshooting
Command not found: iri
Add ~/.local/bin to your PATH. Restart terminal or run: source ~/.bashrc
Login times out
Ensure browser can reach iri-ai.com. If browser didn't open, manually visit the URL shown.
Port already in use
Another process is using port 9876. Use: iri proxy start --port 9877
How to update
Run the install command again, or: npm update -g @iri-ai/cli