{"meta":{"title":"Using Copilot cloud agent from the GitHub CLI","intro":"Start and track Copilot cloud agent sessions from the GitHub CLI.","product":"GitHub Copilot","breadcrumbs":[{"href":"/en/copilot","title":"GitHub Copilot"},{"href":"/en/copilot/how-tos","title":"How-tos"},{"href":"/en/copilot/how-tos/use-copilot-agents","title":"Use Copilot agents"},{"href":"/en/copilot/how-tos/use-copilot-agents/cloud-agent","title":"Cloud agent"},{"href":"/en/copilot/how-tos/use-copilot-agents/cloud-agent/use-cloud-agent-from-cli","title":"Use cloud agent from the GitHub CLI"}],"documentType":"article"},"body":"# Using Copilot cloud agent from the GitHub CLI\n\nStart and track Copilot cloud agent sessions from the GitHub CLI.\n\n> \\[!NOTE]\n> The `agent-task` command set is only available in v2.80.0 or later of the GitHub CLI. This command set is a public preview and is subject to change.\n\n## Starting a session\n\nYou can start a new Copilot cloud agent session with the `gh agent-task create` command.\n\nWhen you run the command without any arguments, you are asked to enter a prompt. Copilot cloud agent acts on the prompt and opens a pull request in the current repository.\n\nYou can use command line options to:\n\n* Provide the prompt (`gh agent-task create \"Example prompt\"`)\n* Choose a base branch, instead of using the repository's default branch (`--base`)\n* Select a repository, instead of targeting the current repository (`--repo`)\n* Follow the session log in real time (`--follow`)\n\nTo see all of the available options, run `gh agent-task create --help`.\n\n## Tracking your sessions\n\nYou 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.\n\nTo 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`.\n\nTo view the session logs, add the `--log` option. Optionally, use the `--follow` option to stream live logs as the agent works.\n\nTo see all of the available options, run `gh agent-task list --help` or `gh agent-task view --help`.\n\n## Further reading\n\n* [Managing agent sessions](/en/copilot/how-tos/copilot-on-github/use-copilot-agents/manage-and-track-agents)\n* [Best practices for using GitHub Copilot to work on tasks](/en/copilot/tutorials/cloud-agent/get-the-best-results)"}