Skip to main content

Using Copilot cloud agent from the GitHub CLI

Start and track Copilot облачный агент sessions from the GitHub CLI.

Кто может использовать эту функцию?

Copilot облачный агент доступна с GitHub Copilot Pro, GitHub Copilot Pro+, GitHub Copilot для бизнеса и GitHub Copilot Enterprise планами. Агент доступен во всех репозиториях, хранящихся на GitHub, за исключением тех, которые принадлежат управляемые учетные записи пользователей и где он явно отключен.
Sign up for Copilot

В этой статье

Примечание.

The agent-task command set is only available in v2.80.0 or later of the GitHub CLI. This command set is a Публичный предварительный просмотр and is subject to change.

Starting a session

You can start a new Copilot облачный агент session with the gh agent-task create command.

When you run the command without any arguments, you are asked to enter a prompt. Copilot облачный агент acts on the prompt and opens a pull request in the current repository.

You can use command line options to:

  • Provide the prompt (gh agent-task create "Example prompt")
  • Choose a base branch, instead of using the repository's default branch (--base)
  • Select a repository, instead of targeting the current repository (--repo)
  • Follow the session log in real time (--follow)

To see all of the available options, run gh agent-task create --help.

Tracking your sessions

You can see a list of your running and past agent sessions with the gh agent-task list command. The output will show a list of your recent sessions.

To see more information on a specific session, use the gh agent-task view command. For example, to view information about the session associated with pull request #123 in the monalisa/bookstore repository, run gh agent-task view --repo monalisa/bookstore 123.

To view the session logs, add the --log option. Optionally, use the --follow option to stream live logs as the agent works.

To see all of the available options, run gh agent-task list --help or gh agent-task view --help.

Further reading