Add Grok Build subscription provider via ACP (no XAI_API_KEY)
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 19.9k
- Forks
- 2.3k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 30
Description
Summary
Add a first-class grok-build provider that drives Grok Build through the user's existing authenticated Grok CLI session over the Agent Client Protocol (ACP), without requiring XAI_API_KEY, and without changing the existing xai API-key provider.
Motivation
Users with a Grok Build subscription can authenticate through the installed grok CLI, but jcode currently only reaches xAI models via a raw XAI_API_KEY (the OpenAI-compatible xai provider). There is no way to spend a Grok Build subscription from jcode.
Proposal
- New provider id
grok-build, selectable via--provider grok-build. - Authentication delegated to the Grok CLI (
grok login, browser OAuth or device-auth when headless). jcode never reads, copies, persists, or refreshes Grok OAuth credentials. - Transport is ACP v1 over
grok agent … stdio:initialize→authenticate(cached_token) →session/new/session/resume→session/prompt, translatingsession/updatenotifications into jcode stream events. - Dynamic model discovery from the ACP
initializemodel state. - Grok Build runs its own restricted internal ACP tool loop (isolated agent profile, minimal built-in coding tools, no MCP inheritance/skills/AGENTS.md/subagents); jcode keeps the outer session, provider, model routing, memory, swarm, and orchestration layers.
Distinction from the xai provider
grok-build |
xai |
|
|---|---|---|
| Backing | Grok Build subscription via grok CLI |
xAI API key |
| Transport | ACP v1 stdio | OpenAI-compatible HTTP |
| Auth | grok login (owned by CLI) |
XAI_API_KEY |
| Select | --provider grok-build |
--provider xai (alias grok) |
Expected behavior / acceptance
With XAI_API_KEY unset:
jcode auth-test --provider grok-buildpasses.jcode --provider grok-build run 'Reply exactly GROK_BUILD_OK'returnsGROK_BUILD_OK.
With a deliberately invalid XAI_API_KEY:
jcode --provider grok-build run 'Reply exactly SUBSCRIPTION_ONLY_OK'still succeeds (the subscription path is used, the API key is ignored).
Notes
A reference implementation is prepared on a fork branch and will be linked as a PR. Per CONTRIBUTING.md, it is offered as a reference/proof of concept for a maintainer-authored change.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with CONTRIBUTING.md and the ACP v1 entry points described in the issue: initialize, authenticate, session/new or session/resume, and session/prompt. Verify the acceptance commands with XAI_API_KEY unset and deliberately invalid, confirming auth-test passes and the exact GROK_BUILD_OK and SUBSCRIPTION_ONLY_OK responses are returned.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- ai, cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100