AgenticCode — GitHub Integration
Create Pull Request
CLI Tool Name: create_pr
Opens a pull request in a GitHub repository. Built with a two-step verification flow: the agent previews changes using confirmed=false before executing them. This eliminates accidental PR creations when drafting branches.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| repo | string | yes | GitHub repo in 'owner/repo' format. |
| title | string | yes | Pull request title. |
| head | string | yes | The branch containing your changes. |
| body | string | no | Pull request description (markdown). |
| base | string | no | The target branch to merge into. Default: repo's default branch. |
| draft | boolean | no | Open as a draft PR. Default: false. |
| confirmed | boolean | no | Must be true to execute. When false (default), returns preview. |
Example output
json
{
"status": "success",
"action": "create",
"pr_url": "https://github.com/myorg/myrepo/pull/43",
"pr_number": 43
}How to use it
Your assistant can instantly draft and file pull requests for you as soon as you push your code to your remote:
example prompt
Create a pull request in 'myorg/myrepo' from 'feature/login' to 'main' titled 'Implement OAuth login'.
[note]
GitHub Token required. Configure your token via the GUI Hub or by setting the
GITHUB_TOKEN environment variable in your AI client. Note that it needs repository write permissions.