18.1 The pckg CLI
Pack and upload flows through beskid pckg, not a second package manager hiding in the bushes.
The pckg CLI
import { Aside } from ‘@astrojs/starlight/components’;
beskid pckg is the toolchain entry for registry operations: credential configuration, artifact packing, upload, and related workflows implemented in the beskid_pckg crate and the pckg registry service.
Commands you will actually use
Section titled “Commands you will actually use”beskid pckg configure --api-key "$BESKID_PCKG_API_KEY"beskid pckg whoamibeskid pckg pack --package acme.math --source . --output acme.math.bpkbeskid pckg upload acme.math --artifact acme.math.bpkWhat happens during upload
Section titled “What happens during upload”beskid pckg pack: collects source, generates API docs for library packages, selects an exact semantic version, and assembles the.bpkartifactbeskid pckg upload: reads that version from artifact-rootpackage.jsonand streamsversion, checksum, and artifact bytes toPOST /api/packages/<name>/versions- Server-side validation: manifest integrity, checksum match, review/moderation policy enforcement
- Catalog update: version appears in search and listing endpoints; project fetch/lock flows can resolve it
sequenceDiagram accTitle: Pack and upload to the registry accDescr: The author packs a bpk artifact with the CLI, the CLI uploads it to the registry, the registry validates and adds it to the catalog, and the CLI reports the result. actor Author participant CLI as beskid pckg participant Reg as pckg registry Author->>CLI: pack CLI-->>Author: .bpk artifact with exact version Author->>CLI: upload CLI->>Reg: POST /api/packages/name/versions Reg->>Reg: validate manifest, checksum, policy Reg-->>CLI: version published CLI-->>Author: Published name@version
Text equivalent: pack produces the artifact with its exact version. upload posts version, checksum and bytes to the registry, which validates them and adds the version to the catalog.
The registry does not assign a different version during upload. Package/version coordinates are immutable: publish a new artifact version instead of replacing existing bytes.
Authentication
Section titled “Authentication”beskid pckg loads credentials from, in order:
--bearer-token/--api-keyCLI flags (highest priority)BESKID_PCKG_TOKEN/BESKID_PCKG_API_KEYenvironment variables.beskid/pckg/repositories.json(written bybeskid pckg configure)
Publisher operations (upload, yank, unyank) require a valid publish-scoped credential.
See also
Section titled “See also”- pckg command reference: full subcommand and flag reference
- Publish a package: verified procedure with expected results and recovery
- Packages without npm trauma: chapter overview
- Doc and api.json: automatic doc generation during pack
- Registry client
- pckg client contract