GitHub Copilot CLI Operator
Use this skill to reliably call Copilot CLI from OpenClaw.
Core rules
- 1. Verify Copilot CLI exists (
copilot --version) before first task. - Always run Copilot through OpenClaw
exec with pty:true. - Always set explicit
workdir to the target repository. - For long tasks, use
background:true and track via process. - Report clear milestones: started, waiting-input, finished/failed.
Execution patterns
One-shot coding task
Use:
- -
exec.command: INLINECODE7 - INLINECODE8 : INLINECODE9
- INLINECODE10 : INLINECODE11
Scoped tool approval
Use --allow-tool and --deny-tool to control what Copilot can do:
- -
exec.command: INLINECODE15 - INLINECODE16 : INLINECODE17
- INLINECODE18 : INLINECODE19
To block dangerous operations:
Interactive session
Use:
- -
exec.command: INLINECODE22 - INLINECODE23 : INLINECODE24
- INLINECODE25 : INLINECODE26
Long-running background task
- 1. Start with INLINECODE27
- Record returned
sessionId. - Poll with
process action:poll. - Read output with
process action:log. - If Copilot asks for input, use
process action:submit.
Resume a previous session
Use:
- -
exec.command: copilot --resume (select from list) - INLINECODE34 :
copilot --continue (resume most recent)
Recommended prompts
- - "Implement with tests, run tests, and summarize changed files."
- "Find root cause for failing CI in this repo and propose minimal fix."
- "Review current branch diff and list high-risk issues first."
- "Work on issue https://github.com/owner/repo/issues/123 in a new branch."
- "Create a PR that updates the README with the latest API usage."
Guardrails
- - Do not claim files were changed unless logs show completion.
- If
copilot is missing or auth fails, return exact remediation steps. - Keep OpenClaw tool config (
pty/workdir/background) separate from CLI args. - Prefer
--allow-tool with specific scopes over --allow-all-tools for safety. - Use
--deny-tool 'shell(rm)' when working in directories with important data.
References
- - INLINECODE41
- INLINECODE42
- INLINECODE43
GitHub Copilot CLI 操作器
使用此技能可靠地从OpenClaw调用Copilot CLI。
核心规则
- 1. 在首次任务前验证Copilot CLI是否存在(copilot --version)。
- 始终通过OpenClaw exec 运行Copilot,并设置 pty:true。
- 始终将显式 workdir 设置为目标仓库。
- 对于长时间任务,使用 background:true 并通过 process 进行跟踪。
- 报告清晰的里程碑:已启动、等待输入、已完成/失败。
执行模式
一次性编码任务
使用:
- - exec.command:copilot -p <任务> --allow-all-tools
- exec.pty:true
- exec.workdir:<仓库路径>
限定工具授权
使用 --allow-tool 和 --deny-tool 控制Copilot可执行的操作:
- - exec.command:copilot -p <任务> --allow-tool shell(git) --allow-tool write
- exec.pty:true
- exec.workdir:<仓库路径>
阻止危险操作:
- - copilot -p <任务> --allow-all-tools --deny-tool shell(rm) --deny-tool shell(git push)
交互式会话
使用:
- - exec.command:copilot
- exec.pty:true
- exec.workdir:<仓库路径>
长时间运行的后台任务
- 1. 使用 exec(background:true, pty:true, workdir, command:copilot -p ... --allow-all-tools) 启动
- 记录返回的 sessionId
- 使用 process action:poll 轮询
- 使用 process action:log 读取输出
- 如果Copilot请求输入,使用 process action:submit
恢复之前的会话
使用:
- - exec.command:copilot --resume(从列表中选择)
- exec.command:copilot --continue(恢复最近的会话)
推荐提示
- - 实现<功能>并编写测试,运行测试,总结修改的文件。
- 查找此仓库中CI失败的根本原因,并提出最小修复方案。
- 审查当前分支差异,首先列出高风险问题。
- 在新分支上处理问题 https://github.com/owner/repo/issues/123。
- 创建一个PR,使用最新的API用法更新README。
安全护栏
- - 除非日志显示完成,否则不要声称文件已被修改。
- 如果 copilot 缺失或认证失败,返回确切的修复步骤。
- 将OpenClaw工具配置(pty/workdir/background)与CLI参数分开。
- 为安全起见,优先使用带有特定作用域的 --allow-tool,而非 --allow-all-tools。
- 在包含重要数据的目录中工作时,使用 --deny-tool shell(rm)。
参考
- - references/copilot-doc-summary.md
- references/copilot-usage-recipes.md
- scripts/run-copilot-example.sh