@surething/cockpit 1.0.195 → 1.0.196

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/.next-prod/BUILD_ID +1 -1
  2. package/.next-prod/app-path-routes-manifest.json +4 -4
  3. package/.next-prod/build-manifest.json +2 -2
  4. package/.next-prod/prerender-manifest.json +3 -3
  5. package/.next-prod/server/app/_global-error/page_client-reference-manifest.js +1 -1
  6. package/.next-prod/server/app/_global-error.html +1 -1
  7. package/.next-prod/server/app/_global-error.rsc +1 -1
  8. package/.next-prod/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next-prod/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  10. package/.next-prod/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  11. package/.next-prod/server/app/_global-error.segments/_head.segment.rsc +1 -1
  12. package/.next-prod/server/app/_global-error.segments/_index.segment.rsc +1 -1
  13. package/.next-prod/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  14. package/.next-prod/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next-prod/server/app/_not-found.html +2 -2
  16. package/.next-prod/server/app/_not-found.rsc +2 -2
  17. package/.next-prod/server/app/_not-found.segments/_full.segment.rsc +2 -2
  18. package/.next-prod/server/app/_not-found.segments/_head.segment.rsc +1 -1
  19. package/.next-prod/server/app/_not-found.segments/_index.segment.rsc +2 -2
  20. package/.next-prod/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  21. package/.next-prod/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  22. package/.next-prod/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  23. package/.next-prod/server/app/page_client-reference-manifest.js +1 -1
  24. package/.next-prod/server/app/project/page_client-reference-manifest.js +1 -1
  25. package/.next-prod/server/app/review/[id]/page_client-reference-manifest.js +1 -1
  26. package/.next-prod/server/app-paths-manifest.json +4 -4
  27. package/.next-prod/server/middleware-build-manifest.js +1 -1
  28. package/.next-prod/server/pages/404.html +2 -2
  29. package/.next-prod/server/pages/500.html +1 -1
  30. package/.next-prod/server/server-reference-manifest.json +1 -1
  31. package/.next-prod/static/css/18aae55f9fdae00a.css +1 -0
  32. package/.next-prod/trace +12 -12
  33. package/.next-prod/trace-build +1 -1
  34. package/README.md +154 -61
  35. package/README.zh.md +141 -54
  36. package/bin/cock-browser.mjs +19 -19
  37. package/bin/cock-terminal.mjs +8 -8
  38. package/bin/cock.mjs +7 -5
  39. package/bin/cockpit.mjs +14 -0
  40. package/package.json +27 -5
  41. package/.next-prod/static/css/083cb04521b4969d.css +0 -1
  42. /package/.next-prod/static/{iLRBjFXcqOGmNS619Y9Uo → 5dqS4JCjRSMJN3cvcnCBI}/_buildManifest.js +0 -0
  43. /package/.next-prod/static/{iLRBjFXcqOGmNS619Y9Uo → 5dqS4JCjRSMJN3cvcnCBI}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- [{"name":"run-webpack","duration":11102035,"timestamp":324193526,"id":14,"parentId":1,"tags":{},"startTime":1777447899479,"traceId":"ca6a47e32f64e411"},{"name":"run-typescript","duration":14780823,"timestamp":335299889,"id":1417,"parentId":1,"tags":{},"startTime":1777447910585,"traceId":"ca6a47e32f64e411"},{"name":"static-check","duration":875564,"timestamp":350096916,"id":1420,"parentId":1,"tags":{},"startTime":1777447925382,"traceId":"ca6a47e32f64e411"},{"name":"static-generation","duration":4698707,"timestamp":351695752,"id":1650,"parentId":1,"tags":{},"startTime":1777447926981,"traceId":"ca6a47e32f64e411"},{"name":"collect-build-traces","duration":18566946,"timestamp":350973148,"id":1647,"parentId":1,"tags":{},"startTime":1777447926258,"traceId":"ca6a47e32f64e411"},{"name":"telemetry-flush","duration":70,"timestamp":369544041,"id":1659,"parentId":1,"tags":{},"startTime":1777447944829,"traceId":"ca6a47e32f64e411"},{"name":"next-build","duration":45514189,"timestamp":324029936,"id":1,"tags":{"buildMode":"default","version":"16.2.4","bundler":"webpack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1777447899315,"traceId":"ca6a47e32f64e411"}]
1
+ [{"name":"run-webpack","duration":11422545,"timestamp":137190991,"id":14,"parentId":1,"tags":{},"startTime":1777481398093,"traceId":"42ecf5343f77835f"},{"name":"run-typescript","duration":15141139,"timestamp":148617856,"id":1417,"parentId":1,"tags":{},"startTime":1777481409520,"traceId":"42ecf5343f77835f"},{"name":"static-check","duration":888476,"timestamp":163777273,"id":1420,"parentId":1,"tags":{},"startTime":1777481424679,"traceId":"42ecf5343f77835f"},{"name":"static-generation","duration":4769627,"timestamp":165213269,"id":1650,"parentId":1,"tags":{},"startTime":1777481426115,"traceId":"42ecf5343f77835f"},{"name":"collect-build-traces","duration":18270288,"timestamp":164670057,"id":1647,"parentId":1,"tags":{},"startTime":1777481425572,"traceId":"42ecf5343f77835f"},{"name":"telemetry-flush","duration":51,"timestamp":182944034,"id":1659,"parentId":1,"tags":{},"startTime":1777481443846,"traceId":"42ecf5343f77835f"},{"name":"next-build","duration":45904607,"timestamp":137039488,"id":1,"tags":{"buildMode":"default","version":"16.2.4","bundler":"webpack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1777481397941,"traceId":"42ecf5343f77835f"}]
package/README.md CHANGED
@@ -1,110 +1,203 @@
1
1
  <p align="center">
2
- <img src="public/icons/icon-128x128.png" width="80" />
2
+ <a href="https://cocking.cc">
3
+ <img src="public/icons/icon-128x128.png" width="80" alt="Cockpit logo" />
4
+ </a>
3
5
  </p>
4
6
 
5
- # The Cockpit That Drives AI
7
+ <h1 align="center">Cockpit A Claude Code GUI for parallel AI coding</h1>
6
8
 
7
- **One seat. One AI. Everything under control.**
9
+ <p align="center">
10
+ <strong>One seat. One AI. Everything under control.</strong><br/>
11
+ <sub><code>/ˈkɒkpɪt/</code> — like an aircraft cockpit</sub>
12
+ </p>
13
+
14
+ <p align="center">
15
+ <a href="https://www.npmjs.com/package/@surething/cockpit"><img src="https://img.shields.io/npm/v/@surething/cockpit?color=12a594&label=npm&style=flat-square" alt="npm version"/></a>
16
+ <a href="https://www.npmjs.com/package/@surething/cockpit"><img src="https://img.shields.io/npm/dm/@surething/cockpit?color=12a594&label=downloads&style=flat-square" alt="npm downloads"/></a>
17
+ <a href="https://github.com/Surething-io/cockpit/stargazers"><img src="https://img.shields.io/github/stars/Surething-io/cockpit?color=12a594&style=flat-square" alt="GitHub stars"/></a>
18
+ <a href="https://github.com/Surething-io/cockpit/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-12a594?style=flat-square" alt="MIT license"/></a>
19
+ <a href="https://cocking.cc"><img src="https://img.shields.io/badge/website-cocking.cc-12a594?style=flat-square" alt="website"/></a>
20
+ <a href="https://github.com/anthropics/anthropic-sdk-typescript"><img src="https://img.shields.io/badge/built_on-Claude%20Agent%20SDK-12a594?style=flat-square" alt="Built on Claude Agent SDK"/></a>
21
+ </p>
22
+
23
+ <p align="center">
24
+ <a href="README.md">English</a> · <a href="README.zh.md">中文</a> · <a href="https://cocking.cc">Website</a> · <a href="https://cocking.cc/en/blog/">Blog</a>
25
+ </p>
26
+
27
+ ---
28
+
29
+ > **Cockpit is an open-source Claude Code GUI.** Run multiple Claude Code Agent SDK sessions in parallel across projects, with a built-in terminal, Chrome control, PostgreSQL / MySQL / Redis bubbles, code review, and slash modes — all local, zero config.
8
30
 
9
31
  https://github.com/user-attachments/assets/18f1a5dc-64f3-4ff6-b9fc-9cd08181fbb8
10
32
 
11
- A unified development cockpit built on **Claude Code (Agent SDK)** — chat, code, terminal, browser, database all in one interface. If you can run Claude Code, Cockpit works out of the box — zero config, zero cloud dependency.
33
+ ```bash
34
+ npm i -g @surething/cockpit && cockpit
35
+ ```
36
+
37
+ ## Why Cockpit?
38
+
39
+ Anthropic ships **Claude Code as a CLI**. That's the right call for power users — but the moment you have more than one project in flight, your terminal turns into mission control with no instruments.
40
+
41
+ Cockpit is the instrument panel. It does **not** replace Claude Code; it stands on top of the official Agent SDK and gives you the things a CLI can't:
12
42
 
13
- **20× AI power, 20× your productivity.** Run multiple AI sessions in parallel across projects, stay in flow with notifications and red-dot badges, collaborate through shared code reviews — all from within the cockpit.
43
+ | Pain with raw Claude Code | What Cockpit adds |
44
+ |---|---|
45
+ | One session at a time, terminal chaos at 3+ projects | **Multi-project tabs**, parallel agent sessions, red-dot inbox, desktop notifications |
46
+ | Image attachments are awkward | Drop / paste images straight into chat |
47
+ | "What was I debugging yesterday?" | Cmd+K cross-project session browser, pinning, forking |
48
+ | Agent can't reach your browser / DB | **Smart Bubbles**: Chrome, PostgreSQL, MySQL, Redis — drivable by the agent |
49
+ | Reviewing AI output is friction | **LAN-shared review pages**, line-level comments, send any comment back as AI context |
50
+ | Same "do X but don't change code" prompt every day | **Slash modes** `/qa /fx /review /commit` + custom `~/.claude/commands/*.md` |
51
+ | No automation hooks | One-time / interval / cron-based **scheduled tasks** |
52
+ | "Cloud relay" trust concerns | **Fully local**. No telemetry. No API key beyond what `claude` already has. |
14
53
 
15
54
  ## Features
16
55
 
17
- ### Agent — AI Chat
18
- - Powered by Claude Code (Agent SDK) — zero API key setup if Claude Code is already configured
19
- - Multi-project concurrent sessions run multiple AI tasks in parallel, get notified when done
20
- - Session pinning, forking, and cross-project session browser
21
- - `!command` prefix to execute shell commands from chat
22
- - Image attachments, inline code references, token usage tracking
23
-
24
- ### Explorer — Code & Files
25
- - Directory tree / Recent / Git Changes / Git History 4-tab file browser
26
- - Syntax highlighting (Shiki) with Vi mode editing
27
- - Git blame, diff view, branch switching, worktree management
28
- - LSP integration go to definition, find references, hover info
56
+ ### Agent — AI chat that scales
57
+
58
+ - Powered by the **official Claude Agent SDK** zero extra API key setup
59
+ - **Multi-project concurrent sessions** with desktop notifications and red-dot badges
60
+ - Session **pinning, forking**, cross-project session browser (Cmd+K)
61
+ - `!command` prefix to run shell from chat — output piped back as context
62
+ - Image attachments, code references, token usage tracking
63
+
64
+ ### ExplorerCode & files
65
+
66
+ - **4-tab file browser**: Directory · Recent · Git Changes · Git History
67
+ - Syntax highlighting (Shiki) with **Vi mode** editing
68
+ - Git **blame**, diff view, branch switching, **worktree** management
69
+ - **LSP integration** — go to definition, find references, hover info
29
70
  - Fuzzy file search (Cmd+F), JSON viewer, Markdown preview
30
71
 
31
- ### Console — Terminal & Bubbles
32
- - Full terminal emulator (xterm.js) with shell integration
33
- - **Browser Bubble** control Chrome via accessibility tree: click, type, navigate, screenshot, network inspection
34
- - **Database Bubble** — connect PostgreSQL, explore schema, run queries, export data
35
- - **MySQL Bubble** — connect MySQL, browse databases/tables, run queries, export data
36
- - **Redis Bubble** — browse keys, inspect values, execute commands
37
- - Drag-to-reorder bubbles, grid / maximized layout
38
- - Environment variables & shell aliases per tab
72
+ ### Console — Terminal & smart Bubbles
73
+
74
+ - Full **xterm.js** terminal with shell integration
75
+ - 🌐 **Browser Bubble** — control Chrome via accessibility tree (click, type, navigate, screenshot, network)
76
+ - 🐘 **PostgreSQL Bubble** — browse schema, run queries, export
77
+ - 🐬 **MySQL Bubble** — browse databases & tables, run queries
78
+ - 🔴 **Redis Bubble** — browse keys, inspect values, execute commands
79
+ - Drag-to-reorder, grid / maximized layout, per-tab env vars & shell aliases
39
80
 
40
- ### Code Review — Team Collaboration
41
- - LAN-shareable review pages — team members review without installing anything
42
- - Line-level commenting with reply threads
43
- - Send comments as AI context for automated fixes
44
- - Red-dot badges for unread comments
81
+ ### Code Review — LAN-shared, no SaaS
45
82
 
46
- ### Scheduled Tasks
47
- - One-time, interval, or cron-based task scheduling
48
- - Pause/resume, reorder, result tracking
83
+ - LAN-shareable review pages — **teammates need zero install**
84
+ - Line-level comments with reply threads
85
+ - **Send any comment back to AI** as context for an automated fix
86
+ - Red-dot badges keep unread feedback visible across projects
49
87
 
50
- ### Stay in Flow
51
- - Three-panel swipe UI — Agent / Explorer / Console always rendered, instant switch
52
- - Red-dot badges & toast notifications — never miss a completed AI task
53
- - Multi-project workspace — each project isolated, switch without losing state
54
- - Dark / Light theme, English / Chinese i18n
55
- - Chrome extension (Manifest V3) for browser automation bridge
56
- - CLI tools: `cock browser` / `cock terminal` for headless automation
88
+ ### Slash modes — change the agent's posture
57
89
 
58
- ## Try Online
90
+ - `/qa` — **Clarify-only**: restate, ask back, never code
91
+ - `/fx` — **Diagnose-only**: bug evidence chain, never edit
92
+ - `/review` — read the diff, write notes, no rewrites
93
+ - `/commit` — stage + draft a message in your repo's style + commit
94
+ - **Custom**: drop any `*.md` into `~/.claude/commands/` or `./.claude/commands/` → instant slash command
59
95
 
60
- No install neededtry Cockpit in your browser (5-minute sandbox, no AI chat):
96
+ ### Scheduled tasksCron for AI
61
97
 
62
- [![Try Online](https://img.shields.io/badge/Try%20Online-Cockpit%20Demo-blue?style=for-the-badge)](https://cocking.cc/try)
98
+ - One-time, interval, or **cron** scheduling
99
+ - Pause / resume, reorder, track results across projects
100
+
101
+ ### Skills — extensibility
102
+
103
+ - Drop in any `SKILL.md` to teach the agent a new trick
104
+ - Invoke with `/skill-name` from chat
105
+ - All managed from a single Skills sidebar
106
+
107
+ ## Use cases
108
+
109
+ - **Solo dev, multi-repo:** "I have a refactor running in API, tests writing in Web, and a bug investigation in Pipeline — all at once, all visible."
110
+ - **Two-person team:** Senior reviews via LAN-shared review page, no GitHub PR round-trip needed for in-progress work.
111
+ - **Full-stack chore mode:** `/fx` in one tab on a backend bug, `/review` in another on the frontend diff, `/commit` to wrap up — three slash modes, three different agent postures.
112
+ - **AI-driven QA:** Browser Bubble + scheduled task = "every night at 2 AM, run this UI smoke flow and post a summary".
113
+ - **Privacy-sensitive code:** runs on your laptop, talks only to the Claude API your `claude` CLI is already configured with. No telemetry, no relay.
114
+
115
+ ## Try online
116
+
117
+ No install, no AI chat (read-only sandbox, 5 min):
118
+
119
+ [![Try Online](https://img.shields.io/badge/Try%20Online-cocking.cc%2Ftry-12a594?style=for-the-badge)](https://cocking.cc/try)
63
120
 
64
121
  ## Prerequisites
65
122
 
66
123
  - **Node.js ≥ 20** — [nodejs.org](https://nodejs.org/)
67
- - **Claude Code** — [docs.anthropic.com](https://docs.anthropic.com/en/docs/claude-code) (Cockpit uses Claude Code Agent SDK under the hood)
68
- - **Git** — for git features (blame, diff, branch switching, etc.)
69
- - **Chrome** (optional) for Browser Bubble automation, install the bundled extension from `~/.cockpit/chrome-extension`
124
+ - **Claude Code** — [docs.anthropic.com/en/docs/claude-code](https://docs.anthropic.com/en/docs/claude-code)
125
+ - **Git** — for git features (blame, diff, worktree, etc.)
126
+ - **Chrome** *(optional)* for Browser Bubble; install the bundled extension from `~/.cockpit/chrome-extension`
70
127
 
71
128
  ## Install
72
129
 
73
130
  ```bash
74
131
  npm install -g @surething/cockpit
75
- cock # Start server → http://localhost:3457
76
- cock . # Open current directory as project
77
- cock ~/my-project # Open specified directory
78
- cock -h # Show help
132
+ cockpit # start cockpit → http://localhost:3457
133
+ cockpit . # open current dir as a project
134
+ cockpit ~/my-project # open specified dir
135
+ cockpit -h # help
79
136
  ```
80
137
 
81
- ### From Source
138
+ > Both `cockpit` (full name) and `cock` (short alias) ship with the package — use whichever you prefer. Docs and examples use `cockpit`; existing muscle memory keeps working.
139
+
140
+ ### From source
82
141
 
83
142
  ```bash
84
143
  git clone https://github.com/Surething-io/cockpit.git
85
144
  cd cockpit
86
145
  npm install
87
- npm run setup # Build + npm link (registers `cock` command)
146
+ npm run setup # build + npm link (registers `cockpit` and `cock`)
88
147
  ```
89
148
 
90
149
  ## CLI
91
150
 
92
151
  ```bash
93
- cock browser <id> snapshot # Capture accessibility tree
94
- cock browser <id> click <uid> # Click element
95
- cock terminal <id> exec "ls" # Execute command
96
- cock terminal <id> output # Get terminal output
152
+ cockpit browser <id> snapshot # capture accessibility tree
153
+ cockpit browser <id> click <uid> # click element
154
+ cockpit terminal <id> exec "ls" # execute command
155
+ cockpit terminal <id> output # get terminal output
97
156
  ```
98
157
 
158
+ ## Comparison
159
+
160
+ | | Raw Claude Code CLI | IDE plugin (Cursor, Continue) | Aider TUI | **Cockpit** |
161
+ |---|---|---|---|---|
162
+ | Multi-project parallel | tmux required | multi-window | one at a time | **first-class** |
163
+ | Cross-project search | grep | per-window | local | **Cmd+K** |
164
+ | Browser / DB control | ❌ | usually ❌ | ❌ | **✅ Bubbles** |
165
+ | Code review surface | git tools | PR provider | git | **LAN-shared** |
166
+ | Slash modes | manual | per-plugin | yes | **`/qa /fx /review /commit` + custom** |
167
+ | Local-only / no cloud relay | ✅ | varies | ✅ | **✅** |
168
+ | Day-1 SDK features | ✅ | wait | varies | **✅ official SDK** |
169
+ | Open source | ✅ | mostly ❌ | ✅ | **✅ MIT** |
170
+
171
+ Read the long version: [Claude Code GUI: CLI vs Cockpit vs IDE plugins](https://cocking.cc/en/blog/claude-code-gui-comparison/)
172
+
173
+ ## Read more
174
+
175
+ - 📖 [How to run 5 Claude Code sessions in parallel](https://cocking.cc/en/blog/parallel-claude-code-sessions/)
176
+ - 📖 [Slash modes in Claude Code: /qa /fx /review /commit](https://cocking.cc/en/blog/slash-modes-claude-code/)
177
+ - 📖 [Full blog](https://cocking.cc/en/blog/)
178
+ - 📋 [Changelog](https://cocking.cc/en/changelog/)
179
+
99
180
  ## Development
100
181
 
101
182
  ```bash
102
- npm run dev # Dev server → http://localhost:3456
103
- npm run build # Production build
104
- npm run setup # Build + npm link
183
+ npm run dev # dev server → http://localhost:3456
184
+ npm run build # production build
185
+ npm run setup # build + npm link
105
186
  npm run lint # ESLint
106
187
  ```
107
188
 
108
- ## Tech Stack
189
+ ## Tech stack
190
+
191
+ Next.js 16 · React 19 · TypeScript · TailwindCSS · xterm.js · Shiki · i18next · Claude Agent SDK
192
+
193
+ ## Contributing
194
+
195
+ Issues and PRs welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) and [GUIDE.md](GUIDE.md).
196
+
197
+ ## License
198
+
199
+ [MIT](LICENSE) © Surething
200
+
201
+ ---
109
202
 
110
- Next.js 16 · React 19 · TypeScript · TailwindCSS · xterm.js · Shiki · i18next
203
+ <sub>If Cockpit saved you 10 minutes today, a ⭐️ on GitHub is the cheapest thank-you we know.</sub>
package/README.zh.md CHANGED
@@ -1,107 +1,182 @@
1
1
  <p align="center">
2
- <img src="public/icons/icon-128x128.png" width="80" />
2
+ <a href="https://cocking.cc">
3
+ <img src="public/icons/icon-128x128.png" width="80" alt="Cockpit logo" />
4
+ </a>
3
5
  </p>
4
6
 
5
- # 驱动 AI 的驾驶舱
7
+ <h1 align="center">Cockpit —— 为并行 AI 编程而生的 Claude Code GUI</h1>
6
8
 
7
- **One seat. One AI. Everything under control.**
9
+ <p align="center">
10
+ <strong>One seat. One AI. Everything under control.</strong><br/>
11
+ <sub><code>/ˈkɒkpɪt/</code> —— 像飞机驾驶舱</sub>
12
+ </p>
13
+
14
+ <p align="center">
15
+ <a href="https://www.npmjs.com/package/@surething/cockpit"><img src="https://img.shields.io/npm/v/@surething/cockpit?color=12a594&label=npm&style=flat-square" alt="npm version"/></a>
16
+ <a href="https://www.npmjs.com/package/@surething/cockpit"><img src="https://img.shields.io/npm/dm/@surething/cockpit?color=12a594&label=downloads&style=flat-square" alt="npm downloads"/></a>
17
+ <a href="https://github.com/Surething-io/cockpit/stargazers"><img src="https://img.shields.io/github/stars/Surething-io/cockpit?color=12a594&style=flat-square" alt="GitHub stars"/></a>
18
+ <a href="https://github.com/Surething-io/cockpit/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-12a594?style=flat-square" alt="MIT license"/></a>
19
+ <a href="https://cocking.cc"><img src="https://img.shields.io/badge/website-cocking.cc-12a594?style=flat-square" alt="website"/></a>
20
+ <a href="https://github.com/anthropics/anthropic-sdk-typescript"><img src="https://img.shields.io/badge/built_on-Claude%20Agent%20SDK-12a594?style=flat-square" alt="Built on Claude Agent SDK"/></a>
21
+ </p>
22
+
23
+ <p align="center">
24
+ <a href="README.md">English</a> · <a href="README.zh.md">中文</a> · <a href="https://cocking.cc">官网</a> · <a href="https://cocking.cc/zh/blog/">博客</a>
25
+ </p>
26
+
27
+ ---
28
+
29
+ > **Cockpit 是开源的 Claude Code GUI。** 基于官方 Claude Agent SDK,支持多项目并发会话、内置终端、Chrome 自动化、PostgreSQL / MySQL / Redis 数据库气泡、代码评审与斜杠模式 —— 全部本地化,零配置。
8
30
 
9
31
  https://github.com/user-attachments/assets/18f1a5dc-64f3-4ff6-b9fc-9cd08181fbb8
10
32
 
11
- 基于 **Claude Code (Agent SDK)** 构建的一站式开发座舱 — 对话、代码、终端、浏览器、数据库全部集成在一个界面中。能跑 Claude Code 就能用,零配置、零云端依赖。
33
+ ```bash
34
+ npm i -g @surething/cockpit && cockpit
35
+ ```
36
+
37
+ ## 为什么选 Cockpit?
38
+
39
+ Anthropic 把 **Claude Code 默认做成 CLI**。这对硬核玩家是对的 —— 但只要你同时跟进 2+ 个项目,终端就成了"没有仪表盘的塔台"。
12
40
 
13
- **20× AI 算力,20× 你的效率。** 多项目 AI 会话并发执行,红点徽标和通知系统让你不错过任何完成的任务,局域网协作评审系统让团队无缝配合 在驾驶舱中完成所有工作,专注心流。
41
+ Cockpit 就是那个仪表盘。它**不替代** Claude Code,而是站在官方 Agent SDK 之上,补齐 CLI 给不了的能力:
42
+
43
+ | 裸用 Claude Code 的痛 | Cockpit 的解法 |
44
+ |---|---|
45
+ | 一次只能开一个会话,3+ 项目就乱 | **多项目标签页**、并发 Agent 会话、红点收件箱、桌面通知 |
46
+ | 图片附件麻烦 | 拖拽 / 粘贴图片直接进对话 |
47
+ | "我昨天调的那个 bug 在哪?" | Cmd+K 跨项目会话浏览,会话固定 / 分叉 |
48
+ | Agent 够不到浏览器 / 数据库 | **智能气泡**:Chrome、PostgreSQL、MySQL、Redis —— Agent 可驱动 |
49
+ | AI 输出审阅低效 | **局域网共享评审页**、行级评论、任意评论可回喂给 AI |
50
+ | 每天写一遍"做 X 但不要动代码" | **斜杠模式** `/qa /fx /review /commit` + 自定义 `~/.claude/commands/*.md` |
51
+ | 没有自动化触发器 | 一次性 / 间隔 / **Cron** **定时任务** |
52
+ | 担心"云端中转" | **完全本地**。无遥测、无中转,复用你 `claude` CLI 已有的 API Key |
14
53
 
15
54
  ## 功能特性
16
55
 
17
- ### Agent AI 对话
56
+ ### Agent —— 可扩展的 AI 对话
18
57
 
19
- - 基于 Claude Code (Agent SDK) 已配置 Claude Code 即可直接使用,无需额外设置
20
- - 多项目并发会话 多个 AI 任务并行执行,完成后自动通知
21
- - 会话固定、分叉、跨项目会话浏览器
22
- - `!command` 前缀执行 shell 命令,输出自动附加到对话
58
+ - 基于**官方 Claude Agent SDK** —— 零额外 API Key 配置
59
+ - **多项目并发会话**,桌面通知 + 红点徽标
60
+ - 会话**固定 / 分叉**,跨项目会话浏览(Cmd+K)
61
+ - `!command` 前缀直接执行 shell —— 输出回流为对话上下文
23
62
  - 图片附件、代码引用、Token 用量统计
24
63
 
25
- ### Explorer 代码与文件
64
+ ### Explorer —— 代码与文件
26
65
 
27
- - 目录树 / 最近浏览 / Git 变更 / Git 历史 — 四标签页文件浏览器
28
- - 语法高亮 (Shiki) + Vi 模式编辑
29
- - Git blameDiff 视图、分支切换、Worktree 管理
30
- - LSP 集成 跳转定义、查找引用、悬浮类型信息
31
- - 模糊搜索 (Cmd+F)、JSON 可读视图、Markdown 预览
66
+ - **4 标签页文件浏览器**:目录树 · 最近 · Git 变更 · Git 历史
67
+ - 语法高亮 (Shiki) + **Vi 模式**编辑
68
+ - Git **blame**、Diff 视图、分支切换、**Worktree** 管理
69
+ - **LSP 集成** —— 跳转定义、查找引用、悬浮类型信息
70
+ - 模糊搜索 (Cmd+F)、JSON 查看器、Markdown 预览
32
71
 
33
- ### Console 终端与气泡
72
+ ### Console —— 终端与智能气泡
34
73
 
35
- - 完整终端模拟器 (xterm.js),支持 Shell 集成
36
- - **浏览器气泡** 通过无障碍树控制 Chrome:点击、输入、导航、截图、网络检查
37
- - **数据库气泡** 连接 PostgreSQL,浏览 Schema、执行查询、导出数据
38
- - **MySQL 气泡** 连接 MySQL,浏览数据库/表、执行查询、导出数据
39
- - **Redis 气泡** 浏览键值、查看数据、执行命令
40
- - 气泡拖拽排序、网格 / 放大布局
41
- - 每个标签页独立的环境变量和 Shell 别名
74
+ - 完整 **xterm.js** 终端,Shell 集成
75
+ - 🌐 **浏览器气泡** —— 通过无障碍树控制 Chrome(点击、输入、导航、截图、网络)
76
+ - 🐘 **PostgreSQL 气泡** —— 浏览 Schema、执行查询、导出
77
+ - 🐬 **MySQL 气泡** —— 浏览数据库与表、执行查询
78
+ - 🔴 **Redis 气泡** —— 浏览键值、查看数据、执行命令
79
+ - 拖拽排序、网格 / 放大布局,每个标签独立的环境变量与 Shell 别名
42
80
 
43
- ### 代码评审 团队协作
81
+ ### 代码评审 —— 局域网共享,无需 SaaS
44
82
 
45
- - 局域网分享评审页面 团队成员无需安装即可评审
83
+ - 局域网分享评审页面 —— **队友零安装**即可参与
46
84
  - 行级评论与回复线程
47
- - 评论可发送给 AI 作为上下文,自动修复
48
- - 未读评论红点提醒
85
+ - **任意评论可发给 AI** 作为上下文,自动修复
86
+ - 未读评论红点提醒,跨项目可见
87
+
88
+ ### 斜杠模式 —— 切换 Agent 姿态
49
89
 
50
- ### 定时任务
90
+ - `/qa` —— **只澄清**:复述、反问、绝不写代码
91
+ - `/fx` —— **只诊断**:Bug 证据链分析,绝不改文件
92
+ - `/review` —— 读 diff、写评审,不动手重写
93
+ - `/commit` —— 暂存改动、按你仓库的风格起草 message、提交
94
+ - **自定义**:`~/.claude/commands/` 或 `./.claude/commands/` 下任意 `*.md` 即斜杠指令
51
95
 
52
- - 一次性、间隔、Cron 表达式三种调度模式
53
- - 暂停/恢复、拖拽排序、结果追踪
96
+ ### 定时任务 —— 给 AI 的 Cron
54
97
 
55
- ### 专注心流
98
+ - 一次性、间隔、**Cron** 三种调度
99
+ - 暂停 / 恢复、拖拽排序,跨项目追踪结果
56
100
 
57
- - 三屏滑动 UI — Agent / Explorer / Console 始终渲染,即时切换
58
- - 红点徽标 & Toast 通知 — 不错过任何完成的 AI 任务
59
- - 多项目工作区 项目独立隔离,切换不丢失状态
60
- - 深色 / 浅色主题,中英双语
61
- - Chrome 插件 (Manifest V3) 浏览器自动化桥接
62
- - CLI 工具:`cock browser` / `cock terminal` 无头自动化
101
+ ### Skills —— 可扩展性
102
+
103
+ - 任意 `SKILL.md` 都能教 Agent 新技能
104
+ - 在对话中用 `/skill-name` 直接调用
105
+ - 所有技能在统一 Skills 侧边栏管理
106
+
107
+ ## 使用场景
108
+
109
+ - **独立开发者多仓并行:** "API 在重构、Web 在写测试、Pipeline 在排 bug —— 同时跑、同时可见。"
110
+ - **二人小团队:** Senior 用局域网共享评审页 review,半成品代码不用绕 GitHub PR。
111
+ - **全栈杂活模式:** 后端 bug 一个 tab 跑 `/fx`,前端 diff 另一个 tab 跑 `/review`,最后 `/commit` 收尾 —— 三种姿态、三种 Agent 模式。
112
+ - **AI 自动化 QA:** 浏览器气泡 + 定时任务 = "每晚 2 点跑一遍 UI 冒烟流程并发摘要"。
113
+ - **隐私敏感代码:** 在你的笔记本上跑,仅与你 `claude` CLI 已配置的 Claude API 通信。无遥测、无中转。
63
114
 
64
115
  ## 在线体验
65
116
 
66
- 无需安装 — 在浏览器中直接体验 Cockpit(5 分钟沙盒,无 AI 对话):
117
+ 无需安装,只读沙盒(5 分钟):
67
118
 
68
- [![在线体验](https://img.shields.io/badge/%E5%9C%A8%E7%BA%BF%E4%BD%93%E9%AA%8C-Cockpit%20Demo-blue?style=for-the-badge)](https://cocking.cc/try)
119
+ [![在线体验](https://img.shields.io/badge/%E5%9C%A8%E7%BA%BF%E4%BD%93%E9%AA%8C-cocking.cc%2Ftry-12a594?style=for-the-badge)](https://cocking.cc/try)
69
120
 
70
121
  ## 前置依赖
71
122
 
72
- - **Node.js ≥ 20** [nodejs.org](https://nodejs.org/)
73
- - **Claude Code** [docs.anthropic.com](https://docs.anthropic.com/en/docs/claude-code)(Cockpit 底层使用 Claude Code Agent SDK)
74
- - **Git** 用于 Git 相关功能(blame、diff、分支切换等)
75
- - **Chrome** —(可选)浏览器气泡自动化,需安装 `~/.cockpit/chrome-extension` 中的扩展
123
+ - **Node.js ≥ 20** —— [nodejs.org](https://nodejs.org/)
124
+ - **Claude Code** —— [docs.anthropic.com/en/docs/claude-code](https://docs.anthropic.com/en/docs/claude-code)
125
+ - **Git** —— 用于 Git 相关功能(blame、diff、worktree 等)
126
+ - **Chrome** *(可选)* —— 浏览器气泡需安装 `~/.cockpit/chrome-extension` 中的扩展
76
127
 
77
128
  ## 安装
78
129
 
79
130
  ```bash
80
131
  npm install -g @surething/cockpit
81
- cock # 启动服务 → http://localhost:3457
82
- cock . # 打开当前目录为项目
83
- cock ~/my-project # 打开指定目录
84
- cock -h # 查看帮助
132
+ cockpit # 启动驾驶舱 → http://localhost:3457
133
+ cockpit . # 打开当前目录为项目
134
+ cockpit ~/my-project # 打开指定目录
135
+ cockpit -h # 帮助
85
136
  ```
86
137
 
138
+ > `cockpit`(完整名)和 `cock`(短别名)都随包安装 —— 任选其一。文档与示例统一使用 `cockpit`,老用户的肌肉记忆 `cock` 仍然好使。
139
+
87
140
  ### 从源码安装
88
141
 
89
142
  ```bash
90
143
  git clone https://github.com/Surething-io/cockpit.git
91
144
  cd cockpit
92
145
  npm install
93
- npm run setup # 构建 + npm link(注册 cock 命令)
146
+ npm run setup # 构建 + npm link(注册 `cockpit` 与 `cock` 命令)
94
147
  ```
95
148
 
96
149
  ## CLI
97
150
 
98
151
  ```bash
99
- cock browser <id> snapshot # 获取页面元素树
100
- cock browser <id> click <uid> # 点击元素
101
- cock terminal <id> exec "ls" # 执行命令
102
- cock terminal <id> output # 获取终端输出
152
+ cockpit browser <id> snapshot # 获取页面元素树
153
+ cockpit browser <id> click <uid> # 点击元素
154
+ cockpit terminal <id> exec "ls" # 执行命令
155
+ cockpit terminal <id> output # 获取终端输出
103
156
  ```
104
157
 
158
+ ## 与同类产品对比
159
+
160
+ | | 裸 Claude Code CLI | IDE 插件(Cursor、Continue)| Aider TUI | **Cockpit** |
161
+ |---|---|---|---|---|
162
+ | 多项目并行 | 需 tmux | 多窗口 | 一次一个 | **一等公民** |
163
+ | 跨项目搜索 | grep | 各窗口独立 | 本地 | **Cmd+K** |
164
+ | 浏览器 / DB 控制 | ❌ | 通常 ❌ | ❌ | **✅ Bubbles** |
165
+ | 代码评审面 | git 工具 | PR 平台 | git | **局域网共享** |
166
+ | 斜杠模式 | 手动 | 各插件 | 有 | **`/qa /fx /review /commit` + 自定义** |
167
+ | 纯本地 / 不上云 | ✅ | 不一定 | ✅ | **✅** |
168
+ | 新 SDK 能力第一天可用 | ✅ | 等 | 不一定 | **✅ 官方 SDK** |
169
+ | 开源 | ✅ | 多数 ❌ | ✅ | **✅ MIT** |
170
+
171
+ 详细对比:[Claude Code GUI 全景对比:CLI、Cursor、Aider 还是 Cockpit?](https://cocking.cc/zh/blog/claude-code-gui-comparison/)
172
+
173
+ ## 阅读更多
174
+
175
+ - 📖 [如何同时跑 5 个 Claude Code 会话不疯掉](https://cocking.cc/zh/blog/parallel-claude-code-sessions/)
176
+ - 📖 [Claude Code 斜杠模式实战:/qa、/fx、/review、/commit](https://cocking.cc/zh/blog/slash-modes-claude-code/)
177
+ - 📖 [完整博客](https://cocking.cc/zh/blog/)
178
+ - 📋 [更新日志](https://cocking.cc/zh/changelog/)
179
+
105
180
  ## 开发
106
181
 
107
182
  ```bash
@@ -113,4 +188,16 @@ npm run lint # ESLint
113
188
 
114
189
  ## 技术栈
115
190
 
116
- Next.js 16 · React 19 · TypeScript · TailwindCSS · xterm.js · Shiki · i18next
191
+ Next.js 16 · React 19 · TypeScript · TailwindCSS · xterm.js · Shiki · i18next · Claude Agent SDK
192
+
193
+ ## 贡献
194
+
195
+ 欢迎 Issue 和 PR。详见 [CONTRIBUTING.md](CONTRIBUTING.md) 与 [GUIDE.md](GUIDE.md)。
196
+
197
+ ## 许可证
198
+
199
+ [MIT](LICENSE) © Surething
200
+
201
+ ---
202
+
203
+ <sub>如果 Cockpit 今天给你省了 10 分钟,给一颗 ⭐️ 是我们最实惠的"谢谢"。</sub>
@@ -1,22 +1,22 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  /**
4
- * cock browser <id> <action> [args...]
4
+ * cockpit browser <id> <action> [args...]
5
5
  *
6
6
  * CLI entry point: parse arguments, send commands to browser bubble via HTTP API, print results.
7
7
  *
8
8
  * Usage examples:
9
- * cock browser abcd snapshot
10
- * cock browser abcd navigate --url https://example.com
11
- * cock browser abcd click --ref e5
12
- * cock browser abcd type --ref e3 --text "hello"
13
- * cock browser abcd evaluate --js "return document.title"
14
- * cock browser abcd evaluate --all-frames --js "return document.title"
15
- * cock browser abcd console --level error
16
- * cock browser abcd network --status 4xx,5xx
17
- * cock browser abcd assert --ref e5 --visible true
18
- * cock browser abcd perf --metric timing
19
- * cock browser abcd list (list all connected browsers)
9
+ * cockpit browser abcd snapshot
10
+ * cockpit browser abcd navigate --url https://example.com
11
+ * cockpit browser abcd click --ref e5
12
+ * cockpit browser abcd type --ref e3 --text "hello"
13
+ * cockpit browser abcd evaluate --js "return document.title"
14
+ * cockpit browser abcd evaluate --all-frames --js "return document.title"
15
+ * cockpit browser abcd console --level error
16
+ * cockpit browser abcd network --status 4xx,5xx
17
+ * cockpit browser abcd assert --ref e5 --visible true
18
+ * cockpit browser abcd perf --metric timing
19
+ * cockpit browser abcd list (list all connected browsers)
20
20
  */
21
21
 
22
22
  const args = process.argv.slice(2);
@@ -26,7 +26,7 @@ const args = process.argv.slice(2);
26
26
  function printHelp(prefix = '<id>', status = null) {
27
27
  console.log(`Control a Chrome tab — inspect elements, navigate, interact, and debug.
28
28
 
29
- Usage: cock browser ${prefix} <action>`);
29
+ Usage: cockpit browser ${prefix} <action>`);
30
30
 
31
31
  if (status) {
32
32
  if (status.connected) {
@@ -86,16 +86,16 @@ Console & Debug:
86
86
  storage [--type T] Get storage (local|session)
87
87
 
88
88
  ── Next step ──────────────────────────────────────────
89
- Run \`cock browser ${prefix} snapshot\` to inspect the page.
89
+ Run \`cockpit browser ${prefix} snapshot\` to inspect the page.
90
90
  It returns an element tree with refs like [e5]. Use those
91
91
  refs to interact: click, type, fill, hover, etc.
92
92
 
93
93
  Example session:
94
- cock browser ${prefix} snapshot # 1. see the page
95
- cock browser ${prefix} click e5 # 2. click a button
96
- cock browser ${prefix} type e3 "hello" # 3. type into input
97
- cock browser ${prefix} evaluate "document.title" # run JS
98
- cock browser ${prefix} evaluate "await fetch('/api/data').then(r=>r.json())"
94
+ cockpit browser ${prefix} snapshot # 1. see the page
95
+ cockpit browser ${prefix} click e5 # 2. click a button
96
+ cockpit browser ${prefix} type e3 "hello" # 3. type into input
97
+ cockpit browser ${prefix} evaluate "document.title" # run JS
98
+ cockpit browser ${prefix} evaluate "await fetch('/api/data').then(r=>r.json())"
99
99
  # fetch() inherits the browser's auth session — use it to
100
100
  # call APIs, inspect responses, or pull data for analysis.`);
101
101
  }