Skip to main content
commitdog pr does different things depending on which branch you are on. On a feature branch it walks you through creating a pull request: you review a diff, enter a title and description, and commitdog creates the PR and opens it in your browser. On main or master it fetches all open PRs, lets you navigate them with keyboard shortcuts, view their diffs, and merge or close them without leaving the terminal. commitdog pr works with GitHub, GitLab, Gitea, and Forgejo. It targets your project’s primary platform, which is set during commitdog init and stored in the .commitdog file. If no primary platform is set, commitdog uses GitHub. On GitLab, the same flow creates and merges merge requests instead of pull requests.
Configure a token for your platform with commitdog setup before using this command. If commitdog does not find a token for the project’s platform, it exits with an error telling you to run commitdog setup.

Usage

The behavior is determined automatically by your current branch.

Creating a PR

1

Review the diff

commitdog shows an interactive list of files changed between your branch and the base branch, with insertion and deletion counts for each file. Navigate with j/k or the arrow keys and press d to view the inline diff for any file. Press q to proceed.
2

Enter a title and description

commitdog pre-fills the title with your last commit subject. Press Enter to accept it or type a replacement. The description is optional.
3

PR is created and opened

commitdog calls your platform’s API and prints the PR number and URL:
Press Enter or y to open the PR in your default browser.On GitLab, commitdog creates a merge request and prints it with GitLab’s ! numbering: