Skip to content

Add Grok CLI as a built-in agent - #4

Open
edimitchel wants to merge 1 commit into
cosscom:mainfrom
edimitchel:cursor/grok-cli-agent-bec8
Open

edimitchel wants to merge 1 commit into
cosscom:mainfrom
edimitchel:cursor/grok-cli-agent-bec8

Conversation

@edimitchel

Copy link
Copy Markdown

Grok CLI (xAI Grok Build) was only usable through a custom .berth/config.json agents entry, with no session-state hooks. This adds it as a built-in preset and, because Grok Build documents Claude-style hooks, installs those hooks the same way as the other agent CLIs.

Fixes #2

What changed

  • Built-in preset grok / Grok CLI: command grok, first prompt as the last argument (grok "fix the bug"), --model and --effort from the CLI (none through max). Offered when grok is on the box's PATH, like the other built-ins.
  • berthd integrations install grok (and auto-detect / all) writes ~/.grok/hooks/berth.json for SessionStart, UserPromptSubmit, PostToolUse, Notification, Stop, StopFailure, StopCancelled, and SessionEnd.
  • Adapter maps Grok's camelCase payload (sessionId, notificationType) and treats permission_prompt as needs-you. idle_prompt and task_complete settle a turn that never reported Stop; they are not questions.
  • App label, icon, Settings → Agents install hint, and hook-install offer.
  • Docs: First agent, agent integrations, config, project-config, sessions-and-agents, CLI/berthd references.

Not in this PR

  • Skills and MCP are not installed for Grok. Unlike Claude/Codex/Gemini, there is no documented Berth-equivalent settings path for those yet; inventing one would be guesswork. Hooks still register so working / needs-you / done work.

Tests

  • Preset command line (grok --model … --effort … '…') and agentOf
  • Hook install is idempotent and includes every Grok event
  • Detect / install all lists include grok
  • Translate: camelCase and snake_case ids, notification types, no prompt/message leakage

@vercel

vercel Bot commented Oct 6, 2026

Copy link
Copy Markdown

@cursoragent is attempting to deploy a commit to the seanbrydonio's projects Team on Vercel.

A member of the Team first needs to authorize it.

@cursor
cursor Bot force-pushed the cursor/grok-cli-agent-bec8 branch 9 times, most recently from eae3aee to 3d6b2e2 Compare October 13, 2026 15:19
Register grok (xAI Grok Build) next to Claude Code, Codex, Cursor,
OpenCode and Gemini: last-arg prompt, --model and --effort. When the
CLI is present, integrations install writes ~/.grok/hooks/berth.json
so Berth can show working, needs-you and done. berthd agents install
grok and the guided picker run xAI's documented installer
(https://x.ai/cli/install.sh) and link ~/.grok/bin/grok into
~/.local/bin. Skills and MCP stay out until Grok has a documented
path for them.

Co-authored-by: Michel EDIGHOFFER <edimitchel@users.noreply.github.com>
@cursor
cursor Bot force-pushed the cursor/grok-cli-agent-bec8 branch from 3d6b2e2 to 9409f05 Compare October 15, 2026 09:00

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Grok CLI (xAI Grok Build) as a built-in agent

2 participants