apm deps
Inspect, update, and clean dependencies that apm install placed under apm_modules/. apm deps is a command group; every action lives in a subcommand.
Synopsis
Section titled “Synopsis”apm deps SUBCOMMAND [OPTIONS]Description
Section titled “Description”apm deps is the read-and-maintenance counterpart to apm install. It reads apm.lock.yaml and the apm_modules/ tree to show what is installed, refresh git refs, or remove the tree entirely. It does not add new packages — use apm install <package> for that.
All subcommands operate on the project scope (./apm_modules/) by default. Pass -g / --global where supported to operate on $APM_HOME/apm_modules/ (default ~/.apm/apm_modules/). Target files do not move; see the APM_HOME path contract.
Subcommands
Section titled “Subcommands”| Subcommand | Purpose |
|---|---|
list | List installed dependencies with per-primitive counts. |
tree | Render the dependency graph as a tree. |
info PACKAGE | Show detailed metadata for one installed package. |
why PACKAGE | Explain why a transitive dependency is installed (analogue of npm why). |
update [PACKAGES...] | Re-resolve git refs and reinstall. |
clean | Remove the entire apm_modules/ directory. |
apm deps list
Section titled “apm deps list”List every installed dependency recorded by the manifest or lockfile and the primitive counts each one contributes. Manifests embedded anywhere inside an installed package’s source tree are parent-owned content, not separate dependencies. Real lockfile-resolved dependencies install at their own package roots and remain visible regardless of graph depth.
Packages on a non-default host are listed by their host-qualified key, such as
gitlab.example.com/org/repo, the key apm deps tree shows and
apm uninstall accepts. The Source column follows the declared or locked host
type, so a self-hosted GitLab declared with type: gitlab shows gitlab, and a
host APM does not recognize as GitHub, GitLab or Azure DevOps shows git.
Orphan status uses the same selection as apm prune. Skills
bundled inside a declared package, such as a whole-repository skill bundle,
belong to that package and are not orphans, including after a GitHub
owner/repository casing change. A real package installed above a declared
subdirectory dependency is still reported, although apm prune keeps it
because it contains that dependency.
Declared or locked aliases are found at apm_modules/<alias> and displayed
under their logical dependency identity. The selected project or user store
remains authoritative; listing does not search another store to fill a gap.
Local dependencies are shown as portable _local/<name> keys rather than
machine-specific absolute paths. For a direct local declaration with matching
apm.lock.yaml metadata, copy that key into apm uninstall (with -g for user
scope). Without a lockfile, use the exact path from the manifest. Transitive
local dependencies are removed through their declaring parent. If more than one
declared local path has the same name, apm uninstall reports an ambiguity and
changes nothing; use one exact path already declared in apm.yml.
apm deps list [OPTIONS]| Option | Description |
|---|---|
-g, --global | List user-scope dependencies under $APM_HOME (default ~/.apm) instead of the project. |
--all | Show both project and user-scope dependencies. |
--insecure | Show only dependencies locked to http:// sources. Adds an Origin column distinguishing direct declarations from via <parent> transitive pulls. |
The listing also reports what each package declares and where it was deployed. It never fetches registries, connects to servers or runs package content, and neither column says whether a server is healthy or authenticated.
| Column | Meaning |
|---|---|
MCPs | Number of MCP servers the package declares, read the way install reads them: its apm.yml (for a Claude or marketplace plugin, the manifest install generates from mcpServers / .mcp.json), or a native Agent Plugin’s MCP resource. 0 means none; ? means the package could not be inspected. The count is per package, not per target. |
Targets | The targets recorded for the package in the listed scope’s apm.lock.yaml, such as claude, codex. A project and a user install of one package can differ. |
Targets comes only from recorded deployments, never from the configured
targets or from directory names:
| Value | Meaning |
|---|---|
claude, codex | Every recorded deployment names a target. |
claude, codex* | Some deployments cannot be attributed to a target: legacy records, MCP or LSP servers without package-owned deployment records, or MCP definitions that could not be read. |
ambiguous | Deployments are recorded, but none names a target (legacy records). |
unknown | Nothing can be attributed: an older lockfile with no recorded deployments, a package missing from the lockfile, or deployable content with no attributable record. An MCP-only package shows unknown unless a record names it as an owner. |
- | Nothing to deploy and nothing recorded. |
A one-line legend under the table explains the *, unknown and ambiguous
cells in that listing, and only those.
A deployment shared by several packages is credited to each. A directory shared
by several targets, such as .agents/skills (Codex, agent-skills and
Antigravity), is never read as a target: a row counts only for the target
recorded on it, and a shared-directory row recorded without a target stays
unattributed.
apm deps tree
Section titled “apm deps tree”Render the complete dependency graph as a hierarchical tree, following
resolved_by relationships at every lockfile depth. When sibling
subdirectory packages from one repository share a resolved_by value, each
child is placed under the sibling whose installed apm.yml declares it; a
child that no single parent declares is listed as could not place in tree.
When no lockfile is
present, the command falls back to a scan of apm_modules/ and ignores
parent-owned manifests embedded inside an installed package. Circular
relationships are marked (circular) at the repeated ancestor and do not
prevent other branches from rendering.
apm deps tree [OPTIONS]| Option | Description |
|---|---|
-g, --global | Show the user-scope tree under $APM_HOME (default ~/.apm). |
apm deps info
Section titled “apm deps info”Show detailed information about one installed package: manifest metadata, primitive inventory, and source. Equivalent to apm view PACKAGE for installed packages; prefer apm view in new scripts.
apm deps info PACKAGE| Argument | Description |
|---|---|
PACKAGE | Name of an installed package under apm_modules/. Required. |
apm deps why
Section titled “apm deps why”Explain why a transitive dependency is installed, by walking the lockfile’s resolved_by chain from the queried package back to the user’s direct declaration in apm.yml. Subdirectory packages appear by their full path. The walk uses the lockfile alone, so it does not consult installed manifests to tell same-repository siblings apart. The APM analogue of npm why / yarn why / cargo tree -i.
apm deps why PACKAGE [OPTIONS]| Argument | Description |
|---|---|
PACKAGE | The installed package to explain. Accepts the lockfile key (owner/repo, or host/owner/repo for non-GitHub hosts) or the bare repo name when unambiguous. URLs are not normalized. |
| Option | Description |
|---|---|
-g, --global | Read $APM_HOME/apm.lock.yaml (default ~/.apm/apm.lock.yaml) instead of the project lockfile. |
--json | Emit a machine-readable JSON document to stdout. All logs and error payloads are routed to stderr so apm deps why pkg --json | jq is safe. |
Exit codes: 0 on success, 1 when the package is not installed or the query matches multiple packages, 2 when no lockfile exists.
apm deps update
Section titled “apm deps update”Re-resolve git references for installed dependencies (direct and transitive), download updated content, re-integrate primitives, and regenerate apm.lock.yaml.
apm deps update [PACKAGES...] [OPTIONS]| Argument | Description |
|---|---|
PACKAGES... | Optional. One or more packages to update. Omit to update everything. |
| Option | Description |
|---|---|
-v, --verbose | Show detailed update information. |
--force | Overwrite locally-authored files on collision. |
-t, --target | Force deployment to specific targets. Comma-separated. Values: agent-skills, all, antigravity, claude, codex, copilot, cursor, gemini, grok-bot, grok-build, hermes, intellij, kiro, opencode, windsurf. Aliases: agents for copilot, agy for antigravity; vscode is a deprecated alias of copilot and warns. Experimental targets (copilot-app, copilot-cowork, grok-cloud, openclaw) are also accepted when their feature flags are enabled. all excludes agent-skills, antigravity, grok-bot, hermes, experimental targets, and intellij. |
--parallel-downloads N | Max concurrent downloads. Default 4. 0 disables parallelism. |
-g, --global | Update user-scope dependencies under $APM_HOME (default ~/.apm). |
--legacy-skill-paths | Deploy skill files to per-client paths (.cursor/skills/, etc.) instead of the shared .agents/skills/ directory. Env: APM_LEGACY_SKILL_PATHS=1. |
apm deps update runs the install pipeline and is gated by org apm-policy.yml. There is no --no-policy flag; the only escape hatch is APM_POLICY_DISABLE=1 for the shell session.
Like apm update, it refuses an apm.lock.yaml written by a newer APM before changing anything, naming both versions and how to upgrade; see Lockfile written by a newer APM.
apm deps clean
Section titled “apm deps clean”Remove the entire project apm_modules/ directory. Does not touch apm.yml or apm.lock.yaml.
apm deps clean [OPTIONS]| Option | Description |
|---|---|
--dry-run | Show what would be removed without removing. |
-y, --yes | Skip the confirmation prompt (for CI and scripts). |
Examples
Section titled “Examples”List project dependencies:
apm deps listSample output:
Package Version Source Prompts Instructions Agents Skills Hooks compliance-rules 1.0.0 github 2 1 - 1 - design-guidelines 1.0.0 github - 1 1 - - _local/review-kit 0.4.0 local 1 2 - - -Show only insecure (HTTP-locked) dependencies and their origin:
apm deps list --insecureRender the tree:
apm deps treemy-project (local)+-- compliance-rules@1.0.0| +-- 1 instruction, 1 skill+-- design-guidelines@1.0.0 +-- 1 instruction, 1 agentInspect one installed package:
apm deps info compliance-rulesUpdate everything:
apm deps updateUpdate specific packages with verbose output:
apm deps update org/pkg-a org/pkg-b --verbosePreview a clean, then run it non-interactively:
apm deps clean --dry-runapm deps clean --yesRelated
Section titled “Related”apm install— add packages and run the install pipeline.apm uninstall— remove a single package and its deployed files.apm outdated— check remotes for newer versions without modifying anything.- Lockfile spec — structure of
apm.lock.yamlthatapm depsreads.
Copyright (c) Microsoft Corporation. General documentation: CC-BY-4.0. Software, code examples and OpenAPM: Apache-2.0. See scope and exclusions.