publish#
Validate, package, and upload your tool to the AgentPM registry.
Goal#
Run a dry-run to confirm your package, then publish the real artifact.
0) Namespace required#
Before publishing, you need a namespace.
- Create it on your profile at the AgentPM site.
- Python release publication requires
--namespace <handle>. For legacy package kinds, the CLI can infer a single available namespace. - If your account can publish to more than one namespace, pass
--namespace <handle>explicitly. - Your PAT or logged-in account 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.
1) Sanity check (optional but recommended)#
For a Python Tool with declared dependencies, prepare and review its portable resolution first:
agentpm publish --dry-run --refresh-python
git diff -- agent.lock
# Review and commit agent.json and agent.lock.Run lint and a packaging dry-run:
agentpm lint --strict
agentpm publish --dry-runWhat you should see:
• 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.gzLint runs automatically during publish. With --strict, warnings will also block.
2) Publish for real#
agentpm publish --namespace your-namespaceTypical successful 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 produced
- A
.tar.gzattarget/agentpm/<name>-<version>.tar.gzcontainingagent.json- your
entrypointtarget - existing literal file/directory paths declared in
files[], with relative paths preserved (no glob expansion; missing entries stop packaging)
- A SHA-256 digest is shown and used for integrity on install.
3) Versioning & immutability#
- SemVer only. Bump the
versioninagent.jsonfor changes. - Prerelease identifiers such as
1.2.3-preview.1are supported. Registry version comparisons use SemVer precedence; a stable release sorts after prereleases of the same core version. These package versions are separate from the Python distribution versions used in dependency declarations. - Default
latestselection uses the highest non-yanked stable version, matching installation. Prereleases require an explicit version or prerelease range. A prerelease-only package remains viewable by version; its/latestpage explains that no stable release is available and links to published versions. - No overwrites. Re-publishing an existing version is rejected—use a new version.
Common options#
# Treat warnings as errors (same as lint)
agentpm publish --namespace your-namespace --strict
# Package without uploading
agentpm publish --dry-run
# Quieter output (useful in CI)
agentpm publish --namespace your-namespace --quietTool execution contract#
For a tool to work with the SDK, it must follow this process protocol:
- SDK writes inputs JSON to stdin.
- Your tool writes one JSON object (final result) to stdout.
- Logs/diagnostics → stderr only.
- Exit code 0 on success (non-zero = failure).
If you break this contract, publish --dry-run may succeed because it validates and packages rather than executing the Tool protocol, but runtime calls via the SDK will fail. Declared Python dependencies are also resolved during preparation; see Python Dependency Resolution for current availability. See SDKs → Node/Python for process-protocol examples.
Troubleshooting#
- Validation failed. Fix the reported issues, or drop
--strictif you’re okay shipping with warnings. - Missing files in the tarball. Ensure
files[]includes built artifacts and thatentrypoint.argspoints to a packaged path. - Interpreter mismatch. Align
runtime.typewithentrypoint.command(e.g.,nodewith a Node entrypoint).
After publishing#
- Install from another project
agentpm install @namespace/summarize@0.1.3- Pin in production. Consumer commits the
agent.lockso installs are deterministic. - Changelog & docs. Keep
descriptionand schema field descriptions sharp—registry pages render from your manifest.
Python release and CI workflows#
A newly published Python Tool uses agentpm.package.release.v1, including a
source-only Tool with one any artifact. The release is immutable and binds all
artifact digests. The CLI classifies only the packaged payload; declared native
Python dependencies are installed separately on the consumer. A local native
build publishes its current concrete target; a multi-platform release requires
native builds collected into one final publication.
Use Python dependencies for author locks, managed environments and vendored-Tool migration; CI publishing for the four-runner workflow; and release integrity for release versus artifact digests. Install the published version in a clean consumer and verify the behavior before announcing it.