Skip to content

Repository files navigation

RockCode

An unofficial macOS desktop client for the Grok CLI. Your sessions in a sidebar, the agent chat in the middle, the diff it just wrote on the right.

RockCode - session sidebar, agent chat, and diff review in one window

Design mockup of the three-pane layout, not a live capture. Real screenshots to follow.

Not affiliated with xAI. RockCode is an independent open-source client that drives the Grok CLI you install and authenticate yourself. "Grok" and "xAI" are trademarks of X.AI Corp. This project uses no xAI branding and is not endorsed by them.

Features

  • Session sidebar - every local Grok session, grouped by project (~/.grok/sessions)
  • Search - filter sessions by title, summary, path, or id
  • Chat - markdown messages, collapsible thinking, expandable tool calls
  • Live agent - talks to grok agent stdio over ACP (JSON-RPC)
  • Diff review - git status and unified diffs for the session working tree
  • Permissions - approve or deny tool executions from the UI
  • History restore - reopen a past TUI or headless session and keep chatting

Requirements

  • macOS
  • Node.js 20+
  • Grok CLI installed (~/.grok/bin/grok or on PATH)
  • A Grok account - sign in from RockCode itself, or with grok login beforehand

Install both, then verify:

# Node.js 20+ via nvm
curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
source ~/.nvm/nvm.sh
nvm install 22
nvm use 22

# Grok CLI
curl -fsSL https://x.ai/cli/install.sh | bash

# Verify
node -v
grok --version

No separate login step is needed: RockCode shows a sign-in screen when ~/.grok/auth.json is missing and runs the CLI's browser login for you. Running grok login in a terminal works too.

Quick start

cd rock-code
npm install
npm run dev

Running a packaged build

npm run dist produces an unsigned, un-notarized .dmg / .zip, so macOS Gatekeeper will refuse to open it ("RockCode is damaged and can't be opened"). Clear the quarantine flag after copying the app to /Applications:

xattr -dr com.apple.quarantine /Applications/RockCode.app

Or right-click the app, choose Open, and confirm in the dialog. Only do this for builds you produced yourself or got from a source you trust.

Credentials

RockCode never asks for a token. It reads ~/.grok/auth.json (read-only), where the Grok CLI already cached your credentials, and shells out to grok for login. Nothing from that file is copied into the app's storage or written back.

Plan usage is best-effort. The CLI exposes no ACP method or headless command for /usage show, so the usage panel calls GET https://cli-chat-proxy.grok.com/v1/billing?format=credits with that cached token. The endpoint is undocumented and unversioned - xAI can change or remove it at any time, and the usage panel is the only part of the app that breaks when they do. Override the base with GROK_CLI_CHAT_PROXY_BASE_URL.

Scripts

Command Description
npm run dev Start Electron + Vite in development
npm run build Bundle main, preload, and renderer
npm run typecheck TypeScript checks
npm run pack Build an unpackaged macOS app
npm run dist Build distributable .dmg / .zip

Brand assets

File Use
resources/icon.icns macOS app icon
resources/icon.png Master app icon (PNG)
resources/logo.svg Vector mark (source of every raster asset)
resources/wordmark.svg Icon + “RockCode” lockup
resources/logo-small.svg Simplified mark for 16-32px renders

Architecture

electron/main/     Electron main process
  session-store    Reads ~/.grok/sessions
  acp-client       Spawns `grok agent stdio`
  git-service      status + unified diffs
electron/preload/  Secure IPC bridge
src/renderer/      React UI
src/shared/        Shared TypeScript types

Session storage

Grok persists every conversation under:

~/.grok/sessions/<encoded-cwd>/<session-id>/
  summary.json
  updates.jsonl      # ACP stream (source of truth for chat)
  chat_history.jsonl
  ...

RockCode indexes those folders for the sidebar and rebuilds chat history from updates.jsonl.

Live agent

For interactive work, the main process spawns:

grok agent stdio

and speaks ACP over its stdio (initialize, session/new, session/load, session/prompt, session/update). With auto-approve off, permission prompts surface as a toast.

Keyboard / UX notes

  • Enter sends a prompt; Shift+Enter inserts a newline
  • Toggle the right panel with the control in the chat header
  • Sessions refresh automatically when files under ~/.grok/sessions change

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages