gitwtfhub

wtf is opencode-grok-auth?

ysnock404/opencode-grok-auth — explained in plain English

Analysis updated 2026-05-18

11TypeScriptAudience · developerComplexity · 3/5LicenseSetup · moderate

TL;DR

An OpenCode plugin that lets you use xAI's Grok models by logging in through xAI's browser-based OAuth flow instead of managing an API key, supporting four Grok model variants.

Mindmap

mindmap
  root((opencode-grok-auth))
    What it does
      Grok models in OpenCode
      OAuth browser login
      No API key needed
    Models supported
      General purpose
      Reasoning variant
      Fast variant
      Multi-agent variant
    Tech stack
      TypeScript
      Bun
      OAuth
    Setup
      Build locally
      Copy to plugins folder
      Add provider config

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Use Grok language models inside OpenCode without needing to copy or manage an xAI API key.

REASON 2

Switch between four Grok model variants including a reasoning model and a fast model from within OpenCode.

REASON 3

Install a TypeScript OpenCode plugin built with Bun that handles OAuth token refresh automatically in the background.

What's in the stack?

TypeScriptBunOAuthxAI Grok

How it stacks up

ysnock404/opencode-grok-authaliyun/openclaw-exporter-to-langfuseanousss007/ng-blatui
Stars111111
LanguageTypeScriptTypeScriptTypeScript
Setup difficultymoderatemoderatemoderate
Complexity3/54/53/5
Audiencedeveloperops devopsdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 30min

Manual installation requires Bun to build locally and placing the output file in OpenCode's global plugins folder, npm publication is pending.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

Wtf does this do

This is a plugin for OpenCode, an AI coding tool, that adds support for xAI's Grok language models. Normally, connecting to Grok requires an API key. This plugin takes a different approach: it logs you in through xAI's own OAuth flow, the same login mechanism used by the SuperGrok subscription service, so you can use Grok inside OpenCode without managing an API key. OAuth is a standard way of handling logins where you approve access in a browser rather than copying a token from a dashboard. When you run the login command, the plugin opens a browser window pointing to xAI's authorization page, you sign in with your xAI account, and the plugin receives a short-lived access token that it stores and refreshes automatically in the background. The token is only ever sent to xAI's own API address, and the plugin includes a safety check that blocks it from going anywhere else. The plugin registers four Grok models in OpenCode's provider list: a general-purpose model, a reasoning-focused variant, a faster non-reasoning variant, and a multi-agent variant. You select which one to use from within OpenCode the same way you would select any other supported model. Installation is currently manual. You build the plugin locally using Bun, a JavaScript runtime, place the output file in OpenCode's global plugins folder, and add a provider block to OpenCode's configuration file. The README includes step-by-step instructions for Windows, with PowerShell commands for each step. Once published to npm, the setup will be simpler. The plugin is released under the MIT license. The README credits the implementation pattern to two other open-source projects: an Antigravity Auth plugin by a separate author and xAI OAuth work by Nous Research.

Yoink these prompts

Prompt 1
Walk me through installing the opencode-grok-auth plugin on Windows: building it with Bun, placing it in OpenCode's plugins folder, and adding the provider block to the config file.
Prompt 2
Show me how the OAuth login flow works in opencode-grok-auth: what happens when I run the login command and how the access token is stored and refreshed.
Prompt 3
I want to modify opencode-grok-auth to add a fifth Grok model variant. Show me where models are registered in the TypeScript code and how to add a new entry.
Prompt 4
How do I select a specific Grok model variant like the reasoning model inside OpenCode after installing the opencode-grok-auth plugin?

Frequently asked questions

wtf is opencode-grok-auth?

An OpenCode plugin that lets you use xAI's Grok models by logging in through xAI's browser-based OAuth flow instead of managing an API key, supporting four Grok model variants.

What language is opencode-grok-auth written in?

Mainly TypeScript. The stack also includes TypeScript, Bun, OAuth.

What license does opencode-grok-auth use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is opencode-grok-auth to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is opencode-grok-auth for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.