Overview: Electron-based IDE for orchestrating AI coding agents (Claude, Gemini, Codex). Orchestrates AI-assisted development: spawn agents, inject codebase context, monitor worktrees. Stack: Electron 33, React 19, Vite 6, TypeScript, Tailwind CSS v4, Zustand, node-pty, simple-git.
- Dependencies: Use
npm installfor local development.npm ciis acceptable for CI environments where reproducible builds are critical. Both commands run thepostinstallrebuild hook automatically unless--ignore-scriptsis used. - Native Modules: The
postinstallscript rebuildsnode-ptyautomatically. Runnpm run rebuildmanually if errors occur. - Code Style: Minimal comments, no decorative headers, high signal-to-noise.
- Commits: NEVER commit changes without explicit permission from the user.
npm run dev # Vite + Electron concurrent
npm run build # Production build
npm run check # typecheck + lint + format
npm run fix # Auto-fix lint/format
npm run rebuild # Rebuild node-pty- Main (
electron/): Node.js. Handles node-pty, git, services, IPC. - Renderer (
src/): React 19. Communicates viawindow.electron. - Shared (
shared/): Types and config shared between processes.
Central orchestration layer for all UI operations. Provides unified API for menus, keybindings, and future agent automation.
ActionService(src/services/ActionService.ts) - Registry and dispatcherdispatch(actionId, args?)- Execute any actionlist()/get(id)- Introspect actions (MCP-compatible manifest)- Action definitions in
src/services/actions/definitions/(17 domain files) - Types in
shared/types/actions.ts
Panels are visual units in the grid/dock. Uses discriminated unions:
PanelInstance = PtyPanelData | BrowserPanelData- Kinds:
"terminal"|"agent"|"browser" panelKindHasPty(kind)- Check if panel needs PTY- Registry:
shared/config/panelKindRegistry.ts
Namespaced API exposed via electron/preload.cts:
worktree: getAll, refresh, setActive, create, delete, onUpdateterminal: spawn, write, resize, kill, trash, restore, onData, onExitapp: getState, setState, hydrate, onMenuActioncopyTree: generate, injectToTerminal, onProgresssystem: openExternal, openPath, checkCommandproject: getAll, getCurrent, add, switch, onSwitchevents: emit (action tracking)
- Panels:
PtyManager(Main) + xterm.js (Renderer). Supports terminal, agent, and browser panels. - Worktrees:
WorkspaceServicepolls git status, tracks file changes. - Agent State:
AgentStateMachinedetects idle/working/waiting/completed from output. - Context Injection:
CopyTreeServicegenerates context, pastes into terminal. - Actions:
ActionServicedispatches all operations with validation and event emission.
electron/
├── main.ts # Entry point
├── preload.cts # IPC bridge
├── pty-host.ts # PTY process host
├── ipc/
│ ├── channels.ts # Channel constants
│ └── handlers/ # IPC implementations
└── services/ # Backend services
shared/
├── types/
│ ├── actions.ts # Action system types
│ ├── domain.ts # Panel, Worktree types
│ └── keymap.ts # Keybinding types
└── config/
├── panelKindRegistry.ts # Panel configuration
└── agentRegistry.ts # Agent configuration
src/
├── services/
│ ├── ActionService.ts # Action dispatcher
│ └── actions/definitions/ # Action definitions
├── components/
│ ├── Terminal/ # Xterm.js grid
│ ├── Worktree/ # Dashboard cards
│ └── Layout/ # App structure
├── store/ # Zustand stores
├── hooks/ # React hooks
└── types/electron.d.ts # window.electron types
Adding IPC channel:
- Define in
electron/ipc/channels.ts - Implement in
electron/ipc/handlers/ - Expose in
electron/preload.cts - Type in
src/types/electron.d.ts
Adding action:
- Add ID to
shared/types/actions.ts - Create definition in
src/services/actions/definitions/