Skip to content

CLI Reference

This reference is grouped by command:

  • the top-level publish command: pubm [version]
  • management commands such as init, secrets, and sync
  • changeset workflow commands under pubm changesets ...
  • the pubm snapshot command for preview and testing releases

For most day-to-day use, the main command is:

Terminal window
pubm

Running pubm without a version argument follows the interactive path. You choose the next version in the terminal before the release pipeline continues.

CommandPurpose
pubm [version]Run the publish pipeline using a release type or explicit semver.
pubm snapshot [tag]Publish snapshot versions for preview and testing.
pubm initInteractive setup wizard for package detection, config, changesets, CI workflows, and coding agent skills.
pubm setup-skillsDownload and install coding agent skills (Claude Code, Codex, Gemini).
pubm secrets syncPush locally stored tokens into GitHub Secrets through gh.
pubm sync --discoverScan the repository for version references outside manifest files.
pubm updateSelf-update the CLI to the latest published version.
pubm changesets addCreate a new changeset.
pubm changesets statusShow pending changesets and their bump impact.
pubm changesets versionConsume changesets and write new versions.
pubm changesets changelogRender changelog text from pending changesets.
pubm changesets migrateMigrate from .changeset/ to .pubm/.
Terminal window
pubm [version] [flags]

[version] can be:

  • a semver bump type: patch, minor, major
  • a pre-release bump type: prepatch, preminor, premajor, prerelease
  • an explicit version such as 1.8.0

If you omit the version:

  • interactive terminals can prompt for the next version
  • CI runs require the version to be resolved non-interactively
Terminal window
pubm

Typical flow:

  1. run pubm
  2. choose patch, minor, or major
  3. let pubm continue through checks, build, tagging, and publish
Terminal window
pubm
pubm --dry-run
pubm 1.8.0
pubm --registry npm,jsr
pubm --tag beta
FlagDefaultDescription
-d, --dry-runfalseShow the task graph without mutating Git state or publishing.
--mode <mode>localExecution mode: local (interactive) or ci (non-interactive, tag-based).
--phase <phase>-Pipeline phase: prepare (validate and dry-run) or publish (publish from latest tag).
--release-draftfalseCreate a draft GitHub Release instead of a published one.
-b, --branch <name>mainRequire the current branch to match before releasing.
-a, --any-branchfalseDisable the branch guard for the current run.
-t, --tag <name>latestUse a specific dist-tag such as beta or next.
-c, --contents <path>noneChange into a subdirectory before running the release pipeline.
--registry <registries>npm,jsrComma-separated target registries. Supports npm, jsr, crates, or custom registry URLs.
--test-script <script>testScript name used for the test step.
--build-script <script>buildScript name used for the build step.
--no-save-tokenfalseDo not persist supported tokens for later runs.
--dangerously-allow-unpublishfalseAllow registry unpublish/yank during rollback in non-TTY environments.
--locale <locale>enSet CLI output language. Supported: en, ko, zh-cn, fr, de, es.
--create-prfalseCreate a pull request for the version bump instead of pushing directly.
FlagDescription
--no-pre-checkSkip prerequisite checks such as branch and working tree validation.
--no-condition-checkSkip required-condition checks such as token and registry validation.
--no-testsSkip the test step.
--no-buildSkip the build step.
--no-publishRun the pipeline up to publish, but do not actually publish artifacts.
--skip-releaseSkip GitHub Release creation.

The normal mode for local releases:

Terminal window
pubm

Behavior:

  • starts with interactive version selection when no version argument is provided
  • prompts can be shown when required information is missing
  • tests and build run unless skipped
  • versioning, publish, push, and GitHub Release steps run in order
Terminal window
pubm --dry-run

Use dry-run mode when you need to inspect the task plan without side effects.

Terminal window
pubm --mode ci --phase prepare

CI prepare mode:

  • collects missing tokens interactively
  • can sync them to GitHub Secrets
  • switches into non-interactive behavior to mimic CI
  • runs prerequisite and condition checks
  • dry-runs publish for configured registries
Terminal window
pubm --mode ci --phase publish

CI publish mode publishes from the latest Git tag and creates a GitHub Release via API. Use it when the version bump and tagging already happened earlier in the pipeline. Pass --release-draft to create a draft release instead of a published one.

VariableUsed for
NODE_AUTH_TOKENnpm authentication in CI
JSR_TOKENjsr authentication
CARGO_REGISTRY_TOKENcrates.io authentication
PUBM_LOCALECLI output language (en, ko, zh-cn, fr, de, es)

Prompts are disabled automatically when:

  • stdin is not a TTY
  • the process is running on a recognized CI platform

Publish snapshot versions for preview and testing. Supports single-package and monorepo projects.

Terminal window
pubm snapshot [tag]
OptionDescription
[tag]Snapshot tag (default: snapshot)
-f, --filter <name>Filter packages by name or path (repeatable)
-d, --dry-runSimulate without side-effects
--no-testsSkip tests
--no-buildSkip build
-b, --branch <name>Target branch (default: main)
-a, --any-branchAllow publishing from any branch
Terminal window
# Snapshot all packages
pubm snapshot
# Snapshot with custom tag
pubm snapshot beta
# Snapshot specific packages
pubm snapshot --filter @pubm/core --filter pubm

Interactive setup wizard for pubm. Requires a TTY.

Terminal window
pubm init

The wizard walks through these stages:

  1. Package Detection: scans the repository for manifest files (package.json, jsr.json, deno.json, deno.jsonc, Cargo.toml) and workspace configuration, then confirms the detected packages and registries.
  2. Basic Configuration: prompts for the release branch and versioning strategy (independent or fixed).
  3. Release Options: asks about changelog generation and GitHub Release drafts.
  4. Workflow Setup: offers to enable the changesets workflow (creates .pubm/changesets/, .github/workflows/changeset-check.yml, and updates .gitignore) and generate CI release workflows (.github/workflows/release.yml).
  5. Coding Agent Skills: offers to download and install coding agent skills for Claude Code, Codex CLI, or Gemini CLI. This matches pubm setup-skills.

A pubm.config.ts file is only created when your choices differ from the defaults. If every value matches the default, no config file is written.

This command accepts no flags or options. All configuration is collected interactively.

Download and install coding agent skills for use with pubm.

Terminal window
pubm setup-skills

Supported agents and their installation paths:

AgentSkill directory
Claude Code.claude/skills/pubm/
Codex CLI.agents/skills/pubm/
Gemini CLI.gemini/skills/pubm/

Skills are downloaded from the pubm GitHub repository (latest release tag, with a fallback to the main branch).

This command is also available as the final step of pubm init.

Push locally stored tokens into GitHub Secrets using the gh CLI.

Terminal window
pubm secrets sync
pubm secrets sync --registry npm
pubm secrets sync --registry npm,jsr
FlagDefaultDescription
--registry <registries>npm,jsr,cratesLimit secret sync to specific registries.

Notes:

  • requires gh to be installed and authenticated
  • uses locally stored tokens, so run pubm --mode ci --phase prepare first if nothing has been saved yet

Scan the repository for version references outside of manifest files.

Terminal window
pubm sync --discover

This command is intended to help set up version-sync plugins. It skips common generated directories and lockfiles, then prints candidate files and JSON paths or matching lines that you can adapt into plugin config.

Update the installed pubm CLI to the latest published version.

Terminal window
pubm update

All changeset lifecycle commands live under pubm changesets.

Create a new changeset.

Terminal window
pubm changesets add
pubm changesets add --empty
pubm changesets add --packages @acme/core,@acme/react --bump minor --message "Add public metrics API."
FlagDescription
--emptyCreate an empty changeset file.
--packages <list>Comma-separated package names for non-interactive creation.
--bump <type>One of patch, minor, major.
--message <text>Summary used in the changeset body and changelog.

Inspect pending changesets.

Terminal window
pubm changesets status
pubm changesets status --verbose
pubm changesets status --since origin/main
FlagDescription
--verbosePrint each recorded changeset summary.
--since <ref>Check since a Git ref.

Consume changesets, update manifest versions, write changelogs, and commit the result.

For packages that have no pending changeset files, pubm changesets version can fall back to conventional commits to determine the bump type. This behavior is controlled by the versionSources config option. See the Configuration guide for details.

Terminal window
pubm changesets version
pubm changesets version --dry-run
FlagDescription
--dry-runPrint the version and changelog plan without writing files.

Generate changelog text from pending changesets.

Terminal window
pubm changesets changelog
pubm changesets changelog --dry-run
pubm changesets changelog --version 1.8.0
FlagDescription
--dry-runPreview changelog output without writing CHANGELOG.md.
--version <ver>Use a specific section header instead of Unreleased.

Move pending files from the legacy .changeset/ layout into .pubm/.

Terminal window
pubm changesets migrate

pubm returns a non-zero exit code when:

  • a prerequisite or condition check fails
  • version resolution cannot be completed
  • publish fails on any target
  • a subcommand encounters invalid input

In normal publish mode, failures also trigger rollback behavior where possible.

Terminal window
pubm init
pubm changesets add
pubm changesets version
pubm --mode ci --phase prepare
pubm --dry-run
pubm
Terminal window
pubm --mode ci --phase prepare

Publish only the current tagged release in CI

Section titled “Publish only the current tagged release in CI”
Terminal window
pubm --mode ci --phase publish
Terminal window
pubm secrets sync