Low-level reference for how companies.sh is prepared and published to npm.
For the maintainer workflow, use doc/RELEASING.md. This document focuses on packaging internals and the release scripts.
Use these scripts:
scripts/release.shfor canary and stable publish flowsscripts/rollback-latest.shto repointlatest
The npm package is:
- package name:
companies.sh - executable:
companies.sh - compatibility alias:
companies - repository:
paperclipai/companies-tool
The repo intentionally publishes a single package. There is no workspace version rewrite step like the main Paperclip repo needs.
companies.sh follows the same semver-safe calendar versioning as Paperclip:
- stable:
YYYY.MDD.P - canary:
YYYY.MDD.P-canary.N
Examples:
- stable:
2026.324.0 - canary:
2026.324.0-canary.2
The middle numeric slot is MDD, where M is the UTC month and DD is the zero-padded UTC day.
Canaries publish automatically from master under the npm dist-tag canary.
Example install:
npx companies.sh@canary add paperclipai/companies/gstackStable publishes are manual promotions through GitHub Actions and publish under the npm dist-tag latest.
Example install:
npx companies.sh add paperclipai/companies/gstackThe release script:
- verifies the worktree is clean
- optionally runs
pnpm typecheck,pnpm test, andpnpm build - computes the next calendar version by querying npm
- rewrites
package.jsontemporarily to the publish version - previews the publish payload with
npm pack --dry-run - runs
pnpm publish --access public --tag <canary|latest> - creates the matching git tag locally
- verifies the published version appears on npm
The package.json version rewrite is temporary. The script restores the original manifest on exit.
The intended CI model is npm trusted publishing through GitHub OIDC.
That means:
- no long-lived
NPM_TOKENin repository secrets - GitHub Actions obtains short-lived publish credentials
- trusted publisher rules are configured for
.github/workflows/release.yml
See doc/RELEASE-AUTOMATION-SETUP.md for the required GitHub and npm control-plane setup.
Rollback does not unpublish anything.
It repoints the latest dist-tag to a prior stable version:
./scripts/rollback-latest.sh 2026.324.0This restores the default install path while a follow-up stable is prepared.