Skip to content

[Feature] 内置支持 Command Code(commandcode.ai)agent #531

Description

@azzliang6

Problem / pain point — 现在的痛点

我平时在 Pebrel 里用 Command Code(npm i -g command-code)这个编程 agent CLI。Pebrel 现在内置识别了 Claude Code、Codex、CodeBuddy 等 27 个 agent,但不认识 Command Code:用它的时候标签页不显示 agent 身份,也拿不到恢复/分叉会话的命令,只能当普通 shell 进程用。

Proposed solution — 希望的做法

把 Command Code 作为内置 agent 加进 AgentKind,做法参考之前加 CodeBuddy 的提交(bd7bf9c2):

  • 命令名:识别 command-code、commandcode、cmdc,包括 npx / node 启动的形式。不识别 cmd,否则会把 Windows 的命令提示符和 npm 的 .cmd 包装脚本都误认成 Command Code(官方文档里 Windows 上也是用 cmdc)。
  • 启动:command-code;恢复:command-code --resume <id>;分叉:command-code --resume <id> --fork-session(依据 sessions 和 CLI reference 文档)。
  • 图标:先沿用 CodeBuddy 那个通用机器人字形,不加新的图片素材。
  • 附带回归测试:覆盖 npx/node 路径识别、cmd / cmd.exe 不被误认,以及 resume 命令和不安全 session id 的拒绝。

这一步不包括:设置页 Agents 列表里的 hook 集成、重启后自动恢复会话、agent_detection 状态规则(项目要求用真实截屏写)。Command Code 支持 Claude 风格的 hook(SessionStart / Stop 等,带 session_id),这些可以等 #518 的通用 hook 模块合并后再单独做。

我本地已经有一个实现(2 个文件,约 +64/−1),cargo fmt --check、check_architecture.py、cargo check -p nebula --bin pebrel --features gpui-shell --tests 和相关测试都通过了,没有在 Windows 上实际编译运行过。想先确认两点:

  1. 这个范围可以吗?要不要等 feat(ui): brand and recognize more agent CLIs (14 logos; Junie, OpenHands, OpenClaw, Crush identity) #517(也改了 ai_agents.rs)合并后再基于它提 PR?
  2. 需要配彩色 logo 吗?需要的话我去找官方素材并确认授权。

Alternatives considered — 现在的替代办法

目前只能当普通 shell 进程来用,会话恢复也只能自己手动输入 command-code --resume。我看过 agent-detection/<slug>.toml 覆盖文件,它只能调整已有的内置 agent,不能新增;#323 / #457 是给已有 agent 加恢复参数,也解决不了这个问题。

Platform / 平台

Windows

Related area / 相关范围

AI agent (Claude Code / Codex / Pi / OMP) — AI Agent 集成与状态

How important is this to you? / 对你有多重要

Would improve my daily workflow / 每天都会用到

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: agentsClaude Code / Codex / Pi / OMP 等 agent 集成与状态os: windows仅 Windows 或与 ConPTY/Win32 相关

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions