Skip to content
| Marketplace
Sign in
Visual Studio Code>AI>Grok Subscription in Copilot Chat VS CodeNew to Visual Studio Code? Get it now.
Grok Subscription in Copilot Chat VS Code

Grok Subscription in Copilot Chat VS Code

Adrian Francisco Lopez

|
2 installs
| (0) | Free
Use your Grok CLI subscription as a selectable model in VS Code Chat and Agent mode—no xAI API key required.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Grok Subscription in Copilot Chat VS Code

Use your Grok CLI subscription (SuperGrok / X Premium+) as a selectable model in VS Code Chat and Agent mode—no xAI API key required.

Unofficial community project. This extension is not affiliated with, endorsed by, or sponsored by xAI, GitHub, or Microsoft. Grok and xAI are trademarks of their respective owners. GitHub Copilot and Visual Studio Code are trademarks of their respective owners. The extension requires the separately installed official Grok CLI and uses credentials managed by that CLI.

License: MIT VS Code

Why this exists

Approach What you need This extension
Subscription (this project) Official Grok CLI + SuperGrok / X Premium+ login Yes — spawns grok, never asks for an API key
BYOK xAI API key in VS Code / Copilot No — not the goal

Features

  • Selectable Grok models in the Chat model dropdown under Grok (subscription)
  • Ask mode with streamed CLI output
  • Agent mode: Grok selects VS Code tools; VS Code owns approval and execution
  • Official CLI authentication (grok login --device-auth) — no reimplemented OAuth
  • Image input via short-lived private prompt files (not huge command-line base64)
  • Native Thinking Effort selector (Low / Medium / High) when the catalog supports it
  • Diagnostics: Show Status, Show Logs (no prompts, tool args, or tokens)

Compatibility

Platform Status
macOS Maintainer-tested
Windows Path discovery and process args unit-tested; no maintainer Windows desktop for this release (community reports welcome — see docs/WINDOWS_TEST_CHECKLIST.md)
Linux Best-effort / community-supported — PRs welcome
VS Code for the Web Unsupported (cannot spawn a local CLI)
Remote SSH / Codespaces Unsupported until explicitly verified; the extension spawns a local Grok CLI

VS Code: ^1.104.0 (Chat language-model provider APIs)

Prerequisites

  1. VS Code 1.104+
  2. Official Grok CLI installed and signed in once
  3. GitHub Copilot Chat / VS Code Chat available in the editor

Install the official Grok CLI

Follow current official docs: Grok Build overview and CLI reference.

Do not copy or move auth.json between machines. Sign in on each machine with the official CLI.

grok --version
grok login --device-auth

Install this extension

Marketplace (preferred after publication)

  1. Open Extensions in VS Code
  2. Search for Grok Subscription in Copilot Chat VS Code
  3. Install extension ID: adrian-francisco-lopez.grok-vscode-chat

Marketplace auto-updates apply only to Marketplace installs.

GitHub Release / VSIX (fallback)

  1. Download the .vsix and SHA256SUMS.txt from Releases
  2. Verify the checksum
  3. Extensions → ⋯ → Install from VSIX…
code --install-extension ./grok-vscode-chat-<version>.vsix --force

Manual VSIX installs do not receive normal Marketplace auto-updates.

From source

git clone https://github.com/Adrian-Francisco-Lopez/grok-vscode-chat.git
cd grok-vscode-chat
npm ci
npm test
npm run package:vsix

Sign-in and missing credentials

  • Command: Grok Chat: Sign In (CLI) runs grok login --device-auth via a VS Code task (executable + args separate; no shell string injection)
  • The extension only checks that the local CLI auth file exists and parses as non-empty JSON — it does not extract, copy, log, or use token values
  • On a real chat request without credentials, you get clear guidance to sign in; silent model discovery does not spam UI

Usage

Ask mode

  1. Open Chat
  2. Model dropdown → Grok (subscription) → pick a model (e.g. Grok 4.5)
  3. Optionally set Thinking Effort
  4. Ask a question; responses stream from the CLI

Agent mode

  1. Switch Chat to Agent
  2. Select the same Grok subscription model
  3. Grok returns tool selections; VS Code shows approvals and runs tools
  4. The Grok CLI’s own tools stay disabled (deny-list + empty-by-intersection allowlist)

Commands

Command Purpose
Grok Chat: Manage / Sign In Status, sign-in, open chat
Grok Chat: Sign In (CLI) Official device-auth login
Grok Chat: Show Status CLI path, version, login, models
Grok Chat: Show Logs Bridge diagnostics (no prompts/tokens)
Grok Chat: Set Reasoning Effort Fallback when native selector is unavailable
Grok Chat: Open Subscription Usage Opens the official Grok usage page

Settings

Setting Default Meaning
grokChat.cliPath (auto) Explicit path to grok / grok.exe (user-authorized override)
grokChat.defaultModel grok-4.5 Fallback model id if the cache is empty
grokChat.reasoningEffort auto Compatibility fallback; native model control wins when present
grokChat.maxTurns 0 Optional Ask-mode CLI turn cap; 0 = unlimited (CLI native)
grokChat.agentDecisionMaxTurns 0 Optional cap for one Agent decision; 0 = unlimited

Security and privacy

  • No extension telemetry
  • No extension-owned credential storage
  • Never place auth.json, tokens, or session dumps in issues or PRs
  • CLI is spawned with argument arrays and shell: false
  • See PRIVACY.md and SECURITY.md

Local session storage (Grok CLI)

The official CLI may store normal local session history under the user’s Grok data directory. That data is owned by the CLI, not this extension.

Troubleshooting

See docs/TROUBLESHOOTING.md.

Known limitations

  • Agent tool-selection steps are schema-constrained and can take longer than streamed Ask replies
  • VS Code owns the multi-step tool loop. Tool-call steps intentionally contain no permanent Thinking... text; the request spinner indicates work while Grok chooses the next action.
  • Terminal-card expanders and image/tool-result previews (including Save buttons) are rendered by VS Code/Copilot Chat and can exhibit workbench UI issues in very long chats.
  • Token counts are estimates (~4 characters/token + fixed image estimate)
  • First reply may wait while the CLI process starts
  • Multi-turn context is flattened into a headless prompt for grok -p
  • Linux and remote workspaces are not maintainer-certified

Contributing

Linux fixes, path discovery improvements, and verification reports are especially welcome. See CONTRIBUTING.md.

License and trademarks

MIT © 2026 Adrian Francisco López

Grok, xAI, GitHub Copilot, and Visual Studio Code are trademarks of their respective owners. This project is independent and unofficial.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft