copilot-cli
giuseppe-trisciuoglio/developer-kit
Delegate tasks to GitHub Copilot CLI with multi-model support and permission controls from Claude Code.
What is copilot-cli?
Runs GitHub Copilot CLI in non-interactive mode with explicit model selection (Claude, GPT, Gemini), granular permission flags, and session management. Use when you need to hand off work to Copilot, compare model outputs, or invoke Copilot programmatically.
- Execute Copilot CLI tasks non-interactively with `-p` prompts and model selection
- Support multiple AI models (Claude, GPT, Gemini) for side-by-side comparison
- Control permissions granularly with `--allow-tool`, `--allow-all-tools`, `--allow-all-paths`, `--allow-all-urls` flags
- Capture and export Copilot sessions to markdown with `--share`
- Resume prior Copilot sessions with `--resume` for continuity
- Run Copilot commands silently for scripted integration
How to install copilot-cli
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill copilot-cli- GitHub Copilot CLI installed and available in PATH
- GitHub authentication configured (`gh auth status` must succeed)
How to use copilot-cli
- 1.Verify Copilot CLI is installed: run `copilot --version` and `gh auth status`
- 2.Formulate your task as a clear English prompt with context, constraints, and expected output
- 3.Choose the appropriate model based on task complexity (Opus/GPT-5 for deep reasoning, Sonnet for balanced tasks, Haiku for quick iterations)
- 4.Select minimal required permissions: use `--allow-tool` for narrow scope, `--allow-all-tools` only when multiple tools are needed
- 5.Run the delegation command: `copilot -p "<prompt>" --model <model-name> --allow-all-tools --silent`
- 6.Review Copilot output, validate changes locally (tests, linting, type checks), and apply if appropriate
Use cases
- Delegate code refactoring to a specific model (e.g., GPT-5.2) while staying in Claude Code
- Compare how different models (Sonnet vs. Opus vs. Gemini) approach the same coding task
- Run security or code-quality reviews via Copilot and export results to markdown
- Resume a long-running Copilot analysis session without restarting from scratch
- Invoke Copilot programmatically from a script or automation workflow
- Developers who want to leverage multiple AI models for different task types
- Teams comparing model capabilities on the same codebase
- Engineers automating code review or refactoring workflows
- Users seeking auditability via exported Copilot session transcripts
copilot-cli FAQ
Use this skill when you want a different AI model (GPT-5, Gemini, or a specific Claude version), need to compare model outputs on the same task, or want Copilot's session exported to markdown for review and auditability.
Start with the minimum required: use `--allow-tool '<tool>'` for narrow tasks, `--allow-all-tools` only if multiple tools are clearly needed, and avoid `--yolo` unless explicitly requested. Never grant `--allow-all-paths` or `--allow-all-urls` without justification.
Yes, use `copilot --resume <session-id> --allow-all-tools` to continue from where you left off. Sessions are tracked locally and can be resumed within the same environment.
No. Always validate Copilot output locally: run tests, linting, type checks, and security scans before applying changes. Treat suggestions as proposals, not authoritative solutions.
Add the `--share` flag to your command: `copilot -p "<prompt>" --model <model-name> --allow-all-tools --share`. The session will be exported to a markdown file you can share or archive.
Full instructions (SKILL.md)
Source of truth, from giuseppe-trisciuoglio/developer-kit.
name: copilot-cli description: Provides GitHub Copilot CLI task delegation in non-interactive mode with multi-model support (Claude, GPT, Gemini), permission controls, output sharing, and session resume. Use when users ask to hand work to Copilot, compare models, or run Copilot programmatically from Claude Code. allowed-tools: Bash, Read, Write
Copilot CLI Delegation
Delegate selected tasks from Claude Code to GitHub Copilot CLI using non-interactive commands, explicit model selection, safe permission flags, and shareable outputs.
Overview
This skill standardizes delegation to GitHub Copilot CLI (copilot) for cases where a different model may be more suitable for a task. It covers:
- Non-interactive execution with
-p/--prompt - Model selection with
--model - Permission control (
--allow-tool,--allow-all-tools,--allow-all-paths,--allow-all-urls,--yolo) - Output capture with
--silent - Session export with
--share - Session resume with
--resume
Use this skill only when delegation to Copilot is explicitly requested or clearly beneficial.
When to Use
Use this skill when:
- The user asks to delegate work to GitHub Copilot CLI
- The user wants a specific model (for example GPT-5.x, Claude Sonnet/Opus/Haiku, Gemini)
- The user asks for side-by-side model comparison on the same task
- The user wants a reusable scripted Copilot invocation
- The user wants Copilot session output exported to markdown for review
Trigger phrases:
- "ask copilot"
- "delegate to copilot"
- "run copilot cli"
- "use copilot with gpt-5"
- "use copilot with sonnet"
- "use copilot with gemini"
- "resume copilot session"
Instructions
1) Verify prerequisites
# CLI availability
copilot --version
# GitHub authentication status
gh auth status
If copilot is unavailable, ask the user to install/setup GitHub Copilot CLI before proceeding.
2) Convert task request to English prompt
All delegated prompts to Copilot CLI must be in English.
- Keep prompts concrete and outcome-driven
- Include file paths, constraints, expected output format, and acceptance criteria
- Avoid ambiguous goals such as "improve this"
Prompt template:
Task: <clear objective>
Context: <project/module/files>
Constraints: <do/don't constraints>
Expected output: <format + depth>
Validation: <tests/checks to run or explain>
3) Choose model intentionally
Pick a model based on task type and user preference.
- Complex architecture, deep reasoning: prefer high-capacity models (for example Opus / GPT-5.2 class)
- Balanced coding tasks: Sonnet-class model
- Quick/low-cost iterations: Haiku-class or mini models
- If user specifies a model, respect it
Use exact model names available in the local Copilot CLI model list.
4) Select permissions with least privilege
Default to the minimum required capability.
- Prefer
--allow-tool '<tool>'when task scope is narrow - Use
--allow-all-toolsonly when multiple tools are clearly needed - Add
--allow-all-pathsonly if task requires broad filesystem access - Add
--allow-all-urlsonly if external URLs are required - Do not use
--yolounless the user explicitly requests full permissions
5) Run delegation command
Base pattern:
copilot -p "<english prompt>" --model <model-name> --allow-all-tools --silent
Add optional flags only as needed:
# Capture session to markdown
copilot -p "<english prompt>" --model <model-name> --allow-all-tools --share
# Resume existing session
copilot --resume <session-id> --allow-all-tools
# Strictly silent scripted output
copilot -p "<english prompt>" --model <model-name> --allow-all-tools --silent
6) Return results clearly
After command execution:
- Return Copilot output concisely
- State model and permission profile used
- If
--shareis used, provide generated markdown path - If output is long, provide summary plus key excerpts and next-step options
7) Optional multi-model comparison
When requested, run the same prompt with multiple models and compare:
- Correctness
- Practicality of proposed changes
- Risk/security concerns
- Effort estimate
Keep the comparison objective and concise.
Examples
Example 1: Refactor with GPT model
Input:
Ask Copilot to refactor this service using GPT-5.2 and return only concrete code changes.
Command:
copilot -p "Refactor the payment service in src/services/payment.ts to reduce duplication. Keep public behavior unchanged, keep TypeScript strict typing, and output a patch-style response." \
--model gpt-5.2 \
--allow-all-tools \
--silent
Output:
Copilot proposes extracting three private helpers, consolidating error mapping, and provides a patch for payment.ts with unchanged API signatures.
Example 2: Code review with Sonnet and shared session
Input:
Use Copilot CLI with Sonnet to review this module and share the session in markdown.
Command:
copilot -p "Review src/modules/auth for security and correctness. Report only high-confidence findings with severity and file references." \
--model claude-sonnet-4.6 \
--allow-all-tools \
--share
Output:
Review completed. Session exported to ./copilot-session-<id>.md.
Example 3: Resume session
Input:
Continue the previous Copilot analysis session.
Command:
copilot --resume <session-id> --allow-all-tools
Output:
Session resumed and continued from prior context.
Best Practices
- Keep delegated prompts in English and highly specific
- Prefer least-privilege flags over blanket permissions
- Capture sessions with
--sharewhen auditability matters - For risky tasks, request read-only analysis first, then apply changes in a separate step
- Re-run with another model only when there is clear value (quality, speed, or cost)
Constraints and Warnings
- Copilot CLI output is external model output: validate before applying code changes
- Never include secrets, API keys, or credentials in delegated prompts
--allow-all-tools,--allow-all-paths,--allow-all-urls, and--yoloincrease risk; use only when justified- Do not treat Copilot suggestions as authoritative without local verification (tests/lint/type checks)
For additional option details, see references/cli-command-reference.md.
Related skills
More from giuseppe-trisciuoglio/developer-kit and the wider catalog.

create-pr-from-spec
Automate GitHub PR creation from specifications using pull_request_template.md

docs-updater
Automatically sync README, CHANGELOG, and docs with git changes since the last release tag.

drawio-logical-diagrams
Create professional logical flow, architecture, and process diagrams in draw.io XML format.

drizzle-orm-patterns
Type-safe database patterns for Drizzle ORM across PostgreSQL, MySQL, SQLite, MSSQL, and CockroachDB.

dynamodb-toolbox-patterns
TypeScript patterns for type-safe DynamoDB access with DynamoDB-Toolbox v2 and AWS SDK v3.

gemini
Delegate large-context analysis and complex reasoning tasks to Gemini 3.0 Flash or Pro models via CLI.