publish#
Validate and package your tool/agent, then upload the signed artifact to the registry.
Overview#
agentpm publish runs the same validations as lint, packages your project into a .tar.gz, and (unless --dry-run) uploads it to the registry.
Command synopsis#
agentpm publish [--manifest <path>] [--schema <URL|PATH>] [--strict] [--dry-run] [--quiet] [--sign] [--key-id <KEY_ID>] [--token <PAT>]Arguments#
--manifest <path>(default:agent.json). Path to the manifest to package and publish.--schema <URL|PATH>. Override schema URL/path (same behavior aslint).--strict. Treat warnings as errors (same semantics aslint).--dry-run. Validate and package, but do not upload. Writes a local artifact.--quiet. Suppress progress output (auto-enabled when not a TTY).--sign— Attach an author signature using a local key (namespace must allow/require). Prompts for the key’s passphrase.--key-id <KEY_ID>— Key to use when--sign(fromagentpm keys list). Required if--signis set.--token <PAT>(env:AGENTPM_TOKEN). Personal Access Token for headless auth (overrides env/file).
publish runs lint automatically. Any lint errors will block publish; with --strict, warnings also block publish
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
Namespace required#
Before publishing, you need a namespace.
- Create it on your profile at the AgentPM site.
- Once created, your namespace is automatically applied to any published tools.
- The namespace is linked to your PAT (Personal Access Token), so publishing uses the namespace associated with the token’s account.
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 --sign --key-id <KEY_ID_FROM_keys_list >
# prompts for key passphrase- Registry attestation happens automatically for every publish.
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 --strictSample output (fails on warning):
• Reading credentials…
✓ Reading credentials (0ms)
• Validating manifest…
[WARN ] `description` should not be empty
at instance /description
✗ Validating manifest (3ms) — failed
Error: Manifest validation failed (strict=true)Actual publish#
agentpm publishSample 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#
Artifacts are written to:
target/agentpm/<name>-<version>.tar.gz
The archive contains:
agent.json— your manifest (exactly as validated)entrypoint— the executable/script declared inentrypoint.command(relative path preserved)files— everything matched byfiles[]patterns (globs/dirs), with relative paths preserved
A SHA-256 digest is computed and shown in the output (also used for integrity verification on install).
Typical workflow#
- Finish your manifest (inputs/outputs, entrypoint, files, env vars, version).
- Run local checks:
agentpm lint --strict
agentpm publish --dry-run- Commit changes (including updated version).
- Publish for real:
agentpm publishExit 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 package. Ensure
entrypoint.commandpoints to a checked-in path, and add required assets/globs tofiles[]. - 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. Consumers will lock the artifact (checksum + version) in
agent.lock, ensuring repeatable installs in CI and across teams.