Skip to main content

Using Copilot cloud agent on GitHub

Start Agent cloud Copilot sessions directly on GitHub, then iterate on the results without leaving your browser.

Qui peut utiliser cette fonctionnalité ?

Agent cloud Copilot est disponible avec les plans GitHub Copilot Pro, GitHub Copilot Pro+, GitHub Copilot Business et GitHub Copilot Enterprise. L’agent est disponible dans tous les référentiels stockés sur GitHub, à l’exception des référentiels détenus par comptes d’utilisateur managés et où il a été désactivé explicitement.
Sign up for Copilot

Introduction

You can start Agent cloud Copilot sessions from several places on GitHub. Once a session is running, you can monitor its progress, steer it with follow-up prompts, and iterate on the resulting pull request—all without leaving the browser.

For more information about Agent cloud Copilot, see À propos de GitHub Copilot agent cloud.

Starting a session from the agents tab or panel

You can start sessions from the agents tab and the agents panel. The only difference is the entry point—once you see the "New agent task" form, the steps are the same.

  1. Ouvrez le panneau ou l’onglet agents :

    • Ouvrez l' onglet Agents dans un référentiel.
    • Accédez à la page des assistants : rendez-vous sur github.com/copilot/agents. Vous pouvez également y accéder en ouvrant le panneau des assistants, puis en cliquant sur Afficher tout.
    • Ouvrez le panneau des assistants : cliquez sur dans la barre de navigation en haut à droite de GitHub.
  2. À l’aide du menu déroulant dans le champ de saisie, sélectionnez le référentiel dans lequel vous souhaitez Copilot travailler.

  3. Saisissez une invite décrivant votre demande. Vous pouvez également ajouter des entrées visuelles telles que des captures d’écran ou des maquettes d’interface utilisateur en collant, en faisant glisser ou en chargeant une image. Fichiers pris en charge : image/png, image/jpeg, image/gif, image/webp.

    Par exemple : Implement a user friendly message for common errors.

    Si vous souhaitez Copilot ouvrir une pull request, vous pouvez le demander dans votre invite, par exemple Open a pull request to implement a user friendly message for common errors.

  4. Si vous le souhaitez, sélectionnez une branche de base pour les modifications de Copilot. Copilot créera une nouvelle branche basée sur cette branche.

  5. Si vous le souhaitez, vous pouvez cliquer sur pour ouvrir le menu déroulant de l'agent, afin d'affecter un agent ou un élément avec un comportement spécialisé et des outils assistant personnalisé. Vous pouvez sélectionner un élément existant assistant personnalisé à partir de votre dépôt, de votre organisation ou de votre entreprise. Vous pouvez également cliquer sur Créer un agent pour créer un nouveau profil d’agent dans votre référentiel et branche sélectionnés. Pour plus d’informations, consultez « Création d’agents personnalisés pour Agent cloud Copilot ».

    Remarque

    Les agents tiers sont disponibles dans les plans GitHub Copilot Pro, GitHub Copilot Pro+, GitHub Copilot Business, et GitHub Copilot Enterprise.

  6. Si vous le souhaitez, vous pouvez utiliser le menu déroulant pour sélectionner le modèle, que Copilot utilisera. Pour plus d’informations, consultez « Modification du modèle IA pour GitHub Copilot agent cloud ».

  7. Cliquez ou appuyez sur Entrée.

Copilot démarre une nouvelle session, qui apparaît dans la liste sous la zone d’invite. Copilot travaillera sur la tâche et envoie (push) les modifications de code.

Vous pouvez suivre Copilot le travail et ouvrir une pull request en un clic dans les journaux de session. Pour plus d’informations, consultez « [AUTOTITLE](/copilot/how-tos/use-copilot-agents/cloud-agent/track-copilot-sessions) ».

Starting a session from the dashboard

You can ask Copilot to start work from the prompt box in the dashboard. The dashboard is your personalized overview of your activity on GitHub, seen when you visit https://github.com while logged in.

  1. Navigate to the dashboard at https://github.com.

  2. Click the Task button.

  3. Using the dropdown menu in the prompt field, select the repository you want Copilot to work in.

  4. Type a prompt describing your request.

    For example, Implement a user friendly message for common errors.

    If you want Copilot to open a pull request, you can ask in your prompt, for example Open a pull request to implement a user friendly message for common errors.

  5. Optionally, select a base branch for Copilot's pull request. Copilot will create a new branch based on this branch.

  6. Si vous le souhaitez, vous pouvez cliquer sur pour ouvrir le menu déroulant de l'agent, afin d'affecter un agent ou un élément avec un comportement spécialisé et des outils assistant personnalisé. Vous pouvez sélectionner un élément existant assistant personnalisé à partir de votre dépôt, de votre organisation ou de votre entreprise. Vous pouvez également cliquer sur Créer un agent pour créer un nouveau profil d’agent dans votre référentiel et branche sélectionnés. Pour plus d’informations, consultez « Création d’agents personnalisés pour Agent cloud Copilot ».

    Remarque

    Les agents tiers sont disponibles dans les plans GitHub Copilot Pro, GitHub Copilot Pro+, GitHub Copilot Business, et GitHub Copilot Enterprise.

  7. Click Send now or press Return.

    You will be taken to the agents tab, and Copilot will start a new session, which will appear in the "Recent sessions" list below the prompt box. Copilot will work on the task and push any code changes.

    Remarque

    If you have enabled the New Dashboard Experience in feature preview, the new session will appear in "Agent sessions" under the prompt box in your dashboard. For more information, see Tableau de bord personnel.

