CommandCodeAI / CommandCodeAI/command-code
Request: bless a stable headless contract so a Linux desktop client can embed `cmd`
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 4k
- Fork
- 350
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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:
- Is
--output-format jsonin-pmode a stable contract I can parse? I will ignore unknownevent.typevalues, but I want to know if theresultline shape is versioned anywhere. - Is there a machine-readable model list?
--list-modelsprints a table whilestatus --jsonalready emits JSON. A--jsonflag for models would remove table parsing. - 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?
- Is
cmd loginpluscmd status --jsonthe supported headless auth check? Anything a desktop client should do differently? - Does
-psupport concurrent runs in the same directory, or should the client serialize turns per session? Related: is--continuesafe when no headless session exists yet (it starts fresh in my tests)? - 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.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với các điểm vào headless được nêu trong yêu cầu: cmd -p --output-format json, --list-models, status --json, cmd login và việc xử lý tiếp tục hoặc hủy. So sánh hành vi hiện tại của chúng trong command-code 1.56.0 và xác định những hành vi liên quan đến sự kiện, danh sách mô hình, xác thực, tín hiệu, tính đồng thời và runtime Linux nào có thể được ghi lại hoặc ổn định hóa. Công việc được xem là hoàn tất khi contract được hỗ trợ và mọi flag bắt buộc được đặc tả rõ ràng cho các client như bộ chuyển đổi TypeScript được đề xuất.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- linux, node.js, react, tauri, typescript
- Lĩnh vực
- api, cli, desktop
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Sôi nổi
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100