The pr command creates pull requests in repositories that have local changes.
repos pr [OPTIONS] [REPOS]...This command automates the process of creating pull requests. It will:
- Identify repositories with uncommitted changes.
- Create a new branch.
- Add and commit all changes.
- Push the branch to the remote.
- Create a pull request on GitHub.
A GITHUB_TOKEN environment variable is required for authentication.
[REPOS]...: A space-separated list of repository names to create PRs for. If omitted, filters by tags.
--title <TITLE>: The title of the pull request. Default: "Automated changes".--body <BODY>: The body text of the pull request. Default: "This PR was created automatically".--branch <BRANCH>: The name of the new branch to create. If not provided, a name will be generated automatically.--base <BASE>: The base branch for the pull request (e.g.,main,develop). If not provided, the repository's default branch is used.--message <MESSAGE>: The commit message. If not provided, it defaults to the PR title.--draft: Creates the pull request as a draft.--token <TOKEN>: Your GitHub personal access token. Can also be provided via theGITHUB_TOKENenvironment variable.--create-only: A "dry-run" mode. It prepares the PR but does not create it on GitHub.-c, --config <CONFIG>: Path to the configuration file. Defaults torepos.yaml.-t, --tag <TAG>: Filter repositories by tag. Can be specified multiple times.-e, --exclude-tag <EXCLUDE_TAG>: Exclude repositories with a specific tag.-p, --parallel: Execute PR creation in parallel.-h, --help: Prints help information.
This will create a PR in all repositories with changes, using default values for title, body, and branch name.
export GITHUB_TOKEN=your_github_token
repos pr --title "Apply latest security patches"repos pr --branch feature/new-api --base develop --title "Feature: New API"repos pr --title "WIP: Experimental changes" --draftrepos pr -t backend --title "Backend-specific updates"This creates PRs for all repositories except those tagged as legacy.
repos pr -e legacy --title "Modernization updates"