Starting from Copilot Chat

  1. Open GitHub Copilot Chat on GitHub.com.

  2. Type /task to ask Copilot to create a pull request, and give details of what you want Copilot to change.

    For example, /task Create a pull request to put backticks around file names and variables in output.

  3. Optionally, select a base branch for Copilot's pull request. Copilot will create a new branch based on this branch, then push the changes to a pull request targeting that branch.

  4. Si vous le souhaitez, vous pouvez cliquer sur pour ouvrir le menu déroulant de l'agent, afin d'affecter un agent ou un élément avec un comportement spécialisé et des outils assistant personnalisé. Vous pouvez sélectionner un élément existant assistant personnalisé à partir de votre dépôt, de votre organisation ou de votre entreprise. Vous pouvez également cliquer sur Créer un agent pour créer un nouveau profil d’agent dans votre référentiel et branche sélectionnés. Pour plus d’informations, consultez « Création d’agents personnalisés pour Agent cloud Copilot ».

    Remarque

    Les agents tiers sont disponibles dans les plans GitHub Copilot Pro, GitHub Copilot Pro+, GitHub Copilot Business, et GitHub Copilot Enterprise.

  5. Click or press Enter.

    Copilot will start a new session, which will appear in the list below the prompt box. Copilot will work on the task and push changes to its pull request, then add you as a reviewer when it has finished, triggering a notification.

Assigning an issue to Copilot

You can ask Copilot to start working on an issue by assigning the issue to Copilot. Copilot will start working on the task, raise a pull request, then request a review from you when it's finished.

Remarque

This feature is in préversion publique and subject to change.

  1. Sur GitHub, accédez à la page principale du référentiel.

  2. Sous le nom de votre référentiel, cliquez sur Problèmes.

    Capture d’écran de la page principale d’un dépôt. Dans la barre de navigation horizontale, un onglet intitulé « Problèmes » est indiqué en orange foncé.

  3. Open the issue that you want to assign to Copilot.

  4. In the right side menu, click Assignees.

    Screenshot of the right sidebar of an issue. A header, labeled "Assignees", is outlined in dark orange.

  5. Click Copilot from assignees list.

    Screenshot of "Assignees" window on an issue. Copilot is available in the list.

    Additional options are displayed.

    Screenshot of "Assign to Copilot" dialog showing options for target repository, starting branch, assistant personnalisé, and additional instructions.

  6. In the Optional prompt field you can add specific guidance for Copilot. Add any context, constraints, or specific requirements that will help Copilot to understand and complete the task.

    For example, you might include instructions about specific coding patterns or frameworks to use, testing requirements, code style preferences, files or directories that should or shouldn't be modified.

    In addition to the details you supply here, Copilot will use any custom instructions that have been configured for the target repository. See Ajout d’instructions personnalisées de référentiel pour GitHub Copilot.

  7. You can use the dropdown menus in the dialog to change the repository that Copilot will work in and the branch that it will branch off from.

    All repositories where you have at least read access will be displayed in the repository dropdown menu. However, you can only select a repository if you have write access to it, and if Agent cloud Copilot is enabled for that repository.

    If you select a repository in a different organization than the issue's source organization, or if you select a public repository when the issue is in a private repository, a warning will be displayed.

    If you don't specify a repository, Copilot will work in the same repository as the issue. If you don't specify a branch, Copilot will work from the default branch of the selected repository.

    Conseil

    When you assign an issue to Copilot, it gets sent the issue title, description, any comments that currently exist, and any additional instructions you provide. After assigning the issue, Copilot will not be aware of, and therefore won't react to, any further comments that are added to the issue. If you have more information, or changes to the original requirement, add this as a comment in the pull request that Copilot raises.

  8. Si vous le souhaitez, vous pouvez cliquer sur pour ouvrir le menu déroulant de l'agent, afin d'affecter un agent ou un élément avec un comportement spécialisé et des outils assistant personnalisé. Vous pouvez sélectionner un élément existant assistant personnalisé à partir de votre dépôt, de votre organisation ou de votre entreprise. Vous pouvez également cliquer sur Créer un agent pour créer un nouveau profil d’agent dans votre référentiel et branche sélectionnés. Pour plus d’informations, consultez « Création d’agents personnalisés pour Agent cloud Copilot ».

    Remarque

    Les agents tiers sont disponibles dans les plans GitHub Copilot Pro, GitHub Copilot Pro+, GitHub Copilot Business, et GitHub Copilot Enterprise.

  9. Si vous le souhaitez, vous pouvez utiliser le menu déroulant pour sélectionner le modèle, que Copilot utilisera. Pour plus d’informations, consultez « Modification du modèle IA pour GitHub Copilot agent cloud ».

You can also assign issues to Copilot from other places on GitHub.com:

  • From the list of issues on a repository's Issues page.
  • When viewing an issue in GitHub Projets.

Seeding a new repository

When creating a new repository, you can ask Copilot to seed the new repository by entering a prompt.

  1. Dans le coin supérieur droit de n’importe quelle page, sélectionnez sur , puis cliquez sur Nouveau référentiel.

    Capture d’écran d’un menu déroulant GitHub montrant les options permettant de créer des éléments. L’élément de menu « Nouveau référentiel » est souligné en orange foncé.

  2. Utilisez le menu déroulant Propriétaire pour sélectionner le compte auquel vous voulez donner la propriété du dépôt.

    Capture d’écran du menu propriétaire d’un nouveau dépôt GitHub. Le menu montre deux options, octocat et github.

  3. In the Prompt field, enter a prompt describing what you want Copilot to build.

    For example, Create a Rust CLI for converting CSV spreadsheets to Markdown

  4. Cliquez sur Créer le dépôt.

    Copilot will immediately open a draft pull request. Copilot will work on the task and push changes to its pull request, then add you as a reviewer when it has finished, triggering a notification.

Fixing a failing GitHub Actions workflow run

Remarque

This feature is only available to Copilot Business and Copilot Entreprise users.

When an GitHub Actions workflow run fails on a pull request branch, you can ask Copilot to investigate and fix the failure.

  1. On GitHub, navigate to the failing workflow run job page.

  2. Click the Fix with Copilot button.

    Copilot will start a new session, investigate the cause of the failure, and push a fix to your branch.

Continuing work on a pull request

You can mention @copilot in a comment on any pull request to ask Copilot to make changes. This works on pull requests created by Copilot and on pull requests you or others created.

By default, Copilot pushes commits directly to the pull request branch. To create a separate pull request instead, describe that in your comment. You can also check out the branch and push changes yourself.

Batch review comments instead of submitting them individually. When submitting a pull request comment (not a review or review comment) through the GitHub web interface, select a model with the model picker. Copilot uses the model from the original pull request by default.

Copilot répond uniquement aux commentaires des personnes qui ont accès en écriture au référentiel.

When Copilot starts a new session in response to your comment, an eyes emoji (👀) reaction appears on the comment. A "Copilot has started work" event appears in the pull request timeline.

Screenshot of a pull request timeline with a review comment with the eyes reaction and a "Copilot started work" timeline event.

Copilot remembers context from previous sessions on the same pull request, so follow-up requests are faster and more reliable. If the pull request was created by a assistant personnalisé, mentioning @copilot continues using that same agent.

Resolving merge conflicts

You can ask Copilot to resolve merge conflicts on a pull request in two ways:

  • Using the "Fix with Copilot" button: If a pull request has merge conflicts, click the Fix with Copilot button that appears in the merge box.
  • Using an @copilot mention: Mention @copilot in a comment on the pull request and ask it to fix the conflicts—for example, "@copilot resolve the merge conflicts on this PR."

Copilot analyzes the conflicting changes, resolves them, and verifies that the build, tests, and linter still pass. It then requests your review so you can confirm the resolution before merging.

Managing GitHub Actions workflow runs

Par défaut, GitHub Actions les flux de travail ne s’exécutent pas automatiquement lorsque Copilot les modifications sont envoyées à une demande de tirage (pull request).

GitHub Actions Les flux de travail peuvent être privilégiés et avoir accès à des secrets sensibles. Inspectez les modifications proposées dans la demande de tirage et assurez-vous que vous êtes à l’aise pour exécuter vos workflows sur la branche de la demande de tirage. Vous devez être particulièrement averti des modifications proposées dans le .github/workflows/ répertoire qui affectent les fichiers de flux de travail.

Pour permettre aux workflows GitHub Actions de s'exécuter, cliquez sur le bouton Approuver et exécuter les workflows dans la boîte de fusion de la pull request.

Capture d’écran de la zone de fusion sur une pull request provenant de Copilot, avec le bouton « Approve and run workflows ».

Si vous le souhaitez, vous pouvez configurer Agent cloud Copilot pour permettre GitHub Actions aux flux de travail de s’exécuter sans intervention humaine. For more information, see Configuration des paramètres pour GitHub Copilot agent cloud.

Giving feedback on Copilot's work

Use the feedback buttons on Copilot's pull requests and comments to rate the output. Your feedback helps improve Copilot's quality.

  1. On a pull request or comment from Copilot, click the thumbs up (👍) or thumbs down (👎) button.
  2. If you click the thumbs down button, optionally select a reason and leave a comment, then click Submit feedback.

Further reading