Skip to content

About

Turbo C++-styled agentic terminal — real PTY panes for AI coding CLIs, with MCP discovery and an MCP server generator. Electron + xterm.js + node-pty.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

cc++ — Turbo C++-styled Agentic Terminal

A desktop shell that wraps agentic CLIs (Claude Code and others) in the look and feel of Borland Turbo C++ — blue field, yellow double borders, red-highlighted menus, and a DOS F-key status line. Each pane hosts a real local PTY, so any CLI runs unmodified.

Status

All three phases are complete and verified end to end:

  • P1 Foundation — the Turbo C++ shell: real PTY panes, agent registry, saveable workspaces, live-switchable JSON themes.
  • P2 MCP Hub — discover MCP servers already configured on this machine, ask consent, and hand the confirmed set to launched agents.
  • P3 MCP Forge — scaffold a brand-new MCP server for an app that never shipped one, hand it to an agent to implement, then smoke-test and connect it.

MCP Hub

Agents → Scan for MCPs… reads the MCP servers already configured on this machine — Claude Code (~/.claude.json, including its per-project entries), Claude Desktop, and Cursor — and lists what it found. Scanning only reads files; nothing is connected until you tick servers and press Connect.

Confirmed servers persist in mcpRegistry.json in the config dir. When you then launch a Claude Code pane, cc++ writes the enabled ones into its own mcp-config.json and appends --mcp-config <file> to the launch. This is additive — your own MCP servers stay available, and cc++ never edits your global Claude config or writes into your project directories. Other agents (shell, etc.) launch untouched.

Agents → Manage MCPs… enables/disables entries; disabled servers are left out of the generated config at the next launch.

Both dialogs are keyboard-driven: ↑/↓ move, Space ticks the highlighted row, Enter confirms, Esc cancels. Select All flips to Deselect All once everything is ticked.

Server definitions are copied verbatim, so any env secrets in a discovered server's config are copied into cc++'s mcp-config.json too. That file lives in the config dir alongside your other cc++ settings.

MCP Forge

For an app that never shipped an MCP server, Agents → Forge new MCP… builds one. Name it, pick what it wraps — a CLI command, a folder of files, or a local HTTP API — and list the actions to expose. cc++ scaffolds a runnable plain-JS project (no build step) with one stubbed tool per action, then opens it in a Claude Code pane seeded with a prompt telling the agent to npm install and fill in the bodies.

Agents → Smoke Test Forged MCP… starts the server and lists its tools with a real MCP client. On success cc++ offers to connect it — through the same Consent Gate as any discovered server — after which Claude panes launched from cc++ get its tools. A failing smoke test reports why and connects nothing.

The generated template owns the safety properties rather than trusting each implementation: CLI tools spawn with no shell (a tool argument cannot inject shell syntax), the files target confines every path to its root (rejecting .., absolute paths, and symlinks pointing outside), and the HTTP target refuses any request that resolves to a different origin.

Architecture

Security-correct Electron split (src/):

  • main/ — owns all privileged work: PTYs via node-pty (ptyManager.ts), config on disk (agentRegistry.ts, themeStore.ts, workspaceStore.ts, paths.ts), and IPC handlers (index.ts).
  • preload/ — the only bridge: exposes a typed window.cc API via contextBridge (context isolation ON, node integration OFF).
  • renderer/ — plain TypeScript (no framework). Turbo chrome (menubar.ts, statusline.ts, dialogs.ts), CSS-variable theming (theme.ts, styles.css), the pane layout model (paneTree.ts), and one @xterm/xterm terminal per pane wired to a PTY (terminalPane.ts). main.ts orchestrates.
  • shared/ — the IPC contract (types.ts, ipc.ts), imported by both sides.

Config lives as human-readable JSON under config/ (shipped defaults) and the user config dir (overrides + workspaces). Themes are { colors, fonts, borderStyle }; agents are { id, name, command, args, icon }; a workspace (*.prj.json) captures the layout tree, cwds, and active theme.

Commands

