beskid pckg
Package registry and publishing operations (pckg backend).
beskid pckg
Dispatches to the pckg HTTP client: authentication, catalog search and details, .bpk pack and upload, version download, yank/unyank, and related registry workflows (project dependency resolution stays on beskid fetch / beskid lock).
Automatic docs on pack (library packages)
Section titled “Automatic docs on pack (library packages)”For ordinary library projects (project.type omitted or Host), beskid pckg pack (via the beskid CLI) generates API docs before creating the .bpk artifact:
- writes Markdown and
api.jsonto<source>/.beskid/docs/(for exampleindex.md) - includes those files in the published artifact (paths under
.beskid/docs/are allowed by the registry)
On pckg, the in-browser documentation browser lists Markdown from:
docs/**/*.mdin the artifact- optional root
README.md(fromreadme.mdat package root,readme = "path"inProject.proj, or an explicit on-diskREADME.md) .beskid/docs/**/*.md(same layout as Beskid pack output)
You can also ship hand-written docs under a top-level docs/ directory in the package source; those paths are packed as usual and appear alongside generated files.
Entrypoint resolution for generation:
<source>/Project.proj(preferred)<source>/main.bd,<source>/src/main.bd, or<source>/index.bd- otherwise, exactly one
.bdfile under<source>
If no deterministic entrypoint can be inferred, packing fails with an explicit error.
Template packages (project.type = Template)
Section titled “Template packages (project.type = Template)”When Project.proj declares type = Template, pack uses the template profile:
- sets root
package.jsonpackageKind: "template" - includes
.beskid/template.jsonin the artifact (required at pack time; schemabeskid.template.v1) - copies a
templatesummary (shortName,identity,tags) from that manifest intopackage.json - does not run
beskid docor embed.beskid/docs/api.json
Authoring and registry rules: Template packages. User workflows: Project scaffolding.
Pack (beskid pckg pack)
Section titled “Pack (beskid pckg pack)”Builds a .bpk zip from a package source tree.
Typical flags:
--package <id>— package id written into the generated rootpackage.jsoninside the artifact--source <dir>— directory to pack (defaults to.)--output <path.bpk>— artifact path to create--version <semver>(optional) — if omitted, the CLI picks the next patch over the higher ofpackage.json’s version (when present) and the last version recorded for this package in the version state file (see below); if provided, it must be strictly greater than that auto-resolved version--version-state-file <path>(optional) — JSON map of package id → last packed version; default is<source>/.beskid/pckg-version-state.json
On success the CLI prints a line of the form Resolved package version: <semver> (the version embedded in the packed package.json).
Workspace publish (registry API)
Section titled “Workspace publish (registry API)”For multi-package workspaces (for example corelib with foundation, runtime, compiler_sdk, and aggregate corelib), the registry exposes:
POST /api/workspaces/publish
Multipart fields:
artifact(required) — ZIP whose root containsWorkspace.projand each member’s source tree (Project.proj,src/, optionalpackage.json)versionBump(optionalpatch|minor|major, defaultpatch) — registry-assigned semver bump applied to every member package
The server publishes each member as a separate package version, rewrites workspace path dependencies to registry references using the versions assigned in that upload, and rejects published package.json dependencies that still use path or workspace sources. Optional root workspace.package.json (schema: beskid.workspace.package.v1) and per-member package.json pckg.configuration / pckg.overrides supply publish metadata; Workspace.proj override blocks pin external dependency versions.
CLI support for bundling and calling this endpoint is planned; CI can call the HTTP API directly until then.
Upload (beskid pckg upload)
Section titled “Upload (beskid pckg upload)”Publishes an existing .bpk to the registry (POST /api/packages/<package>/publish).
Usage shape:
beskid pckg upload <package> --artifact path/to/package.bpkThe CLI does not accept a --version flag and does not send a multipart version field. The pckg server assigns the next semantic version for that package (by default a patch bump over the latest non-yanked published version; first publish uses 0.0.1). The artifact’s internal package.json version may differ from the registry-assigned publish version; the server validates the artifact accordingly.
Optional upload flags:
--checksum-sha256 <hex>— must match the artifact when provided--manifest-json <string>— forwarded as optionalmanifestJsonform metadata (the server still persists manifest material from the artifact)
On success, when the API returns version details, the CLI prints:
PCKG_PUBLISHED_VERSION=<semver>— stable line for scripts and CI (for example the corelib publish script parses this)- a human-readable summary including
version: <semver> (registry-assigned)plus checksum, size, and timestamps
Other subcommands that target a specific release (download, yank, unyank) still take --version because they refer to an already-published version.
Shared client options
Section titled “Shared client options”These apply to all beskid pckg subcommands (see beskid pckg --help for the full list):
--base-url <url>— pckg HTTP root (alsoBESKID_PCKG_URL)--bearer-tokenor--api-key— authentication (alsoBESKID_PCKG_TOKEN/BESKID_PCKG_API_KEY); otherwise the CLI can load a saved publisher key from--config-file(default.beskid/pckg/repositories.json, written bybeskid pckg configure)--timeout-secs,--verbose
Discovering commands
Section titled “Discovering commands”Run:
beskid pckg --helpfor the live subcommand tree and flags.
Conceptual documentation
Section titled “Conceptual documentation”For auth flows, lockfiles, and publish semantics, see the site guide Package Client CLI.
Examples
Section titled “Examples”beskid pckg whoamiPack then upload (after beskid pckg configure or with env auth):
beskid pckg pack --package my-lib --source ./my-lib --output ./my-lib.bpkbeskid pckg upload my-lib --artifact ./my-lib.bpk