CLI Integration
Use AI coding assistants directly with Querylab.io Desktop for privacy, cost control, and model flexibility.
Desktop app only — CLI integration requires the native macOS app. The web version uses Querylab.io Cloud instead.
Why Use CLI Integration?
| Benefit | Description |
|---|---|
| Privacy | API calls go directly to providers, not through Querylab.io |
| Cost Control | Pay your provider directly, no markup |
| Model Choice | Switch between Claude, GPT, Gemini freely |
| Existing Subscriptions | Use your current AI subscriptions |
| Offline Reliability | Works without Querylab.io backend |
Supported CLI Tools
| Tool | Binary | Installation | Authentication |
|---|---|---|---|
| Claude Code | claude | npm install -g @anthropic-ai/claude-code | claude auth login |
| OpenAI Codex | codex | npm install -g @openai/codex | codex login |
| Google Gemini CLI | gemini | npm install -g @google/gemini-cli | gemini auth login |
| GitHub Copilot CLI | copilot | Included with GitHub CLI (gh extension install github/gh-copilot) | gh auth login |
| Cursor CLI | cursor-agent | Included with Cursor editor | Configured via Cursor app |
Querylab.io auto-detects which CLIs are installed on your system.
Setup
1. Install a CLI Tool
Pick any supported tool and install it:
# Claude Code (Anthropic)
npm install -g @anthropic-ai/claude-code
# OpenAI Codex
npm install -g @openai/codex
# Google Gemini CLI
npm install -g @google/gemini-cli
# GitHub Copilot (via GitHub CLI)
gh extension install github/gh-copilot
2. Authenticate
# Claude Code
claude auth login
# OpenAI Codex
codex login
# Gemini CLI
gemini auth login
# GitHub Copilot
gh auth login
Cursor CLI uses the credentials configured in the Cursor editor — no separate auth step needed.
3. Configure in Querylab.io
- Open Settings > AI Assistant
- Click Detect Installed CLIs — Querylab.io scans your PATH for all supported tools
- Select your preferred CLI from the dropdown
- Choose a model (Querylab.io queries each CLI for available models)
- Save
Auto-Detection
When you click "Detect Installed CLIs", Querylab.io:
- Searches your system PATH for each known binary (
claude,codex,gemini,copilot,cursor-agent) - Checks the version of each found tool
- Verifies authentication status
- Lists available models for each detected CLI
You can install multiple CLIs and switch between them at any time.
CLI vs Backend Provider
| Scenario | Recommendation |
|---|---|
| Maximum privacy | CLI — data stays local |
| Cost optimization | CLI — no markup, use your own keys |
| Simple setup | Backend — just sign in |
| Model experimentation | CLI — easy switching between providers |
| Team sharing | Backend — conversation sync across team |
| Use specific model | CLI — pick exact model per provider |
Troubleshooting
CLI Not Found
Error: 'claude' command not found
Fix: Ensure the CLI is installed and in your PATH:
which claude # Should print the path
which codex # Should print the path
which gemini # Should print the path
If installed but not found, add the install directory to your PATH.
Not Authenticated
Error: CLI not authenticated
Fix: Run the auth command for your CLI:
| Tool | Auth command |
|---|---|
| Claude Code | claude auth login |
| OpenAI Codex | codex login |
| Gemini CLI | gemini auth login |
| GitHub Copilot | gh auth login |
| Cursor | Open Cursor app and sign in |
No Models Listed
If "Detect Installed CLIs" finds the tool but shows no models, try updating the CLI to the latest version:
npm update -g @anthropic-ai/claude-code
Tool Permissions
Some CLIs require explicit tool permissions for Prism AI to execute actions. Approve when prompted or configure auto-approval in the CLI's settings.
Related
- Prism AI Introduction — overview of AI features
- Desktop App — installation and setup
- Local Credentials — how desktop stores tokens