LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

gh-agent

GitHub Copilot CLI custom agent invocation

TLDR

Start interactive Copilot CLI session with a custom agent
$ gh copilot --agent [agent_name]
copy
Run a custom agent with a prompt non-interactively
$ gh copilot --agent [security-auditor] --prompt "[Check /src/app/validator.go]"
copy
Invoke an agent interactively using the slash command
$ /agent [agent_name]
copy
Delegate a task to Copilot coding agent
$ /delegate [task description]
copy

SYNOPSIS

gh copilot --agent name [--prompt text] [options]

DESCRIPTION

gh agent functionality is provided through GitHub Copilot CLI's custom agent system, accessible via `gh copilot --agent` or the `/agent` slash command in an interactive session. Agents are defined by Markdown files with an `.agent.md` extension that specify the agent's name, description, prompt instructions, and available tools.Custom agents can be defined at user level (~/.copilot/agents/), repository level (.github/agents/), or organization level ({org}/.github/agents/). In case of naming conflicts, user-level agents override repository-level, which override organization-level.The `/delegate` slash command commits unstaged changes to a new branch and delegates the task to the Copilot coding agent, which opens a draft pull request and works in the background.

PARAMETERS

--agent name

Specify the custom agent to use (matches the .agent.md filename).
--prompt text
Provide a prompt for programmatic (non-interactive) usage.
--allow-tool tool
Specify tools the agent can use (shell, write, url, MCP server tools).

SEE ALSO

gh-copilot(1), gh(1)

Copied to clipboard
Kai