CommandCodeAI / CommandCodeAI/command-code

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

Aperta
#879 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Nessun dato sulla lingua
Stelle
4k
Fork
350
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con i punti di ingresso headless indicati nella richiesta: cmd -p --output-format json, --list-models, status --json, cmd login e la gestione della ripresa o della cancellazione. Confronta il loro comportamento attuale in command-code 1.56.0 e determina quali comportamenti relativi a eventi, elenco dei modelli, autenticazione, segnali, concorrenza e runtime Linux possono essere documentati o stabilizzati. Il lavoro è completato quando il contratto supportato e gli eventuali flag necessari sono specificati chiaramente per client come l’adattatore TypeScript proposto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
linux, node.js, react, tauri, typescript
Ambito
api, cli, desktop
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Attiva
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.