grok-cpa-bootstrap

Reproduce and audit a Grok CLI, CLIProxyAPI, and Cloudflare temp-mail registration stack on macOS.

4|Updated Jun 2, 2026
One-click install
npx skills add https://github.com/sukbearai/king-ai --skill grok-cpa-bootstrap-sukbearai
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: grok-cpa-bootstrap
Source: https://github.com/sukbearai/king-ai/tree/main/packages/skills/skills/grok-cpa-bootstrap
Command: npx skills add https://github.com/sukbearai/king-ai --skill grok-cpa-bootstrap-sukbearai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Rebuilding a working Grok CLI stack on a new Mac involves many fragile moving parts: installing CLIProxyAPI (CPA), routing Grok CLI through its local OpenAI-compatible endpoint, deploying a private Cloudflare temporary-email Worker, configuring grok-register, and recovering failed OIDC exports. This Skill turns that into a checkpointed, secret-safe, auditable procedure. ## Core Features & Use Cases - Guided stack bootstrap: Installs CPA via Homebrew, routes Grok CLI through 127.0.0.1:8317 with a managed configurator script, and deploys a private Cloudflare temp-mail Worker with D1 and subdomain Email Routing. - Authorized registration and OIDC recovery: Runs explicitly authorized grok-register batches and retries rate-limited CPA OIDC exports sequentially with cooldowns, error classification, and credential redaction. - Safe auditing: Validates CPA auth files, model catalog routing, file permissions, and optionally a live Grok inference check without printing secrets. - Use Case: After migrating to a new Mac, use this Skill to reinstall CPA, redeploy the temp-mail Worker, recover previously registered accounts' auth JSON files, and verify the full chain end to end. ## Quick Start Ask the agent to use the grok-cpa-bootstrap skill to audit the existing Grok CLI and CPA installation on this Mac and report what is missing before reinstalling anything.

Frequently Asked Questions about grok-cpa-bootstrap

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I route Grok CLI through a local CLIProxyAPI endpoint?▼

Run the bundled configure_grok_cpa.py script with the CPA API key supplied via the CPA_API_KEY environment variable. It updates ~/.grok/config.toml and a managed block in ~/.zshenv with mode 600, then verify with 'grok models' in a new login shell.

How do I recover failed CPA OIDC exports after registration?▼

Use retry_cpa_auth.py against the saved accounts file; it skips accounts that already have xai-*.json auth files and retries only rate limits, network errors, and upstream 5xx responses with cooldowns. Do not rerun registration for accounts that already registered successfully.

Does this workflow work on Linux or Windows?▼

The skill targets macOS with Homebrew by default, using brew services for CPA and zsh for shell configuration. Other platforms are only handled when the user explicitly requests them, and the documented commands assume macOS tooling.

Why does CPA import show personal-team-blocked:spending-limit?▼

That error means the OIDC import succeeded but the specific model lacks upstream credits or subscription entitlement. It is an xAI entitlement failure, not a CPA import failure; test a different model or report the blocked model separately.

How are Cloudflare temp-mail secrets handled during deployment?▼

JWT_SECRET and ADMIN_PASSWORDS are installed as Worker secrets via wrangler secret bulk, never as plaintext [vars] in wrangler.toml. Secrets are generated fresh per machine, kept in shell variables only, and unset after use.

What does invalid_grant: Access denied mean during device authorization?▼

It means the consent UI completed but xAI rejected the device grant at the token endpoint. The recovery run stops immediately; do not rotate proxies or repeat device grants to bypass the upstream decision.