Skip to content

apm update

Refresh the dependencies declared in apm.yml to the latest matching versions or Git refs, after showing you the plan and asking for consent.

Terminal window
apm update [OPTIONS] [PACKAGES...]

apm update re-resolves every dependency in your project’s apm.yml against the newest version or Git ref allowed by its constraint, prints a structured plan — added, updated, removed, unchanged — and prompts before changing refs. Full-SHA revision pins are refreshed by resolving the latest annotated semver tag from the authoritative upstream, then rewriting the SHA in apm.yml with a tag annotation after you accept the plan (for example # v2.0.0). Decline the prompt and APM exits cleanly: no manifest rewrite, no lockfile write, no filesystem changes.

When every ref is already current but the locked apm_modules/ cache is empty, apm update restores the cache from the same resolved refs without prompting. It uses the normal dependency materialization path without changing apm.yml or apm.lock.yaml. --dry-run remains read-only and does not restore files.

Pass one or more PACKAGES to refresh only those dependencies, or -g/--global to refresh the user-scope dependencies under the APM home ($APM_HOME, default ~/.apm) instead of the current project. Target files do not move; see the APM_HOME path contract. With these flags apm update is a strict superset of the deprecated apm deps update.

Partial updates retain deployment targets in apm.lock.yaml for both refreshed and untouched packages, including skills deployed under the shared .agents/skills/ directory. A follow-up apm install is not needed to restore target records.

This command refreshes dependencies, not the CLI. For CLI upgrades, use your package manager (brew upgrade apm for Homebrew), or apm self-update for standalone installs.

For a read-only install that pins to whatever is already in apm.lock.yaml — the right command for CI — use apm install --frozen.

On a fresh clone or CI runner without local deployment receipts (for example a scheduled update), apm update --yes replaces committed skill files that match what the currently locked version renders, fetched from its locked commit. Lockfile hashes are never that proof. The same evidence governs files the new version no longer ships: they are removed only when a receipt or the locked render matches them, and otherwise kept with a warning naming them. If any of those files was edited locally, the update exits nonzero before writing any deployed file or apm.lock.yaml; move the file aside and retry.

apm update accepts new package content only for a dependency whose resolved commit moved (or that records no commit, such as a registry dependency). It reports how many dependencies got new locked content; --verbose lists each new content_hash. A dependency whose commit did not change must still match its locked content_hash; a mismatch fails closed and leaves apm.lock.yaml untouched. Run apm cache clean and retry first. To re-pin deliberately, remove that dependency’s entry from apm.lock.yaml ($APM_HOME/apm.lock.yaml with -g) and run apm install (apm install -g).

ArgumentDescription
PACKAGES...Optional. One or more dependency names to refresh (short name like compliance-rules, canonical owner/repo, or plugin@marketplace). Omit to refresh everything. Unknown names exit 1 with the available list, also when apm.yml declares no APM dependencies.
FlagDefaultDescription
--yes, -yoffSkip the interactive prompt and accept the plan. Required for non-interactive use.
--dry-runoffCompute and print the plan without prompting and without writing the manifest, lockfile, or filesystem.
--verbose, -voffShow per-dependency resolution detail (old ref, new ref, source) and full error context.
--global, -goffRefresh user-scope dependencies under $APM_HOME (default ~/.apm) instead of the current project (mirrors apm install -g).
--forceoffOverwrite locally-authored files and deploy despite critical security findings. It does not change ref freshness: update still requires current upstream refs. Use only after independent verification.
--parallel-downloads N4Max concurrent package downloads. 0 disables parallelism.
--trust-transitive-mcpoffDeploy unapproved transitive MCP servers for this run only, as with apm install. Neither apm.yml nor apm.lock.yaml carries this consent; to keep a server, run apm approve on its package.
--policy SOURCEnoneAlso enforce this policy, as with apm install --policy. It combines with auto-discovered org policy and can only add constraints; a source that cannot be loaded fails the command before anything is written. Not valid with --global.
--target TARGET, -t TARGETresolution chainAgent harness(es) to update for. Accepts the same target values and comma-separated lists as apm install --target. Resolution is --target > apm.yml targets: > apm config set target ... > auto-detect.
--legacy-skill-pathsoffKeep refreshed skills in per-client paths (.cursor/skills/, .github/skills/, …) instead of the converged .agents/skills/. Pass it when the project was installed with apm install --legacy-skill-paths. Env: APM_LEGACY_SKILL_PATHS=1.

Preview what would change, without prompting or writing:

Terminal window
apm update --dry-run

Interactively review and accept the plan:

Terminal window
apm update
# prints plan, prompts: Apply these changes? [y/N]

Accept non-interactively (CI, scripts):

Terminal window
apm update --yes

Refresh only specific packages:

Terminal window
apm update org/pkg-a org/pkg-b

Refresh user-scope dependencies installed with apm install -g:

Terminal window
apm update -g

Decline the prompt — nothing is written:

Terminal window
apm update
# Apply these changes? [y/N] n
# No changes applied.
  • Re-resolve every dep. Each entry in apm.yml is resolved against its remote source for the newest version or ref allowed by the constraint (registry version, branch tip, latest matching tag, etc.). Full-SHA revision pins move only to the commit behind the latest annotated semver tag; branch refs and lightweight tags are refused. Local-path deps are skipped.
  • Refreshes preserve the active package. Replacement content downloads and passes package validation in an isolated transaction path before publication. Failed downloads or validation keep the previous package active. Failed activation attempts restoration without changing the lockfile. If restoration is also denied, preserve the reported backups and follow recovery guidance before rerunning apm update; the prior package may not be active.
  • Marketplace catalogs are revalidated. Each catalog behind a name + marketplace dependency is fetched once per run instead of trusting the cached copy. If it cannot be verified, the update fails with no changes. plugin@marketplace selects that dependency. If a marketplace name now points at a different origin than apm.lock.yaml recorded (source_url), the update fails naming both origins and changes nothing.
  • Newer lockfiles are refused. If apm.lock.yaml was written by a newer APM, apm update exits 1 before changing anything, naming both versions and how to upgrade; see Lockfile written by a newer APM.
  • Registry-only proxies. Under PROXY_REGISTRY_ONLY=1, apm update re-resolves dependencies locked to direct VCS sources through the registry; a targeted update still requires the entries it keeps to be registry-routed.
  • Mutable refs require upstream freshness. APM resolves mutable Git refs through the authenticated upstream. If upstream resolution fails, the update fails instead of silently substituting a ref from the local bare Git cache. Content already cached for the freshly resolved SHA may still be reused.
  • Registry deps. Updates stay within the manifest constraint and use the configured registry. An exact 1.7.0 or =1.7.0 pin remains unchanged even when apm outdated reports Latest as 1.8.0. To take an outside-constraint release, select it explicitly. Unlike read-only outdated, update can write the manifest, lockfile, modules, and deployed files.
  • Structured plan. Output is grouped into four sections:
    • added — present in the new resolution but not in the previous lockfile.
    • updated — ref or version moved.
    • removed — previously locked, no longer required by apm.yml.
    • unchanged — already at the latest matching version or ref.
  • Consent gate. The prompt defaults to No. Without --yes, declining (or running in a non-interactive context) aborts with a clean exit; the manifest, lockfile, and workspace are untouched.
  • No partial consent. A single prompt covers both revision-pin manifest rewrites and the normal update plan; declining leaves everything unchanged.
  • --dry-run skips the prompt. It computes and prints the plan, including revision-pin SHA/tag rewrites, but never writes and never asks.
  • Target contraction is reconciled. A successful update removes unchanged dependencies’ deployed files, lockfile ownership, and merge-hook config/sidecar entries for targets no longer declared in apm.yml, even when no dependency ref changes — same contract as apm install’s target-contraction note; see Hooks and commands for what the merge-hook config/sidecar files are.
  • One target decision covers services. The effective target used for package deployment is reused for MCP and LSP reconciliation. Saved config targets are not re-detected or dropped after package updates. Required native config failures exit non-zero.
  • No-op and service-only repair. An accepted update with no dependency ref changes still reconciles missing MCP/LSP config. A manifest with only MCP/LSP dependencies also uses apm update as a configuration repair pass; --dry-run previews this without writing.
  • Empty caches are restored. If the lockfile expects dependencies but apm_modules/ has no materialized packages, an otherwise unchanged update restores the cache from the same refs and reports Restored dependency cache without changing refs. No confirmation is required because dependency refs do not move.

When a revision-pinned dependency has no eligible stable annotated semver tag, APM emits one summary warning and retains its current SHA while continuing with unrelated updates. Use --verbose to list each retained pin. Transport failures and malformed or ambiguous tag records still fail the update before writes.

Back-compat: apm update used to be the self-updater

Section titled “Back-compat: apm update used to be the self-updater”

In earlier releases, apm update self-updated the APM CLI binary. That behavior moved to apm self-update and apm update was repurposed as the dependency updater described above.

For one release after the rename, running apm update from a directory without an apm.yml prints a deprecation banner and forwards to apm self-update. This shim is removed in the next minor release. Use your package manager for CLI upgrades, or apm self-update for standalone installs.

Copyright (c) Microsoft Corporation. General documentation: CC-BY-4.0. Software, code examples and OpenAPM: Apache-2.0. See scope and exclusions.