apm README

项目的 README,来自 github.com/microsoft/apm。合并为一个 markdown 文件:README.md。

APM - Agent Package Manager

An open-source, community-driven dependency manager for the agent supply chain.

One manifest, one lockfile and one org policy for the skills, plugins and MCP servers your agents load, with the harnesses and marketplaces you already use.

GitHub Copilot | Claude Code | Grok Build | Cursor | OpenCode | Codex | Gemini CLI | Windsurf | Kiro

Documentation | Quickstart | CLI Reference | Roadmap


Portable by manifest. Verified by lockfile. Governed by policy. One file declares what your agents load; one lockfile reproduces it on every machine and in CI; one policy decides what your organization allows.

Why APM

What a coding agent loads decides what it knows and what it can do: skills, instructions, prompts, agents, hooks, plugins and MCP servers. Today teams copy those files between repositories and hand-edit MCP config for every tool. The copies drift, nobody can say which version a repository follows, and nothing reproduces the setup on the next laptop or in CI.

APM treats them as dependencies. Declare them once in apm.yml. apm install writes each one in every harness's own format and records the exact commit, plus a SHA-256 hash of every file it wrote, in apm.lock.yaml. Think package.json and package-lock.json, or Cargo.toml and Cargo.lock, for your agents, with transitive dependency resolution included.

# apm.yml -- ships with your project
name: your-project
version: 1.0.0
targets: [copilot, claude]   # the harnesses this project supports
dependencies:
  apm:
    # A skill, picked from a public collection
    - git: vercel-labs/agent-skills
      skills:
        - deploy-to-vercel
    # A plugin, from Anthropic's marketplace
    - git: https://github.com/anthropics/claude-plugins-official
      path: plugins/commit-commands
      ref: main
  mcp:
    # An MCP server, configured for every harness above
    - name: io.github.github/github-mcp-server
      transport: http   # MCP transport name, not URL scheme -- connects over HTTPS
git clone <org/repo> && cd <repo>
apm install    # the same skills, plugins and MCP servers, from the lockfile

Coming from npx skills add? Drop-in:

apm install vercel-labs/agent-skills                            # whole bundle, like npx skills add
apm install vercel-labs/agent-skills --skill deploy-to-vercel   # one skill, persisted to apm.yml

Same install gesture. You also get a manifest, a lockfile and a fresh clone that matches yours. Coming from Claude Code marketplaces, gh skill or hand-copied folders? See Coming from another tool.

Plugins from the marketplaces you already use:

apm marketplace add anthropics/claude-code
apm install commit-commands@claude-code-plugins

One plugin, written in each harness's own format (commands for Claude Code, prompts for GitHub Copilot) and pinned in the lockfile.

MCP servers without hand-edited JSON:

apm install --mcp io.github.github/github-mcp-server --transport http

Every harness keeps MCP servers in its own file: .mcp.json for Claude Code and GitHub Copilot, .cursor/mcp.json for Cursor, .codex/config.toml for Codex. Declare a server once and APM writes each file, on every machine. Add a harness later and the same servers follow. Tokens stay out of the repository as ${VAR} references, and a server that arrives through someone else's package with its own command is held back until you declare or approve it.

The three promises

1. Portable by manifest

One apm.yml declares every primitive your agents need -- instructions, skills, prompts, agents, hooks, plugins, MCP servers -- and apm install reproduces the same setup in every harness the project targets, on every machine. No account and no registry: packages come from git.

2. Verified by lockfile

Agent context is executable in effect -- a prompt is a program for an LLM, and hooks and MCP servers start processes on your machine. APM records exactly what you installed and checks it on every clone and every pull request. A lockfile records what arrived, not that it can be trusted: review a new dependency, or a version bump, the way you review code.

3. Governed by policy

Teams that run coding agents at scale end up building the same thing: a central team publishes approved skills, plugins and MCP servers through its own marketplace, and many repositories install from it. apm-policy.yml lets that team say which sources, MCP servers and executables the organization allows, inherited from an enterprise baseline that each organization can tighten but never loosen, and a required apm audit --ci check enforces it on every pull request. Policy starts in warn mode; you switch it to block when you are ready. That is the dependency layer for an agentic SDLC.

