跪拜 Guibai
← All articles
AI Programming · Claude · Gemini

ccish: Google's Antigravity Agent, Claude Code's Terminal UI

By JasonWuuu ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Terminal coding agents differ enough in UX that muscle memory alone can push developers back to a familiar tool even when another agent's model is stronger. ccish shows how a structured protocol like ACP makes interface preference separable from agent choice, so users can mix and match without waiting for vendors to copy each other's UIs.

Summary

ccish is an open-source terminal tool that runs Google's Antigravity CLI (`agy`) through the Agent Client Protocol (ACP) and renders the session with a Claude Code-style interface. The underlying agent and its Gemini model stay untouched; only the terminal presentation, keybindings, permission prompts, and command menu change. No API key is required, the locally installed agy keeps its credentials, and no telemetry leaves the machine.

The implementation deliberately avoids screen-scraping. ccish consumes the structured ACP event stream agy exposes via `agy acp`, normalizes agy's spec deviations through a per-agent profile, and drives an Ink-based React terminal UI. Instead of approximating Claude Code's look from memory, real Claude Code sessions were measured in a pseudo-terminal and compiled into style tokens; every color, glyph, indentation, and animation value is read from those tokens. Testing spans replay of recorded sessions, seeded property tests for invariants like line width and cursor alignment, pseudo-terminal end-to-end acceptance checks (314 items currently passing), and monkey tests where a fake agent spams random output.

The architecture separates pure core logic, drivers, and per-agent profiles, so adding another ACP-compliant agent mostly means writing a new profile. MIT-licensed and currently targeting agy, ccish is designed for other ACP agents to plug in.

Takeaways
— ccish launches the locally installed, logged-in agy through the Agent Client Protocol and renders the session with a Claude Code-style interface; the underlying agent and Gemini model are unchanged.
— No API key, credential handling, or telemetry is involved; installation is `npm install -g ccish && ccish agy` on Node.js 22+ with Antigravity CLI 1.5.18+.
— Permission confirmations show diffs before file changes and state what a command will run before executing; selection via number or arrow keys, Esc rejects, and nothing auto-approves.
— Claude Code muscle memory is preserved: `/` menu, `@` file refs, `!` shell mode, Ctrl+R history, Shift+Tab mode switch, Ctrl+O expand, Esc interrupt, plus `/model`, `/effort`, `/clear`, `/resume`, `/rename`, `/add-dir`, `/copy`, `/diff`, `/tasks`, `/context`.
— agy's read-only commands like `/usage` and `/credits` render in place; other agy commands open agy's own UI in the alternate screen and return to ccish on exit.
— The tool consumes structured ACP events over stdio instead of parsing terminal output, so interface changes in agy don't break the wrapper.
— agy's ACP deviations (non-standard `name`/`args` tool fields, PascalCase params, plans via `update_steps`, fragment diffs, `session/list` ignoring `cwd`, sub-agents via `invoke_subagent`) are all normalized in a single per-agent profile.
— UI appearance comes from `style-tokens.json` measured by replaying real Claude Code sessions in a pseudo-terminal frame by frame, not from hardcoded values.
— Tests use recorded session replay, seeded random property tests, pseudo-terminal e2e acceptance (314 checks passing), and monkey tests with a random-output fake agent.
— `/rename` syncs to agy's own records by opening a hidden `agy --conversation <id>` in a background pseudo-terminal, typing the rename command, and confirming via `session/list`.
Conclusions

Measuring real Claude Code's rendering through pseudo-terminal replay and compiling it into machine-readable style tokens is a more reliable way to clone a UI than hardcoding hex colors and spacing; it gives the project a spec to test against rather than a vibe to approximate.

A wrapper doesn't need to reproduce everything; passing through to agy's own UI for anything ccish can't render, like `/usage`, keeps the surface area small and the fallback honest.

Structured event consumption over screen-scraping keeps the wrapper maintainable, but it puts ccish at the mercy of agy keeping `agy acp` stable, since every spec deviation must be tracked in a profile.

Concepts & terms
Agent Client Protocol (ACP)
An open protocol proposed by Zed that lets a client and a terminal agent communicate over JSON-RPC on stdio. The agent emits structured events for message fragments, tool calls, diffs, permission requests, and plans, so clients don't have to parse rendered terminal output.
Agent profile
In ccish, a per-agent file (`agents/<id>/`) that normalizes one agent's deviations from the ACP spec, so the core logic and UI only ever handle spec-conformant events. Adding a new ACP agent mostly means writing a new profile.
Ink
A React-based library for building command-line interfaces; ccish uses it to render its terminal UI from session state.
Pseudo-terminal
A programmatically driven terminal emulator pair. ccish uses one to record real Claude Code sessions for measuring its UI, and to drive `ccish agy` in end-to-end tests.
xterm-headless
A headless xterm implementation used to replay recorded terminal output frame by frame, exporting each character's glyph, color, weight, and column position for style-token extraction.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