Add lockfile-and-compatibility, approvals-and-executables and migration-0-28-to-0-39 topics; update installation, cli-reference, the prompt, hooks and instructions topics for 0.39.x behaviour; label the remaining 0.28.0 observations by version. Sources: the v0.39.3 source, CHANGELOG and docs; Context7 was unavailable. Refs #265 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
8.4 KiB
topic, source_keys
| topic | source_keys | |||
|---|---|---|---|---|
| cli-reference |
|
The command surface as of apm 0.39.3, read from source (cli.py and commands/) and the reference docs. Version-specific changes are summarized in migration-0-28-to-0-39.md.
Command list (0.39.3, source)
approve, audit, auth, cache, compile, config, deny, deps, doctor, experimental, export-patch, find, init, install, lifecycle, list, lock, marketplace, mcp, outdated, pack, plugin, policy, preview, prune, publish, run, runtime, search, self-update, targets, uninstall, unpack, update, view.
There are also two hidden entries: discover (use the documented apm init --discover form) and info, an alias of view.
Install
apm install [PACKAGE_REF...] [OPTIONS]
- With no arguments, apm installs everything declared in
apm.ymlagainstapm.lock.yaml. - Naming a
PACKAGE_REFinstalls that package and adds it as a dependency. --updatere-resolves the dependencies and accepts new upstream content.--target agent-skillsproduces a vendor-neutral output directory.
Frozen-install behaviour is in lockfile-and-compatibility.md.
Options (doc):
| Group | Options |
|---|---|
| Resolution and lockfile | --update, --frozen/--no-frozen, --refresh, --accept-ref-change |
| Run control | --dry-run, --force, -v, --dev |
| Scope and targets | --root DIR, -t/--target, --runtime, --exclude, --only apm|mcp, -g/--global, --legacy-skill-paths |
| Policy and security | --policy SOURCE, --no-policy, --audit off|warn|block, --no-audit |
| Trust | --trust-transitive-mcp, --trust-bin/--no-trust-bin |
| Network and transport | --allow-insecure, --allow-insecure-host, --parallel-downloads N, --ssh, --https, --allow-protocol-fallback, --auth-first |
| Skill selection | --skill, --as |
| MCP | --mcp, --transport, --url, --env, --header, --mcp-version, --registry |
Exit codes (doc):
| Code | Meaning |
|---|---|
| 0 | Success or preview |
| 1 | Install failure. This includes frozen violations, and any reported error even with --force. |
| 2 | Usage error: no target detectable, --ssh with --https, --frozen with --update, or --root with --global. |
Update and outdated
apm update [PACKAGES] [--yes] [--dry-run] [--verbose] [--global] [--force] [--target ...]
apm outdated [-g] [-v] [-j N]
apm update (source):
--checkis deprecated (doc). Use--dry-run, orself-update --checkinstead.- Run outside an
apm.ymlproject, bareapm updateforwards toself-updatewith a warning (doc). apm deps updateis deprecated in favour ofapm update.
apm outdated (source):
- Options are
--global,--verboseand--parallel-checks/-j N(default 4; 0 means sequential). - There is no
--jsonand no package filter. - Output: a "Dependency Status" table with columns Package, Current, Wanted (only when registry rows exist), Latest, Status and Source.
- The summary line is
<N> outdated dependency foundor<N> outdated dependencies found, orSome dependencies could not be checked. - Statuses in code are
up-to-date,outdated,unknown,origin-conflict,access-deniedandnot-comparable. - With
-v, the table adds the newer tags.
- The summary line is
- Exit codes: 1 on
origin-conflictoraccess-denied(source); the docs also give 1 for no lockfile in scope. Outdated or unknown rows still exit 0. - Local and Artifactory dependencies are skipped, and the command is read-only.
Audit
apm audit # scan deployed files for hidden Unicode
apm audit --ci # CI gate: lockfile consistency, approvals, drift replay, policy
apm audit --file <path> # scan an arbitrary file
apm audit --ci -f json -o r.json
- Options:
--file,--strip,--dry-run,--no-drift,-v,--ci,--policy,--no-policy,--no-cache,--no-fail-fast,-f/--format text|json|sarif|markdown,-o/--output PATH.- When
-ois given without-f, the format is inferred from the file extension. markdownis not allowed with--ci.
- When
- Exit codes in content-scan mode (source docstring): 0 clean, 1 critical, 2 warnings only. The docs add 3 for configuration or infrastructure errors.
- Exit codes in
--cimode: 0 when every check passes, 1 when any fails. - Text output in
--cimode (source):- On success:
All <M> check(s) passed. - On failure:
<N> of <M> check(s) failed, with each failure as<check>: <message>followed by detail lines. - M varies with which checks apply; the list is in
migration-0-28-to-0-39.md.
- On success:
- Lockfile message (source): when
apm.ymldeclares dependencies but there is no lock, the detail readsapm.yml declares dependencies but apm.lock.yaml is absent. - Fail-fast is the default.
See testing-and-validation.md for CI wiring.
Approve, deny and export-patch
apm approve [PACKAGES] [--pending|--all|--recommended|--list] [--user|-g]
apm deny [PACKAGES] [--user|-g]
apm export-patch [--out DIR] [--dry-run] [-v]
- Approvals are covered in
approvals-and-executables.md. export-patch(doc):- It writes one
patches/<pkg>@<ref>.patchper package, ready forgit apply, covering only files that were deployed verbatim. - It needs a lockfile and a populated
apm_modules/, and it runs cache-only. - It exits 0 on success, including when there is nothing to export. It exits 1 on a missing manifest or lock, a cold cache, or an invalid
--out.
- It writes one
Compile
apm compile [-t TARGET|--all] [--root DIR] [-o PATH] [--clean] [--validate] [--dry-run] [--watch] [-g]
apm compilegenerates root context files (AGENTS.md,CLAUDE.md,GEMINI.md) from instructions.- Other options:
--single-agents,--chatmode,--no-links,--with-constitution/--no-constitution,--local-only,--force-instructions(alias--no-dedup) and--legacy-skill-paths. - It exits 1 when org policy blocks a recorded package.
- A hand-authored root
CLAUDE.mdorAGENTS.mdis never overwritten (source). For the 0.38/0.39 Claude layout, seeinstructions-target-mapping.md.
Pack
apm pack --dry-run # resolve and print; do not write
apm pack --check-versions --check-clean --dry-run
apm pack --format plugin # Claude Code plugin bundle (alias)
apm pack --marketplace=claude --json
-
Options (source):
--claude-plugin--format plugin|agent-plugin|claude|claude-plugin|apm. With no flag the default isclaude-plugin.pluginis an alias for the Claude Code plugin bundle.--target/-t, which is deprecated and informational only.--archive(default.zip) with--archive-format zip|tar.gz.-o,--dry-run,--force,-v,--offline,--include-prerelease.--check-versions,--check-clean,--strict-metadata.-m/--marketplace,--marketplace-path FORMAT=PATH,--json,--legacy-skill-paths.
-
Exit codes (source):
Code Meaning 0 Success 1 Build or runtime error 2 Usage error 3 --check-versionsmisalignment4 --check-cleandrift5 --strict-metadatafailure -
--check-cleanis read-only.
Publish
apm publish --package acme/my-skill --dry-run -v
apm publish --package acme/my-skill
apm publish sends a producer package to a registry. Always dry-run with -v first.
Runtime management
apm runtime setup copilot
apm runtime setup codex --version 0.20.0
apm runtime setup llm --vanilla
apm runtime list
apm runtime status
apm runtime remove gemini -y
Run
apm run <script> [--param key=value]
apm run executes a named script from scripts: in apm.yml. It is experimental.
Marketplace and plugin scaffolding
apm marketplace init
apm marketplace check
apm marketplace package add <path> --name <n>
apm marketplace add <source> [--name <n>]
apm plugin init <name> --yes
- Marketplace subcommands (source):
add,list,browse,update,remove,validate,init,migrate,check,audit,outdated, andpackage add|set|remove. pluginhas onlyinit.apm init --pluginandapm init --marketplacewere removed in 0.37 and exit 2.
Config
apm config set <key> <value>
apm config get <key>
apm config list
apm config unset <key>
apm experimental enable registries