npm install       # installs deps; postinstall rebuilds node-pty for Electron
npm run dev        # launch in dev (predev rebuilds node-pty for Electron ABI)
npm test           # run unit/integration tests (pretest rebuilds for Node ABI)
npm run typecheck  # tsc --noEmit
npm run test:e2e   # headless end-to-end smoke test (hermetic config dir)
npm run pack       # electron-builder --dir → dist/linux-unpacked/

The node-pty ABI note

node-pty is a native module and must be built against whichever runtime loads it: Node for the test runner, Electron for the app. The npm scripts handle this automatically — pretest rebuilds for Node, predev/prepack rebuild for Electron — so you never have to think about it. (This was flagged as an open item in the spec; it is resolved here.)

Verification

  • Unit / integration (tests/, Vitest): PTY lifecycle against a real bash (echo round-trip, exit code, missing-command error), theme parse + fallback, agent registry defaults + round-trip, workspace serialize round-trip, pane tree split/close/focus + JSON round-trip, MCP discovery/registry/wiring, and the Forge scaffolder — including starting a generated server with a real MCP client and asserting its path/origin guards reject escapes. 80 tests.
  • Headless E2E smoke test: npm run test:e2e (or CC_E2E=1 directly) drives the full renderer → preload → IPC → PtyManager → node-pty stack (real bash + claude sessions, pane mount, workspace round-trip, the MCP consent/manage dialogs, and the Forge wizard + scaffold) and exit with a PASS/FAIL line. CC_E2E_SHOT=<path> also captures a screenshot; CC_E2E_THEME=<id> switches theme first. These hooks are inert without CC_E2E. The script points CC_CONFIG_DIR at a throwaway directory so the run is hermetic — it never touches your real agents, workspaces, MCP registry, or forged projects.
  • Live agent tool call (opt-in, spends tokens): CC_LIVE_AGENT_TEST=1 npx vitest run tests/liveAgentToolCall.test.ts forges a server, registers it, launches a real claude through the wiring path, and asserts the model actually invoked the forged tool.

Keyboard

Key Action
F6 / Shift+F6 Move focus to the next / previous pane
Ctrl+Tab / Ctrl+Shift+Tab Same (next / previous pane)
Click a pane Focus it
F5 Smart split — auto-splits the focused pane along its longer side (wide → side-by-side, tall → stacked) so both halves stay usable
Shift+F5 Split vertically (stacked, top/bottom)
Ctrl+W Close the focused pane
F9 Toggle the sidebar (Presets / Workspaces / Terminals)
F10 Open the menu bar (then arrows / Enter / Esc)
Alt+F/E/R/A/W/H Open a menu directly — when not typing in a terminal
F2 / F3 Save / Open workspace · F1 About

The focused pane is shown with a bright, bold title bar and a ► marker; inactive panes are dimmed. These app hotkeys work even while a terminal has focus. Bare Alt+letter only opens menus when a terminal is not focused, so the shell keeps its readline Meta bindings (Alt+B, Alt+F, …); use F10 to reach the menus from inside a terminal.

Customizing

  • Themes: drop a JSON theme in the user config themes/ dir (or edit a shipped one in config/themes/). Ships Turbo C++ Classic, Norton Commander, and Amber Monochrome. Switch live from the Window menu — no restart.
  • Agents: edit agents.json in the user config dir to add launchable CLIs; they appear in the Agents menu. Each agent's icon is either a built-in key ("claude" = coral sunburst, "terminal" = terminal glyph) or a raw "<svg …>" string — paste an official brand SVG there to use the exact mark.
  • Presets: layout templates in config/presets.json that build a whole multi-pane arrangement in one shot (ships Claude + Shell, Claude (solo), Dual Shell, Dev Trio). Apply from the sidebar or the Run menu. A preset is { id, name, layout } where layout is a tree of {type:"pane", agentId} and {type:"split", dir, children} nodes (no ids — they're generated on apply).

Sidebar

Toggle with F9 (or Window → Toggle Sidebar). Three sections:

  • Presets — click to build a full multi-pane layout instantly.
  • Workspaces — Save current…, click a name to open, ✕ to delete.
  • Terminals — every open pane; click to focus (the active one is highlighted), ✕ to close it.

About

Turbo C++-styled agentic terminal — real PTY panes for AI coding CLIs, with MCP discovery and an MCP server generator. Electron + xterm.js + node-pty.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages