CLI and library for local Git ship/release workflows. Stage everything, commit only when there are staged changes, push a branch, and (for release) create an annotated version tag — same behavior as classic shell helpers, runnable from any git repo.
Commands are grouped under modules so more tools can be added later. v1 ships the git module.
Global CLI:
npm install -g nomadutilAs a library dependency:
npm install nomadutilOne-off without installing:
npx nomadutil git ship "fix login crash"npm install
npm run build
npm link # or: npm i -g .Publishing and GitHub Releases are automated via GitHub Actions when you push a version tag (v*.*.*). The tag version must match package.json (as with nomadutil git release 1.0.8 after bumping the package version).
One-time setup — configure Trusted Publishing on npmjs.com (no NPM_TOKEN secret):
- Open the package → Access → Trusted Publishers → GitHub Actions
- Set owner
anomaddev, repositoryNomadUtil, workflow filenamepublish.yml - Leave Environment blank; allow npm publish
Then release:
# bump "version" in package.json first, commit, then:
nomadutil git release 1.0.8That pushes tag v1.0.8, which runs:
- .github/workflows/release.yml — creates a GitHub Release (with generated notes)
- .github/workflows/publish.yml — publishes to npm via Trusted Publishing (OIDC)
Provenance is omitted while this repository is private (npm only supports provenance from public repos).
Manual publish (local):
npm install # required — installs typescript for the build step
npm login
npm publish --access publicprepublishOnly runs tsc before packing. If you see exit code 127 / tsc: not found, dependencies were not installed (or an .npmrc omitted devDependencies — use npm install --include=dev).
Always operates on the current working directory’s git repository (not the tool install path).
nomadutil --help # or -h
nomadutil --version # or -V
nomadutil git --help
nomadutil git ship --help| Flag | Description |
|---|---|
-h, --help |
Show usage (works at any command level) |
-V, --version |
Print the installed package version |
Running nomadutil with no arguments also prints help (and exits non-zero).
Stage all changes, commit if anything is staged, push the branch:
nomadutil git ship "fix login crash"Same as ship, then create an annotated tag and push it. If package.json is present and its version does not match, release fails and asks whether to update package.json / package-lock.json and continue (-y skips the prompt):
nomadutil git release 1.0.0
nomadutil git release 1.0.0 "optional message"
nomadutil git release v1.0.0 # same tag as 1.0.0 → v1.0.0
nomadutil git release 1.0.1 -y # auto-bump package version on mismatchShared by git ship and git release:
| Flag | Default | Description |
|---|---|---|
--remote <name> |
origin |
Git remote |
--branch <name> |
main |
Branch to push |
--dry-run |
off | Print what would run; no git writes |
-y, --yes |
off | git release only: auto-update package version on mismatch |
Examples:
nomadutil git ship "wip" --dry-run
nomadutil git release 1.2.0 --remote origin --branch mainExit non-zero on missing args or git failures.
import { ship, release } from 'nomadutil'
await ship({ message: 'fix login crash' })
await release({ version: '1.0.0' })
await release({
version: 'v1.0.0',
message: 'optional message',
remote: 'origin',
branch: 'main',
dryRun: false,
cwd: process.cwd(), // optional; defaults to process.cwd()
})- Remote:
origin - Branch:
main - Tag prefix:
v(versions1.0.0andv1.0.0both become tagv1.0.0) - Release message:
Release vX.Y.Zwhen omitted - Working tree: current working directory (
process.cwd()/ optionalcwd)
| Module | Commands |
|---|---|
git |
ship, release |
More modules can be added later as nomadutil <module> <command>.