# CLI integration > On the desktop app, Prism AI can run through an AI CLI you already have (Claude Code, Codex, Gemini CLI, Copilot, or Cursor) on the subscription you already pay for, or on your own API key. Prompts and schema go from your machine to the vendor; Querylab.io's backend is not in the path. Source: https://docs.querylab.io/prism-ai/cli-integration/ **Settings → AI Features → AI Providers** - Claude Code (selected): Uses your Claude Pro / Max subscription · Authenticated - OpenAI Codex: Uses your ChatGPT Plus / Pro subscription · Not authenticated - Gemini CLI: Uses your Google One AI Premium subscription · Install - GitHub Copilot: Uses your GitHub Copilot subscription · Install - Cursor CLI: Uses your Cursor Pro subscription · Install Enabled CLIs appear in the model dropdown under Your Subscriptions. - The [desktop app](https://docs.querylab.io/desktop-app/); in the browser this section says *CLI providers are only available in the desktop app* - The CLI installed and on your login shell's `PATH` - Signed in to the CLI once, in a terminal ## Supported CLIs | Provider | Binary | Install | | -------------- | -------------- | ---------------------------------------------- | | Claude Code | `claude` | `npm install -g @anthropic-ai/claude-code` | | OpenAI Codex | `codex` | `npm install -g @openai/codex` | | Gemini CLI | `gemini` | `npm install -g @google/gemini-cli` | | GitHub Copilot | `copilot` | `npm install -g @github/copilot` | | Cursor CLI | `cursor-agent` | `curl https://cursor.com/install -fsS \| bash` | Each row's **Install** link opens the vendor's own instructions. Copilot is the standalone `copilot` binary, not the `gh copilot` extension. ## Setting up a CLI provider 1. Install one of the CLIs and run it once in a terminal to sign in. The app never asks for a vendor API key. ```bash npm install -g @anthropic-ai/claude-code claude # follow the login prompt, then exit which claude # must print a path ``` 2. In Querylab.io open Settings → AI Features → **AI Providers**. The app looks for each binary on your `PATH` when the section opens; the refresh icon (**Refresh CLI detection**) runs the check again after you install something. Each detected CLI shows **Authenticated** or **Not authenticated**. 3. Switch the provider on. It joins the model dropdown in the chat input under **Your Subscriptions**, with the models that CLI reports. Pick one and start a new conversation; the model can't change mid-conversation. The panel then shows a provider badge instead of the credit counter: CLI conversations don't consume Querylab.io credits. ## How it runs The [modes](https://docs.querylab.io/prism-ai/modes/) and approval cards work the same as with the cloud provider. **Stop** cancels the run. What leaves your machine is what the CLI sends to its vendor: your prompt, the attached context, tool results. Conversations are stored locally in the app. ## Your own API key The same settings section has **Bring Your Own Key**. Paste an **Anthropic API key**; **Validate & Save** checks the key and stores it in your OS keychain, and **Remove** deletes it. Requests go from the desktop app straight to the vendor, so the data path is the same as with a CLI, and the panel shows a **BYOK** badge in place of the credit counter. ## Cloud or CLI | | Querylab.io Cloud | CLI or your own key | | ------------------- | ----------------------------------- | ----------------------------------------------- | | Setup | Sign in | Install a CLI and sign in to it, or paste a key | | Billing | Credits from your monthly allowance | Your vendor subscription or API usage | | Data path | Through Querylab.io's relay | Machine → vendor | | Model choice | The cloud list, or Auto | Whatever the CLI offers | | Conversation resume | Any device | This machine | ## Troubleshooting **Not detected.** `which claude` (or `codex`, `gemini`, `copilot`, `cursor-agent`) must print a path in a fresh terminal. If it works in a terminal but not here, put the PATH export in `.zprofile` or `.profile`. **Not authenticated.** The panel error offers **Open Terminal to Login**. Sign in through the CLI itself, then refresh detection. **No models listed.** The app asks each CLI for its model list; an old CLI may not answer. Update it and refresh: ```bash npm update -g @anthropic-ai/claude-code ``` **Permission prompts inside the CLI.** Some CLIs ask before allowing tool use. Approve in the terminal, or configure the CLI's own auto-approval; Querylab.io's mode selector governs the Querylab.io side only.