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.
Synopsis
Section titled “Synopsis”apkg publish [--registry <URL>]Options
Section titled “Options”| Option | Description |
|---|---|
--registry <URL> | Override the registry URL for this publish |
Requirements
Section titled “Requirements”Before publishing, make sure:
- An
apkg.jsonmanifest exists in the current directory (seeapkg init). - The package name is scoped —
@username/nameor@org/name. - You are authenticated — run
apkg loginfirst.
Scope validation
Section titled “Scope validation”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.
Published metadata
Section titled “Published metadata”The following fields from apkg.json are sent to the registry:
| Field | Required |
|---|---|
name | Yes |
version | Yes |
type | Yes |
integrity | Yes (computed automatically) |
description | No |
license | No |
keywords | No |
dependencies | No |
Examples
Section titled “Examples”Publish the package in the current directory:
apkg publishPublish to a private registry:
apkg publish --registry https://registry.internal.example.comTypical workflow — initialize, then publish:
apkg init# ... add your package files ...apkg publishRelated commands
Section titled “Related commands”| Command | Description |
|---|---|
init | Create an apkg.json manifest |
login | Authenticate with the registry |
pack | Create a tarball without uploading |
deprecate | Mark a published package or version as deprecated |
dist-tag | Manage distribution tags on published versions |