
独立的 Go CLI 通过 Chrome DevTools 协议驱动 ZCode 桌面应用(Electron)——与你的编码代理聊天,并从终端检查应用状态。基于 cdp2cli 构建。
概览
— 目标应用ZCode 3.11.2(Electron 41 / Chrome 146),CDP端口9227,2026-09-10进行实时验证。 zcodecli 是一个独立的 Go 命令行客户端,用于本地 ZCode Electron 应用。它通过 Chrome DevTools 协议在 9227 端口驱动应用。 读取命令直接调用冻结的 window.zcode contextBridge 方法。聊天命令实际上驱动代理通过渲染器的工作空间服务(创建会话、发送提示和收集完成的回复),zcodecli 通过页面内的 React 光纤树移动到达。不安装钩子,冻结桥也从未被包裹。 Makefile 使用 -ldflags=“-linkmode=external” 以避免 macOS Go 链接器LC_UUID问题。 先用本地调试端口启动应用: 业务命令不会无声重启应用。如果调试端口关闭,先运行启动。
概述(AI 翻译)
自动生成 cdp2cli — 目标应用 ZCode 3.11.2(Electron 41 / Chrome 146),CDP端口
9227,2026-09-10进行实时验证。
zcodecli 是本地 ZCode Electron 应用的独立 Go 命令行客户端。它通过 Chrome DevTools 协议在 9227 端口驱动应用。
读取命令直接调用冻结的window.zcode contextBridge方法。聊天命令实际上驱动代理(创建会话、发送提示和收集完成回复)通过渲染器的工作空间服务,zcodecli通过页面内的React光纤树移动到达。不安装钩子,冻结桥也从未被封装。
建造
Makefile 使用 -ldflags="-linkmode=external" 来避免 macOS Go 链接器 LC_UUID 的问题。
发展
使用
先用本地调试端口启动应用:
业务命令不会静默重启应用。如果调试端口关闭,先运行 start。
聊天命令(用于驱动当前开放工作区中的代理):
chat new 和 chat send 阻塞,直到代理完成回合,然后打印最终回复文本(而不仅仅是提交确认)。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
zcodecli
Auto-generated with cdp2cli — target app ZCode 3.11.2 (Electron 41 / Chrome 146), CDP port
9227, live-verified 2026-09-10.
zcodecli is a standalone Go command-line client for the local ZCode Electron app. It drives the app through Chrome DevTools Protocol on port 9227.
Read commands call the frozen window.zcode contextBridge methods directly. Chat commands actually drive the agent (create sessions, send prompts, and collect the finished reply) through the renderer’s workspace services, which zcodecli reaches by walking the in-page React fiber tree. No hooks are installed and the frozen bridge is never wrapped.
Build
make build
The Makefile uses -ldflags="-linkmode=external" to avoid the macOS Go linker LC_UUID issue.
Development
make fmt
make vet
make test
make build
Use
Start the app with the local debug port first:
./zcodecli start
Business commands do not restart the app silently. If the debug port is closed, run start first.
Chat commands (these drive the agent in the currently open workspace):
./zcodecli chat list
./zcodecli chat show # most recent messages
./zcodecli chat show --all # full history
./zcodecli chat new "reply with the word ok" # create a session, send a prompt, wait for the reply
./zcodecli chat send "follow up" # continue a session, wait for the reply
chat new and chat send block until the agent finishes its turn and then print the final reply text (not just a submission acknowledgement). A turn that stops on a permission/approval prompt, reports an error, or does not finish within the timeout exits non-zero. Session ids always come from chat list or the chat new output.
Read commands:
./zcodecli status
./zcodecli ssh list
./zcodecli system locale
./zcodecli system device-id
./zcodecli editors list
./zcodecli docker status
./zcodecli docker containers
./zcodecli wsl list
./zcodecli updates status
./zcodecli window state
./zcodecli remote status
./zcodecli desktop activity
./zcodecli community status
./zcodecli explore methods
./zcodecli skill prints the built-in agent guide (compiled into the binary).
Every business command supports --json for single-line JSON. The default output is a human-readable table. Contract mismatches and connection errors exit non-zero.
Stop the debug-enabled app when finished:
./zcodecli stop
Safety
The debug port is a plaintext local control surface for a logged-in application. Keep it closed when not in use. The CLI serializes local CDP operations with a lock and closes its WebSocket after each command.
推荐工具
换一个关键词,或者移除筛选条件。
安装
npx skillfish add williamfzc/zcode-cli