APM governs what gets installed; your harness governs what runs. Policy is not a sandbox.

Get Started

macOS with Homebrew

brew install apm

No custom tap is required. Homebrew manages installation and updates: use brew upgrade apm, not apm self-update.

Linux / macOS without Homebrew

curl -sSL https://aka.ms/apm-unix | sh

Windows

irm https://aka.ms/apm-windows | iex

Native release binaries are published for macOS, Linux, and Windows x86_64. For standalone installations, apm self-update reuses the matching platform installer. You do not need Homebrew to use APM.

Other install methods: pip, WinGet, and Scoop

Linux / macOS

# pip (Python 3.11+)
pip install apm-cli

Windows

# WinGet
winget install --id Microsoft.APM --exact --source winget
# Scoop
scoop install apm
# pip
pip install apm-cli

Already using the Microsoft Homebrew tap? See the migration guide.

Then follow the Quickstart: add a skill, a plugin and an MCP server, commit apm.yml and apm.lock.yaml, and check a teammate's fresh clone against the lockfile, in five minutes.

Teach your coding agent to use APM with the official guide (an expert agent plus the apm-usage skill):

apm install microsoft/apm/packages/apm-guide#v0.39.0

Community

Created by @danielmeppiel. Maintained by @danielmeppiel and @sergio-sisternes-epam.

In the ecosystem: Thoughtworks Technology Radar Vol. 35 places APM in Trial, describing it as a tool that treats agent context as a supply chain. Dependabot and Renovate update APM manifests; JFrog Artifactory offers Agent Packages repositories. The formats are an open specification, OpenAPM v0.1, with conformance tests.


Built on open standards: AGENTS.md | Agent Skills | MCP

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

apm (microsoft/apm)

正在搜索数据库…

4.4K ·GitHub
这是什么?APM(Agent Package Manager)是一款开源的 AI 编程代理上下文依赖管理器——就像 package.json 或 Cargo.toml,但管理的是指令、技能、提示词和 MCP 服务器等代理配置。
这是 CLI 工具,还是导入到我代码里的东西?它是你在仓库中运行的独立 CLI——你在 apm.yml 中声明依赖,运行 apm install 即可复现代理配置,没有任何要导入的东西。
怎么安装并开始使用?在 macOS 上通过 Homebrew 安装,获取 macOS/Linux/Windows 的原生二进制,或使用 pip、WinGet 或 Scoop,然后运行 apm install 拉取项目声明的代理包。
我需要先装 Homebrew 或 Python 吗?不需要——Homebrew 只是一种安装途径,pip 是另一种,独立的原生二进制两者都不需要。
组织策略能控制我的代理实际能运行什么吗?不能——apm-policy.yml 只管安装到磁盘上的内容;代理随后运行什么仍取决于你的代理运行框架(harness),这两层是有意分开的。
它能运行在哪些操作系统上?为 macOS、Linux 和 Windows(x86-64)发布了原生二进制版本。
APM 能配合哪些编程代理使用?一份 apm.yml 清单即可一次性把配置接入 GitHub Copilot、Claude Code、Grok Build、Cursor、OpenCode、Codex、Gemini、Windsurf 和 Kiro。
agentrc 是什么?它与 APM 有什么关系?agentrc 分析你的代码库,从真实代码生成量身定制的代理指令,然后你可以用 APM 打包并分发这些指令。
apm audit 实际检查什么?它从零重建你的代理上下文,并与你的工作树做 diff 以发现手动改动,同时运行与 apm install 相同的内容安全扫描。
能为已安装的包导出软件物料清单(SBOM)吗?可以——apm lock export 直接从锁文件生成 CycloneDX 或 SPDX 输出,用于来源追踪。
作者
microsoft
大小
53.7 MB
星标
4.4K
时长
1年
提交 · 90 天