Skip to content
Latchkey

tea pr: Create and List Gitea Pull Requests

tea pr create opens a pull request on a Gitea or Forgejo instance from the command line.

Once tea login is set up, tea pr is how you open, list, and merge pull requests against a self-hosted Gitea or Forgejo repo inside a pipeline.

What it does

tea pr groups pull-request operations. create opens a PR from a head branch into a base branch, list shows open PRs, and merge merges one by index using a chosen strategy.

Common usage

Terminal
# open a PR from the current branch
tea pr create --repo owner/repo \
  --head feature-x --base main --title "Add feature X"
# list open PRs, merge one non-interactively
tea pr list --repo owner/repo
tea pr merge 42 --repo owner/repo --style squash

Options

FlagWhat it does
--repo owner/repoTarget repository
--head <branch>Source branch for the PR
--base <branch>Target branch (default the repo default)
--title <t>PR title (avoids the interactive prompt)
--description <d>PR body
--login <name>Which configured login to use
--style <s>Merge style: merge, rebase, squash (with tea pr merge)

In CI

Pass --title (and --repo, --head, --base) so create runs without prompts. If you configured multiple tea logins, pass --login to pin the right instance rather than relying on the default.

Common errors in CI

"Error: Please specify a repo" means --repo was omitted and tea could not infer it from the remote. "422 Unprocessable Entity" on create usually means a PR already exists for that head/base or the head branch was not pushed. "401 Unauthorized" means the login token is invalid. "unknown login" means the --login name is not registered.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →