pi-release
v1.0.0
Published
Pi-native release automation: bump version, create GitHub release, publish to npm
Downloads
51
Maintainers
Readme
pi-release
Pi-native release automation: bump version, generate changelog, create GitHub release, publish to npm.
Installation
pi install npm:pi-releaseWhat It Does
pi-release automates the full release lifecycle for pi.dev packages. It completes the pipeline:
pi-commit-lint → pi-changelog → pi-releaseThree focused tools and one orchestrated /release command handle:
- Version bumping — semver-aware
package.jsonupdates with git commits and tags - GitHub releases — auto-generated release notes via GitHub CLI
- npm publishing — with OTP/2FA support and custom registries
Tools
bump_version
Bump the version in package.json, create a git commit and tag.
bump_version(bump: "patch" | "minor" | "major", pre_release?: "beta", dry_run?: false)Parameters:
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| bump | major \| minor \| patch | patch | Version bump type |
| pre_release | string | — | Pre-release tag (e.g. beta, alpha, rc) |
| dry_run | boolean | false | Preview without making changes |
| message | string | chore(release): {version} | Custom commit message |
create_github_release
Create a GitHub release from a git tag.
create_github_release(tag: "v1.0.0", title?: "Release v1.0.0", notes?: "...", prerelease?: false, dry_run?: false)Parameters:
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| tag | string | required | Git tag to release from |
| title | string | Release {tag} | Release title |
| notes | string | auto-generated | Custom release notes |
| prerelease | boolean | false | Mark as pre-release |
| dry_run | boolean | false | Preview without creating |
Requires GitHub CLI (gh) installed and authenticated.
publish_npm
Publish the package to npm.
publish_npm(otp?: "123456", registry?: "https://...", tag?: "beta", dry_run?: false)Parameters:
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| otp | string | — | One-time password for npm 2FA |
| registry | string | https://registry.npmjs.org/ | npm registry URL |
| tag | string | latest | npm dist-tag |
| dry_run | boolean | false | Preview without publishing |
Command
/release
Orchestrates the full release flow:
/release [major|minor|patch] [--dry-run]Steps:
- 📦 Bump version in
package.json, commit, tag - 📝 Generate changelog from conventional commits
- 🚀 Create GitHub release with auto-generated notes
- 📤 Publish to npm
# Preview a patch release
/release patch --dry-run
# Execute a minor release
/release minor
# Major release
/release majorConfiguration
Create pi-release.json in your project root:
{
"registry": "https://registry.npmjs.org/",
"githubRepo": "owner/repo",
"defaultBump": "patch",
"preReleaseTag": "",
"generateChangelog": true,
"commitBump": true,
"commitMessage": "chore(release): {version}",
"createTag": true,
"tagPrefix": "v",
"createGithubRelease": true,
"publishToNpm": true
}Config options:
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| registry | string | https://registry.npmjs.org/ | npm registry URL |
| githubRepo | string \| null | null (auto-detect) | GitHub owner/repo |
| defaultBump | string | patch | Default bump type for /release |
| preReleaseTag | string | "" | Pre-release tag applied to all releases |
| generateChangelog | boolean | true | Auto-generate changelog |
| commitBump | boolean | true | Commit the version bump |
| commitMessage | string | chore(release): {version} | Commit message template |
| createTag | boolean | true | Create git tag |
| tagPrefix | string | v | Tag prefix (e.g. v1.0.0) |
| createGithubRelease | boolean | true | Create GitHub release |
| publishToNpm | boolean | true | Publish to npm |
Dry Run
All tools support --dry-run mode to preview what would happen without making any changes:
# Via tool
bump_version(bump="minor", dry_run=true)
# Via command
/release minor --dry-runExample Workflow
# 1. Ensure commits follow conventional format
pi> /lint-commits
# 2. Preview the release
pi> /release minor --dry-run
# 3. Execute the release
pi> /release minor
# Output:
# 📦 Version Bump: 1.0.0 → 1.1.0
# 📝 Changelog generated
# 🚀 GitHub Release: https://github.com/owner/repo/releases/tag/v1.1.0
# 📤 Published to npm: [email protected]
# ✅ Release complete!Resources
License
MIT
