Files
Holocron/plugins/kyberforge/docs/research/docs/microsoft-apm/cli-reference.md
T
Defame1297andClaude Opus 5.5 5ca2056046 docs(research): refresh apm reference set to 0.39.3 (#265)
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
2026-12-01 21:46:06 +00:00

8.4 KiB

topic, source_keys
topic source_keys
cli-reference
context7-microsoft-apm
apm-v0-39-3-source
apm-v0-39-3-docs

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.yml against apm.lock.yaml.
  • Naming a PACKAGE_REF installs that package and adds it as a dependency.
  • --update re-resolves the dependencies and accepts new upstream content.
  • --target agent-skills produces 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):

  • --check is deprecated (doc). Use --dry-run, or self-update --check instead.
  • Run outside an apm.yml project, bare apm update forwards to self-update with a warning (doc).
  • apm deps update is deprecated in favour of apm update.

apm outdated (source):

  • Options are --global, --verbose and --parallel-checks/-j N (default 4; 0 means sequential).
  • There is no --json and 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 found or <N> outdated dependencies found, or Some dependencies could not be checked.
    • Statuses in code are up-to-date, outdated, unknown, origin-conflict, access-denied and not-comparable.
    • With -v, the table adds the newer tags.
  • Exit codes: 1 on origin-conflict or access-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 -o is given without -f, the format is inferred from the file extension.
    • markdown is not allowed with --ci.
  • 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 --ci mode: 0 when every check passes, 1 when any fails.
  • Text output in --ci mode (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.
  • Lockfile message (source): when apm.yml declares dependencies but there is no lock, the detail reads apm.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>.patch per package, ready for git 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.

Compile

apm compile [-t TARGET|--all] [--root DIR] [-o PATH] [--clean] [--validate] [--dry-run] [--watch] [-g]
  • apm compile generates 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.md or AGENTS.md is never overwritten (source). For the 0.38/0.39 Claude layout, see instructions-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 is claude-plugin. plugin is 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-versions misalignment
    4 --check-clean drift
    5 --strict-metadata failure
  • --check-clean is 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, and package add|set|remove.
  • plugin has only init.
  • apm init --plugin and apm init --marketplace were 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