PackagePass

CLI

Use packagepass for local setup, publishing, access grants, and release operations.

The CLI is the main operator workflow. It stores local configuration, validates packages before publish, wraps npm pack, creates install config, and exposes the same access-control model as the API.

install and inspect
npm install -g @packagepass/cli

packagepass --help
packagepass doctor

Configuration and environment

The CLI reads ~/.packagepass/config.json after login. Environment variables override saved config, which is useful in CI and scripted releases.

SettingPurpose
PACKAGEPASS_API_KEYBearer token for the control API.
PACKAGEPASS_TENANTTenant slug or ID used when requests do not include a tenantId.
PACKAGEPASS_API_URLControl API base URL. Default in the app is https://api.preview.packagepass.dev/v1.
PACKAGEPASS_REGISTRY_URLnpm-compatible registry URL. Default in the app is https://registry.preview.packagepass.dev/npm/.
interactive browser approval
packagepass login

packagepass login \
  --tenant acme \
  --api-url https://api.preview.packagepass.dev/v1 \
  --registry-url https://registry.preview.packagepass.dev/npm/

packagepass whoami
api key or automation
packagepass login \
  --api-key $PACKAGEPASS_API_KEY \
  --tenant acme \
  --api-url https://api.preview.packagepass.dev/v1 \
  --registry-url https://registry.preview.packagepass.dev/npm/

Browser-approved login creates a revocable API token named CLI login token. The intended default lifetime is 30 days, and the exact expiration is shown before approval and in Dashboard > Tokens. Existing browser-approved tokens keep their original expiration; revoke them and run packagepass login again to shorten local CLI access. Browser-approved login stores the organization slug when available; --tenant and PACKAGEPASS_TENANT also accept an organization ID for existing configs and automation.

Publishing

Create packages and publish releases

first release
packagepass package create @acme/payments \
  --description "Customer payments SDK"

packagepass publish ./packages/payments --tag latest

packagepass version list @acme/payments
packagepass dist-tag list @acme/payments
dry run
packagepass publish ./packages/payments \
  --tag next \
  --dry-run

Publish policy

Package names must be scoped, versions must be semver-compatible, and generated TypeScript libraries should publish ESM entrypoints, declaration files, and a package.json files list.

Preview packages

publish a preview
packagepass preview publish ./packages/auth \
  --channel pr-482

npm install @acme/auth@preview-pr-482

How preview versions work

The CLI creates a generated version like 0.0.0-preview.pr-482... and moves the dist-tag preview-pr-482 to that version.

Access control

Grant access and mint install tokens

A grant decides what a subject is allowed to do. A token is the credential the subject or automation uses to call the API or install from the registry.

grant package install
packagepass grant add @acme/payments \
  --subject customer:globex \
  --action install

packagepass grant list --package @acme/payments
create install token
packagepass token create install \
  --package @acme/payments \
  --subject customer:globex \
  --ttl 30d

packagepass setup @acme --manager npm --write

Subject syntax

SubjectUse
user:alice@example.comA person identified by email.
customer:globexA customer account or tenant in your product.
agent:code-reviewerA non-human actor such as an AI agent, service, or CI job.
group:platformA team or group.

Action names

package:read
package:install
package:publish
package:deprecate
package:yank
package:manage_dist_tags
grant:manage
token:mint
audit:read

Diagnostics

Debug installs and policy decisions

Use doctor for local config, control API auth, and registry install checks. A registry 404 can mean the current token can read the package record but lacks package:install access for npm, pnpm, Bun, or Yarn.

doctor
packagepass doctor @acme/payments

PACKAGEPASS_TOKEN=<install-token> \
  packagepass doctor @acme/payments
policy explain
packagepass policy explain @acme/payments \
  --subject user:alice@example.com \
  --action install

Command reference

AreaCommandPurpose
Authpackagepass loginStart browser-approved CLI login; the resulting CLI login token expires after 30 days and can be revoked from Dashboard > Tokens. Existing browser-approved tokens keep their original expiry; revoke them and log in again to shorten them.
Authpackagepass login --api-key <token> --tenant <slug-or-id>Noninteractive API-key login for CI, scripts, and automation; the tenant may be an organization slug or ID.
Authpackagepass logoutRemove the saved CLI config.
Authpackagepass whoamiPrint the current principal resolved by the API.
Tenantpackagepass tenant create <slug> --name <name>Create a tenant. In the MVP this requires the bootstrap admin token.
Tenantpackagepass tenant listList tenants visible to the current API token.
Packagepackagepass package create @scope/nameCreate package metadata before the first publish.
Packagepackagepass package list --scope @scopeList packages, optionally filtered by scope or search query.
Packagepackagepass package get @scope/nameInspect one package record.
Packagepackagepass package archive @scope/nameArchive package metadata.
Publishpackagepass publish [dir] --tag latestValidate package.json, run npm pack, upload the tarball, and update the dist-tag.
Publishpackagepass preview publish [dir] --channel pr-123Publish a generated preview version and attach it to preview-pr-123.
Installpackagepass setup @scope --manager npm --writeGenerate npm, pnpm, Yarn, or Bun registry config for a scope.
Accesspackagepass grant add @scope/name --subject customer:globex --action installAllow a subject to read, install, publish, manage grants, or mint tokens.
Accesspackagepass grant list --package @scope/nameReview grant records, optionally filtered by package.
Accesspackagepass grant revoke <grant-id>Remove a grant record.
Tokenspackagepass token create install --package @scope/name --agent code-reviewer --ttl 30dCreate a short-lived install token scoped to a subject and package.
Tokenspackagepass token listAudit tokens.
Tokenspackagepass token revoke <token-id>Revoke a token.
Releasepackagepass dist-tag list @scope/nameInspect package dist-tags.
Releasepackagepass dist-tag set @scope/name <tag> <version>Point a dist-tag at a version.
Releasepackagepass dist-tag rm @scope/name <tag>Remove a dist-tag.
Releasepackagepass version list|getList or inspect package versions.
Releasepackagepass deprecate @scope/name@1.2.3 "message"Mark a version as deprecated with an install warning.
Releasepackagepass yank @scope/name@1.2.3Mark a version as yanked and remove dist-tags pointing to it.
Policypackagepass policy explain @scope/name --subject user:alice@example.com --action installExplain why a subject can or cannot perform an action.
Auditpackagepass audit events --package @scope/name --limit 50Read package, grant, token, policy, and registry audit events.
CIpackagepass ci exchange --provider github --id-token <token>Exchange a CI identity token for a PackagePass token.
Troubleshootingpackagepass doctor [@scope/name]Check local config, API auth, registry metadata, and install-token policy diagnostics.

The same package, grant, token, policy, and audit operations are available from the TypeScript SDK and API.