Docs
Docs /Prism AI /CLI integration
Prism AIDesktop

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.

Settings → AI Features → AI Providers
Use Your Existing SubscriptionsRun locally via CLI. Your data never leaves your machine.
Claude CodeUses your Claude Pro / Max subscription · Authenticated
OpenAI CodexUses your ChatGPT Plus / Pro subscription · Not authenticated
Gemini CLIUses your Google One AI Premium subscription · Install
GitHub CopilotUses your GitHub Copilot subscription · Install
Cursor CLIUses your Cursor Pro subscription · Install
Enabled CLIs appear in the model dropdown under Your Subscriptions.
  • The 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

ProviderBinaryInstall
Claude Codeclaudenpm install -g @anthropic-ai/claude-code
OpenAI Codexcodexnpm install -g @openai/codex
Gemini CLIgemininpm install -g @google/gemini-cli
GitHub Copilotcopilotnpm install -g @github/copilot
Cursor CLIcursor-agentcurl 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.
npm install -g @anthropic-ai/claude-code
claude          # follow the login prompt, then exit
which claude    # must print a path
  1. 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.

  2. 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 desktop app spawns the CLI as a child process for each request, streams its output into the panel, and executes the agent’s tools locally (schema lookups, dry runs, tab edits) the same way it does with the cloud provider. The modes and approval cards work unchanged. Only allow-listed binaries are launched, and the process is cancelled when you press Stop or close the conversation.

What leaves your machine is what the CLI sends to its vendor: your prompt, the attached context, tool results. Querylab.io’s servers don’t see it. Conversations are still 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 makes one minimal request to check it, then stores it in the OS keychain. The app never shows it again, only its last four characters and a Remove button. Requests are proxied by 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. OpenAI and Google AI key fields exist but those providers aren’t wired up yet.

Cloud or CLI

Querylab.io CloudCLI or your own key
SetupSign inInstall a CLI and sign in to it, or paste a key
BillingCredits from your planYour vendor subscription or API usage
Data pathThrough Querylab.io’s relayMachine → vendor
Model choiceThe cloud list, or AutoWhatever the CLI offers
Conversation resumeAny deviceThis machine

Troubleshooting

Not detected. which claude (or codex, gemini, copilot, cursor-agent) must print a path in a fresh terminal. The app sources your login shell’s rc files to build PATH, so a tool installed via a version manager you only initialise in some shells may be invisible — put the export in .zprofile or .profile. On Windows the app also checks the npm global directory (%APPDATA%\npm).

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:

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.