Project

spreen-pr

0.0
The project is in a healthy, maintained state
Spreen — the falcon's stoop, then the preen. Derives a pull request title and labels from a topic branch name shaped {user}/{issue}/{category}/{summary} (with a hotfix special case) and prints them as plain text or JSON via the pr-title CLI, defaulting to the current git branch.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

Actions Status: PyPI - CI Actions Status: PyPI - Daily Dependencies Update Actions Status: RubyGem - CI Actions Status: RubyGem - Daily Dependencies Update Actions Status: CodeQL

spreen-pr

spreen-pr: an origami falcon stooping from the branch tip into the golden merge across a falcon's-eye stone, leaving it preened clean

Derives a pull request title and labels from a topic branch name that follows the {user}/{issue}/{category}/{summary} convention, ready to paste into the PR form.

The tool ships twice with identical behaviour: as the RubyGems gem spreen-pr and as the PyPI library spreen-pr.
Both install the same pr-title command.

1. Origin of the Name

stoop + preen = spreen — dive on the scattered branch name, then groom it into a polished title.
The icon tells the story: the origami falcon (隼 /hayabusa/) mid-stoop across the falcon's-eye stone, diving from the topic branch's tip commit into the golden merge, gleams of the preen sparkling in its wake — the pull request, settled and clean.

The full legend behind the spreen name — the falcon man, the stone in the rice field, and the falcon's-eye quartz — is told in spreen-wiki's README.
spreen-pr is part of the spreen-* toolchain (spreen-wiki, spreen-pr, spreen-tracks, spreen-clean): tools that take something scattered and return it settled.

2. Quickstart

Install one of the two implementations:

$ gem install spreen-pr
$ pipx install spreen-pr

(pip install spreen-pr works too if you prefer managing the environment yourself.)

Run it inside your topic branch — with no argument the current git branch (git branch --show-current) is used, which is the day-to-day case:

$ git switch hayat01sh1da/issue-89/service/improve-onboarding-flow
$ pr-title
[service] Improve Onboarding Flow

Or pass a branch name explicitly; --format json prints the title and the labels separately for scripting and CI:

$ pr-title hayat01sh1da/issue-90/hotfix/service/fix_login_crash --format json
{"title":"[Hotfix][service] Fix Login Crash","labels":["Hotfix","service"]}

Run pr-title --help for the full flag list; --version prints the version.
Both packages also expose the logic as a library — see the per-language READMEs in § 4.

3. Branch-Name Convention

The tool is opinionated: it assumes topic branches are named

{user}/{issue}/{category}/{summary}

with the hotfix special case

{user}/{issue}/hotfix/{category}/{summary}

The {summary} may be snake_case or kebab-case; each word is capitalised into the title.
The {category} becomes the PR label verbatim; hotfix additionally becomes a capitalised Hotfix label.

Branch Name PR Title Labels
hayat01sh1da/issue-89/service/improve-onboarding-flow [service] Improve Onboarding Flow service
hayat01sh1da/issue-89/service/improve_onboarding_flow [service] Improve Onboarding Flow service
hayat01sh1da/issue-90/hotfix/service/fix_login_crash [Hotfix][service] Fix Login Crash Hotfix, service

Branch names that do not match the shape fail with a clear error instead of producing a broken title.

4. Development

5. Background

The story behind the tool: Creation of A Shorthand Command to Generate Pull Request Title with Label from a Topic Branch Name