Skip to content

apkg publish

The publish command creates a tarball from the current directory, computes its SHA256 integrity hash, and uploads it to the registry. You must be logged in before publishing.

Terminal window
apkg publish [--registry <URL>]
OptionDescription
--registry <URL>Override the registry URL for this publish

Before publishing, make sure:

  1. An apkg.json manifest exists in the current directory (see apkg init).
  2. The package name is scoped — @username/name or @org/name.
  3. You are authenticated — run apkg login first.

The command checks that the scope in your package name matches your logged-in username. If it doesn’t (e.g. you are publishing under an organization scope), a warning is shown. Publishing will still succeed if you are a member of that organization.

The following fields from apkg.json are sent to the registry:

FieldRequired
nameYes
versionYes
typeYes
integrityYes (computed automatically)
descriptionNo
licenseNo
keywordsNo
dependenciesNo

Publish the package in the current directory:

Terminal window
apkg publish

Publish to a private registry:

Terminal window
apkg publish --registry https://registry.internal.example.com

Typical workflow — initialize, then publish:

Terminal window
apkg init
# ... add your package files ...
apkg publish
CommandDescription
initCreate an apkg.json manifest
loginAuthenticate with the registry
packCreate a tarball without uploading
deprecateMark a published package or version as deprecated
dist-tagManage distribution tags on published versions