Copilot pour CLI peut ouvrir des issues GitHub pour vous depuis le terminal. Au lieu de passer à un navigateur et de remplir manuellement un problème, vous décrivez ce que vous souhaitez et Copilot rassemble le contexte à partir de votre référentiel et GitHub, puis créez le problème pour que vous puissiez continuer à travailler.
Exemple de scénario 1 : Classement d’un problème à partir d’un échec CI
Votre CI échoue ou vous avez repéré des erreurs dans les journaux de production. Au lieu de remonter manuellement la trace de pile jusqu’à un commit, vous demandez à Copilot pour CLI d’enquêter et d’ouvrir le ticket pour vous.
Exemple d’invite
The CI workflow on main has been failing since yesterday. Look at the failing run, figure out what's breaking and which commit likely introduced it, then create an issue with the stack trace, a link to the failing run, and the suspected PR that caused it. Label it "bug" and "regression".
The CI workflow on main has been failing since yesterday. Look at the failing
run, figure out what's breaking and which commit likely introduced it, then
create an issue with the stack trace, a link to the failing run, and the
suspected PR that caused it. Label it "bug" and "regression".
Exemple de réponse
Remarque
La réponse suivante est un exemple. Les réponses Discussion avec Copilot ne sont pas déterministes, vous pouvez donc obtenir une réponse différente de celle affichée ici.
Copilot pour CLI utilise ses outils MCP GitHub pour :
-
Récupérez l’exécution du flux de travail défaillant et extrayez la trace de la pile à partir des journaux.
-
Identifiez le code responsable ( par exemple,
src/services/payment.ts:94. -
Recherchez les commits récents concernant ce fichier et trouvez la PR qui a introduit la modification.
-
Créez un problème avec tout le contexte assemblé :
Created issue #421: Regression: PaymentService throws TypeError after #398 What's failing: The `build` job on main has failed since commit `a3f7c21`. Stack trace: TypeError: Cannot read properties of undefined (reading 'amount') at processRefund (src/services/payment.ts:94:22) Introduced by: PR #398 (merged 2 days ago) refactored the payment types but missed updating `processRefund` to handle the new nullable `transaction` field. Failing run: Actions run #2847 Suggested fix: Add a null check for `transaction` before accessing `transaction.amount` on line 94. Labels: `bug`, `regression`
Exemple de scénario 2 : Transformer les TODO en travail suivi
Au fil du temps, les commentaires TODO et FIXME s’accumulent dans une base de code sans visibilité. Vous pouvez demander Copilot pour CLI de rechercher ces commentaires, d’évaluer la priorité et de créer des problèmes afin que le travail soit suivi.
Exemple d’invite
Scan this repo for TODO and FIXME comments. Group them by area, pick the 5 most important ones based on the surrounding code context, and create an issue for each. Include the code snippet, file location, and suggest a label.
Scan this repo for TODO and FIXME comments. Group them by area, pick the 5
most important ones based on the surrounding code context, and create an issue
for each. Include the code snippet, file location, and suggest a label.
Exemple de réponse
Remarque
La réponse suivante est un exemple. Les réponses Discussion avec Copilot ne sont pas déterministes, vous pouvez donc obtenir une réponse différente de celle affichée ici.
Copilot pour CLI recherche le codebase, lit le contexte autour de chaque commentaire et hiérarchise en fonction de la gravité :
Found 23 TODO/FIXME comments across the repo. Here are the 5 I'd prioritize:
Created issue #422: FIXME: SQL injection risk in search query builder
- src/db/search.ts:34 — user input concatenated directly into query string
- Label: security, priority:high
Created issue #423: TODO: Rate limiter bypassed for internal routes
- src/middleware/rate_limit.ts:12 — comment says "temporary bypass, remove before launch"
- Label: security, technical-debt
Created issue #424: FIXME: Memory leak in WebSocket handler
- src/ws/handler.ts:87 — listeners are added on each connection but never cleaned up
- Label: bug, performance
Created issue #425: TODO: Retry logic missing for payment webhook
- src/webhooks/payment.ts:56 — failures silently dropped, no retry queue
- Label: reliability, priority:medium
Created issue #426: TODO: Migrate to new auth token format
- src/auth/token.ts:3 — comment references a closing down API version
- Label: technical-debt