CommandCodeAI / CommandCodeAI/command-code

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

オープン
#879 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
言語のデータがありません
スター
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. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

リクエストで指定されている headless エントリポイントから始めます: cmd -p --output-format json--list-modelsstatus --jsoncmd login、および再開またはキャンセルの処理です。command-code 1.56.0 における現在の動作を比較し、イベント、モデル一覧、認証、シグナル、並行性、Linux ランタイムに関するどの動作を文書化または安定化できるかを判断します。提案されている TypeScript アダプターなどのクライアント向けに、サポートされる契約と必要なフラグが明確に仕様化されていれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
linux, node.js, react, tauri, typescript
領域
api, cli, desktop
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
活発
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。