CommandCodeAI / CommandCodeAI/command-code

Request: bless a stable headless contract so a Linux desktop client can embed `cmd`

未關閉
#879 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
沒有語言資料
星號
4k
分支
350
PR 合併指標
30 天內沒有已合併 PR

描述

Request: bless a stable headless contract so a Linux desktop client can embed cmd

Hi, I maintain MonoCode Linux, a Tauri + React desktop app that puts several coding CLIs behind one composer. Each provider gets a small adapter: the app spawns the CLI, streams its events into the transcript, and maps approvals, questions, cancel, resume, and model lists.

I want to add Command Code as a provider and I have headless mode mostly mapped: cmd -p --output-format json gives NDJSON events plus a final result line, --verbose prints the session id on stderr for later --resume, transcripts persist per directory under ~/.commandcode/projects/, and without --yolo file writes and shell commands stay blocked, which fits a supervised mode.

Before I wire up the adapter, I need a few things nailed down so it does not depend on behavior that might change:

  1. Is --output-format json in -p mode a stable contract I can parse? I will ignore unknown event.type values, but I want to know if the result line shape is versioned anywhere.
  2. Is there a machine-readable model list? --list-models prints a table while status --json already emits JSON. A --json flag for models would remove table parsing.
  3. What are the cancel semantics for a headless run? SIGINT/SIGTERM maps to exit 130. Does the transcript stay resumable after a kill, and is there a preferred way to stop a run from a parent process?
  4. Is cmd login plus cmd status --json the supported headless auth check? Anything a desktop client should do differently?
  5. Does -p support concurrent runs in the same directory, or should the client serialize turns per session? Related: is --continue safe when no headless session exists yet (it starts fresh in my tests)?
  6. Anything Linux-specific to know? The npm package needs Node 22+, which matters for an AppImage that resolves its own runtime search path.

What I can offer back: a reference adapter in TypeScript that spawns cmd -p --output-format json, maps the NDJSON stream onto transcript events, and handles resume, cancel, and model switching. Happy to shape it to whatever contract you bless, or to test an unstable flag and report back.

Tested on: command-code 1.56.0, Node v22.23.2, Linux x64.

貢獻指南

這個儲存庫沒有索引到貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從請求中列出的 headless 進入點開始:cmd -p --output-format json--list-modelsstatus --jsoncmd login,以及恢復或取消處理。比較它們在 command-code 1.56.0 中的目前行為,並判斷哪些事件、模型清單、驗證、訊號、並行性與 Linux 執行階段行為可以文件化或穩定化。當為提議的 TypeScript 配接器等用戶端明確指定受支援的契約與任何必要的 flags 後,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
linux, node.js, react, tauri, typescript
領域
api, cli, desktop
Issue 類型
功能
難度
5/5
預估耗時
一週以上
活躍度
活躍
描述清晰度
需要釐清
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。