publish#
Validate and package your tool, skill, knowledge, memory, profile, loop, agent, or template, then upload the signed artifact to the registry.
Overview#
Publish/package preflight requires an explicit supported standard and validates canonical standalone APDS rules with the bundled contract. This applies to normal publication, --dry-run, and the manifest in every saved --build descriptor. Missing, malformed, or unsupported declarations fail even without --strict. Standalone success does not establish resolved-graph validity or Runner readiness; existing packaging and build-readiness checks still apply.
--schema is retained as a recognized option for compatibility but is rejected for publishing and packaging; remove it from these commands. Use agentpm lint --schema FILE only for non-authoritative local development checks. A CWD-relative schema cannot change preflight validation. There is no legacy publish flag, and lint --legacy cannot authorize publication.
Publishing a new version of an older package: Upgrade the local manifest with an explicit supported declaration and a meaningful description, then run ordinary lint and rebuild any Knowledge/Memory output or saved package bundle. Empty or whitespace-only descriptions are errors, not warnings. Historical published versions remain unchanged and usable through existing consumer compatibility paths; do not mutate or republish those versions to add a declaration.
agentpm publish validates and packages your project, then uploads it unless --dry-run is set. Newly published Python Tools use one release with one or more target archives; Node Tools and other package kinds retain one legacy archive. See Releases and Integrity.
Registry validation#
When APDS publication enforcement is enabled on the Registry, it independently checks the actual uploaded archive before making a new version available. This also applies to custom publishing clients and to every target in a multi-artifact release. A client-reported lint result cannot authorize publication.
Upgrade an older publisher#
The minimum CLI that reads and preserves standard declarations is 0.1.36.
CLI 0.1.45 introduces the APDS authoring checks described on this page; the
declaration-tolerance floor does not imply those checks existed in older CLIs.
Upgrade to the latest CLI to get the current authoring and lint checks:
# macOS / Linux with Homebrew
brew update
brew upgrade agentpm
# Windows with Scoop
scoop update
scoop update agentpm
agentpm --versionFor another installation method, replace the binary using the same method you
originally used. Add this declaration to your editable local agent.json:
{ "standard": { "id": "agentpm", "version": "1.0.0" } }Run agentpm lint, rebuild generated Knowledge/Memory content or saved builds,
then publish using a fresh reservation. Do not edit an uploaded archive under an
existing reservation: its manifest, digest and size are already bound.
There is no grace period for pending uploads when enforcement activates. A compliant pending upload can finish before its normal expiry; an undeclared or invalid one must be corrected locally, rebuilt and reserved again. Client timestamps and the age of the package identity do not exempt a new version. Replaying an already completed publication returns its existing receipt.
Previously published versions keep their original manifests, digests, signatures and download/install behavior. These are publishing requirements, not a new installation minimum for historical versions or a claim of Runner support.
What the Registry checks#
The embedded agent.json must declare a supported standard and match the reserved
manifest, package kind, local name and version. The Registry checks standalone
rules, applicable packaged files and content, and resolved dependency relationships.
For example, a declared Knowledge document must exist in the archive, and an Agent
phase binding must exist in its selected Loop. These checks do not establish
Runner readiness, signature trust, malware status or namespace permission.
Unavailable or inaccessible dependencies still fail the existing dependency-access
gate. If required inspection cannot complete, publication fails explicitly rather
than claiming verification. An unsupported content representation is reported as
unsupported. One compatibility exception preserves references to historical
dependencies that lack standard: the Registry checks their actual selected
manifests and relationships, records their declaration as legacy-inferred, and
retains an incomplete resolved result for the unverified declaration. It does not
rewrite those artifacts or overlook other established violations.
Validation errors distinguish apds_nonconformant, apds_unsupported and
apds_incomplete. Structured details include the applicable scope, rule IDs and
source paths, or the field that differs from publication metadata. Storage,
authorization and signing errors keep their separate classifications. Required
packaged checks run within the Registry's configured inspection size limits.
Version security responses expose nullable standard, standard_origin and
apds_validation evidence separately from signatures, attestations and scans.
Newly finalized versions record a well-formed declaration from the actual archive
even before enforcement is enabled. They report standard_origin: declared with
null apds_validation; this records authorship, not conformance or support for the
declared standard. Undeclared versions have no invented identity or validation
result. Existing historical rows and published bytes remain unchanged.
Registry package totals count each package identity once, when its first version is published. Additional versions or target artifacts do not increase that total. The website caches statistics, so updated totals can take several minutes to appear.
For Python Tools, packaging also reports payload compatibility: any for
recognized portable source/data, or the current concrete target for native or
uncertain content. Declared Python dependencies alone do not make the archive
target-specific. See Tool Payload Compatibility
for the classification rules and current limitations. Missing literal files
paths and embedded wheels fail packaging.
Python Tool directory collection omits known incidental environment/Git/OS and
dotenv entries, while explicit file requests and explicit excluded-directory
roots are preserved and reported. The manifest and required entrypoint remain
included. See Directory Collection and Explicit Inclusion
for the exact policy and override behavior. Collection information stays visible
under --quiet and does not fail --strict or make a portable payload native.
For kind: "knowledge", publish also performs a build-check first. The package must already be prepared with:
agentpm knowledge buildPublish validates that the current files still match the build-derived metadata and local index metadata. It does not rewrite agent.json or regenerate the index during publish.
For kind: "memory", publish also performs a build-readiness check first. The package must already be prepared with:
agentpm memory buildPublish validates that the current authored files still match memory/build.json, memory/contracts/index.json, and every indexed generated contract. It does not rebuild contracts or rewrite generated files during publish.
For kind: "loop", publish performs normal schema + semantic validation only. There is no Loop build step and no generated package-specific metadata to refresh during publish.
Command synopsis#
agentpm publish --namespace <handle> [--manifest <path>] [--strict] [--dry-run] [--refresh-python] [--quiet] [--sign] [--key-id <KEY_ID> | --key-file <FILE>] [--token <PAT>]
agentpm publish --namespace <handle> --build <DESCRIPTOR> [--build <DESCRIPTOR> ...] [--expect-build-target <TARGET> ...] [--sign --key-file <FILE>]Arguments#
--manifest <path>(default:agent.json). Path to the manifest to package and publish.--schema. Recognized for command-line compatibility but rejected by preflight. Publish uses the bundled schema; remove this option from publishing commands.--strict. Treat manifest-lint warnings as errors. Payload compatibility narrowing remains a warning and does not become an error under this flag.--dry-run. Validate and package, but do not upload. Writes a local artifact and prepares missing/stale authored Python resolution state inagent.lock; review those changes before publication.--refresh-python. Refresh declared Python dependency resolution instead of reusing matching author-side state. Requires--dry-run; review the updated lock before live publication. See Python Dependency Resolution.--quiet. Suppress progress output (auto-enabled when not a TTY).--sign— Attach an author signature using a local key (namespace must allow/require). ReadsAGENTPM_KEY_PASSPHRASEwhen provided, otherwise prompts interactively.--key-id <KEY_ID>— Key to use when--sign(fromagentpm keys list). Required only when the local keystore contains multiple keys.--key-file <FILE>. Select an encrypted StoredKeyV1 author key file with--sign, instead of--key-id.--build <DESCRIPTOR>. Publish a saved package-build bundle; repeat for a concrete-target Python release.--expect-build-target <TARGET>. Require exactly these matrix packaging hosts; repeat per host when using--build.--token <PAT>(env:AGENTPM_TOKEN). Personal Access Token for headless auth (overrides env/file).--namespace <handle>. Publish into a specific namespace handle. Required for Python release publication and when your account can publish to more than one namespace.
publish runs lint automatically. Any lint errors will block publish; with --strict, warnings also block publish
For local schema experiments, use agentpm lint --schema FILE. Its result is non-authoritative and does not replace bundled publish validation.
flag (--token) > env (AGENTPM_TOKEN) > token file (written by agentpm login).
Authentication required#
You must be logged in to publish. Any of these methods work:
- Flag:
agentpm publish --token "$AGENTPM_TOKEN" - Env var: AGENTPM_TOKEN (e.g.,
export AGENTPM_TOKEN=…) - Logged-in session: run
agentpm loginonce to create a local token file
PAT scopes:
packages:publishcan publish tools, skills, knowledge packages, memory packages, instruction profiles, loops, agents, and templatestools:publishis still temporarily accepted for tool packages only
Namespace required#
Before publishing, you need a namespace.
- Create it on your profile at the AgentPM site.
- Python release publication requires
--namespace <handle>to bind the signed release identity before upload. - For legacy package kinds, if your account can publish to exactly one namespace,
agentpm publishcan infer it. - If your account can publish to multiple namespaces, pass
--namespace <handle>explicitly. - Your PAT still has to be allowed to publish into the chosen namespace.
Create an account by signing in at https://agentpackagemanager.com/signUp , then authenticate via agentpm login. You can verify auth anytime with agentpm whoami.
Signing (author & registry)#
- Author-sign at publish with your local key:
agentpm publish --namespace your-namespace --sign --key-id YOUR_KEY_ID
# prompts for key passphrase- Registry attestation is required for new-format finalization. Historical legacy publication can lack one after a signing failure; strict consumers reject unattested packages.
Requirements#
- Your namespace’s signing mode controls author signatures: off | optional | required (set on the website, Profile → Namespaces → Manage).
- If required, publish will fail unless at least one valid author signature is attached and the key is registered to the namespace:
Error: HTTP 422: signature_required: namespace requires at least 1 valid author signatureHelpful commands#
- Manage local keys:
agentpm keys generate|list|export - Register key with namespace:
agentpm namespace add-signer --namespace <ns> --label "<label>" --pubkey pub.txt
Examples#
Dry-run (no upload)#
agentpm publish --dry-runSample output:
• Reading credentials…
✓ Reading credentials (0ms)
• Validating manifest…
✓ Validating manifest (3ms) — schema + semantics
• Packaging files…
✓ Packaging files (24ms) — 23866 bytes, sha256: fca0ef9660eb
Dry-run: artifact created at target/agentpm/summarize-0.1.3.tar.gzDry-run with strict (warnings become errors)#
agentpm publish --dry-run --strictFor example, a missing editor $schema remains a warning and blocks this command under --strict. Run agentpm lint --fix to add the pinned editor URI.
Actual publish#
agentpm publish --namespace zackSample output:
• Reading credentials…
✓ Reading credentials (0ms)
• Validating manifest…
✓ Validating manifest (2ms) — schema + semantics
• Packaging files…
✓ Packaging files (4ms) — 23866 bytes, sha256: fca0ef9660eb
• Uploading artifact…
✓ Uploading artifact (1.5s) — done
✓ Published summarize@0.1.3
id: 21
url: https://www.agentpackagemanager.com/tools/db32af01-3c9f-47d7-ba91-06638f088531/v0.1.3/overviewWhat gets packaged#
Archives are written under target/agentpm/; filenames may include runtime
or release suffixes. Use the path printed by the command, or the descriptor's
artifact_path when transferring a saved build bundle.
Shared package contents#
Tool, skill, knowledge, memory, profile, loop, agent, and template packages can include:
agent.json— your manifest (exactly as validated)- README content when you provide it through the existing README metadata/content flow
- license content when you provide it through the existing license metadata/content flow
An explicit readme or license.file declaration also requires that file in the
archive. CLI 0.1.46 fixes their inclusion and failure handling for Agent Packages, Templates and
Tools; upgrade if an older CLI builds an archive without those files. Sending its text as Registry page metadata does not satisfy packaged
validation. Agent Packages include these declared files alongside agent.json;
Templates include them alongside their scaffold; non-Python Tools include them
even when their files list selects only executable source. Missing or unsafe
declared paths fail packaging in these flows.
For Python Tools, explicitly declared files must be readable UTF-8: README files
can be at most 512 KiB (524,288 bytes), and license files at most
128 KiB (131,072 bytes). Missing, unsafe, invalid-text or oversized declarations
fail locally with the field path and APDS-ID-004; a declared file is never
silently omitted. When no readme path is declared, optional README discovery
retains its existing behavior, including skipping oversized discovered content.
For kind: "skill", the registry also captures the declared skill.entrypoint content separately from the top-level README flow so the package page can render a dedicated Manual tab without conflating it with README.md.
Skill packages#
For kind: "skill", the archive contains only manifest-declared files:
agent.json- the file at
skill.entrypoint - any files listed in
skill.references[] - any files listed in
skill.scripts[] - optional
readmefile when declared - optional
license.filewhen declared
Important packaging behavior:
- relative paths are preserved in the tarball
- undeclared files are not included
- AgentPM does not crawl Markdown links to infer extra files
Tool packages#
For kind: "tool", the archive contains:
entrypoint— the script supplied inentrypoint.args;entrypoint.commandnames its interpreterfiles— literal package-relative file or directory paths, with relative paths preserved. Globs are not expanded. A missing declared path is a fatal packaging error, including during--dry-run.
Node Tool collection normalizes leading ./ paths before deduplication and
excludes generated output under target/agentpm/, including previous archives
and in-progress temporary archives. Overlapping file/directory selections and
the required manifest/entrypoint produce one member per path. This correction
keeps Node's existing selection of dotenv, Git and environment files; the Python
Tool collection exclusions and compatibility classification do not apply to Node.
Agent packages#
For kind: "agent", the package payload is manifest-driven and does not add executable tool files.
Agent packages do not require:
entrypointruntimeinputsoutputsfiles
Loop packages#
For kind: "loop", the archive contains only common manifest-declared package files:
agent.json- optional declared
readme - optional declared
license.file
Loop packages:
- do not have a build step
- do not include generated metadata
- do not package executable entrypoints
- do not declare package dependencies
Template packages#
For kind: "template", the archive contains:
template.files_root— the declared scaffold tree, copied into the artifact with relative paths preserved
Template packages do not require:
entrypointruntimeinputsoutputsfiles
A SHA-256 digest is computed and shown in the output (also used for integrity verification on install).
Knowledge packages#
For kind: "knowledge", the archive is mode-specific.
Context mode packages contain:
agent.json- every declared
knowledge.documents[].path - optional
knowledge.provenance.sources_manifest_pathwhen present
Vector mode packages contain:
agent.json- declared
knowledge.corpus.chunks_path - declared
knowledge.corpus.sources_path - declared
knowledge.embedding.vectors_path - all files under the declared default
agentpm-localindex path - optional
knowledge.provenance.sources_manifest_pathwhen present
Important publish behavior for knowledge:
- publish validates that
agentpm knowledge buildhas already been run - publish fails if build-derived metadata is missing or stale
- publish does not regenerate
knowledge/indexes/default - publish does not mutate
agent.json
Memory packages#
For kind: "memory", the archive contains:
agent.json- every declared
memory.record_types.*.schema memory/build.jsonmemory/contracts/index.json- every indexed generated resolved contract
Important publish behavior for memory:
- publish validates that
agentpm memory buildhas already been run - publish fails if authored inputs are stale or generated output is missing, modified, unsupported, or inconsistent
- publish does not regenerate contracts
- publish does not mutate
agent.json
Profile packages#
For kind: "profile", the archive contains:
agent.json- optional
readmefile when declared - optional
license.filewhen declared
Important publish behavior for profiles:
- Profile packages do not have a build step
- Profile packages do not contain generated output
- publish rejects Profile manifests that attempt to declare package dependencies
Typical workflow#
- Finish your manifest.
- tools: inputs/outputs, entrypoint, files, optional README/license metadata, env vars, version
- agents: tools, skills, knowledge, memory, profiles, examples, optional README/license metadata, version
- skills:
skill.entrypoint, optional references/scripts/compatibility, optional README/license metadata, version - knowledge: declared context documents or vector corpus paths, optional provenance metadata, version
- memory: authored scopes/record types/spaces plus fresh generated contracts and build metadata
- profiles: authored
profilemetadata plus optional README/license metadata - templates:
templatemetadata, declaredfiles_root, optional README/license metadata, version
- Run local checks:
agentpm lint --strict
agentpm knowledge build # for kind="knowledge"
agentpm memory build # for kind="memory"
agentpm publish --dry-run- Commit changes (including updated version).
- Publish for real:
agentpm publish --namespace zackExit codes#
0— Published (or dry-run packaged) successfully.1— Validation or upload failed (includes lint errors or strict warnings).
Troubleshooting#
- Validation failed. Fix schema errors first (
agentpm lint). If you used--strict, address warnings or omit--strictfor non-blocking warnings. - Missing files in a tool package. Ensure
entrypoint.argsnames a checked-in script, and add existing literal file/directory paths tofiles[]. Create missing paths or correct the manifest before publishing; wildcard patterns such assrc/*.pyare not expanded. - Runtime/Interpreter mismatch. Lint will error if
runtime.typedoesn’t matchentrypoint.command. Align them (e.g.,python↔ a Python entrypoint).
Notes & best practices#
- Determinism. What you lint is what you publish. The packaged
agent.jsonis the same one that passed validation. - Versioning. Bump versions semantically; publishing an existing version is rejected.
- Reproducibility. New-format consumers lock the logical release digest and portable Python resolution in
agent.lock; selected target/artifact and runtime state stay under.agentpm/. Legacy locks retain archive integrity.
Automated publication#
See Publishing from CI for encrypted noninteractive author signing, native runner builds and one final publication.