feat(kyberforge): document the per-repo uv pin of apm in apm-install
Add a dispatch on where apm comes from: a repo that pins apm with uv, a repo that wants the pin, or a global install. The new uv-pin reference covers the pyproject.toml dev group, the committed uv.lock, running as uv run --frozen apm, the one-time online sync, upgrading the pin, and why uvx and uv tool are not used. It closes with a worked example of one pinned and one unpinned repo. Raise the pip floor to Python 3.11, which apm requires since 0.36.0, add the package-manager installs, and note the 0.39.2 minimum for v4 locks. Bump metadata.version to 1.0.2. Refs: #273 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
This commit is contained in:
1 parent
5f9c805522
commit
b81af32425
3 files changed
+144
-9
No files matched your search
@@ -6,20 +6,33 @@ description: >
|
||||
authoring, publishing, auditing, or dependency installation for an apm
|
||||
package -> `apm-workflow`.
|
||||
metadata:
|
||||
version: "1.0.1"
|
||||
version: "1.0.2"
|
||||
category: apm
|
||||
source_keys:
|
||||
- context7-microsoft-apm
|
||||
- apm-v0-39-3-docs
|
||||
- apm-cli-0-39-3-uv-experiments
|
||||
---
|
||||
|
||||
## Gotchas
|
||||
|
||||
- apm never executes an agent itself — it only installs and manages the runtimes that do. Installing apm alone leaves the user with a package manager and no working agent CLI, so Step 2 is required whenever the user actually wants one; skip it only when they explicitly want the package manager alone.
|
||||
- apm never executes an agent itself — it only installs and manages the runtimes that do. Installing apm alone leaves the user with a package manager and no working agent CLI, so Step 3 is required whenever the user actually wants one; skip it only when they explicitly want the package manager alone.
|
||||
- `apm runtime setup copilot` needs Node.js v22+ and npm v10+ already on `PATH`; apm will not install them for you.
|
||||
- In a repo that pins apm with uv, the `PATH` apm is not the repo's apm and may refuse its lockfile. Never upgrade the global apm to fix one repo: other repos may depend on its version.
|
||||
|
||||
## Step 1 — Install the apm CLI
|
||||
## Step 1 — Choose where apm comes from
|
||||
|
||||
If `apm --version` already answers and the user is not pinning or upgrading, skip to Step 2.
|
||||
| Condition | Method | Where |
|
||||
|---|---|---|
|
||||
| The repo pins apm: `pyproject.toml` names `apm-cli` in a dependency group, beside a `uv.lock` | Per-repo pin. Use or upgrade it, never the global apm | `references/uv-pin.md` |
|
||||
| The user wants apm fixed per repo, and uv is available | Per-repo pin. Set it up | `references/uv-pin.md` |
|
||||
| Anything else: a machine-wide apm, a CI image, no uv | Global install | Step 2 |
|
||||
|
||||
Unsure which row applies: read the worked example closing `references/uv-pin.md`.
|
||||
|
||||
## Step 2 — Install the global apm CLI
|
||||
|
||||
If `apm --version` already answers and the user is not pinning or upgrading, skip to Step 3.
|
||||
|
||||
Default:
|
||||
|
||||
@@ -29,16 +42,17 @@ curl -sSL https://aka.ms/apm-unix | sh
|
||||
|
||||
Escape hatches — combine as needed:
|
||||
|
||||
- **Pin a version** — append `@vX.Y.Z` to the piped script's arguments: `curl -sSL https://aka.ms/apm-unix | sh -s -- @v1.2.3`.
|
||||
- **Pin a version** — append `@vX.Y.Z` to the piped script's arguments: `curl -sSL https://aka.ms/apm-unix | sh -s -- @v1.2.3`. Pick 0.39.2 or later for a repo whose `apm.lock.yaml` an apm 0.39.2 or later wrote; older versions refuse it.
|
||||
- **Custom install directory** — set `APM_INSTALL_DIR` on the piped script's command: `curl -sSL https://aka.ms/apm-unix | APM_INSTALL_DIR=$HOME/.local/bin sh`.
|
||||
- **Air-gapped mirror / GitHub Enterprise** — an air-gapped host cannot reach `aka.ms` at all, so get `install.sh` onto the box and run it from disk instead of piping. Point it at the mirror with `APM_RELEASE_BASE_URL` and pin `VERSION`: `APM_RELEASE_BASE_URL=https://mirror.corp/apm VERSION=v1.2.3 sh install.sh`; add `APM_RELEASE_METADATA_URL` instead if you leave `VERSION` unset. `GITHUB_URL` is the GitHub Enterprise host, not a release mirror. All four are ordinary environment variables that also work through the pipe — running from disk is a network constraint, not a script one.
|
||||
- **pip** — `pip install apm-cli` requires Python 3.10+. Not on an externally-managed (PEP 668) Python such as Debian or Ubuntu, where it hard-fails with `error: externally-managed-environment`; use pipx below. The quick-install script has no Python prerequisite, so prefer it unless the environment is pip-first.
|
||||
- **Air-gapped mirror / GitHub Enterprise** — an air-gapped host cannot reach `aka.ms` at all, so get `install.sh` onto the box and run it from disk instead of piping. Point it at the mirror with `APM_RELEASE_BASE_URL` and pin `VERSION`: `APM_RELEASE_BASE_URL=https://mirror.corp/apm VERSION=v1.2.3 sh install.sh`; add `APM_RELEASE_METADATA_URL` instead if you leave `VERSION` unset. `GITHUB_URL` is the GitHub Enterprise host, not a release mirror.
|
||||
- **pip** — `pip install apm-cli` requires Python 3.11+ (since apm 0.36.0), and so does every other Python-based install. Not on an externally-managed (PEP 668) Python such as Debian or Ubuntu, where it hard-fails with `error: externally-managed-environment`; use pipx below. The quick-install script has no Python prerequisite, so prefer it unless the environment is pip-first.
|
||||
- **pipx** — `pipx install apm-cli` on those PEP 668 environments. Same PyPI package, but pipx builds an isolated venv and exposes `apm` on `PATH`.
|
||||
- **Package managers** — `brew install apm`, `winget install --id Microsoft.APM --exact --source winget` or `scoop install apm`. The apm docs give no way to pin a version through them.
|
||||
- **Manual** — download the platform archive from the GitHub releases page, extract, and place the binary on `PATH`.
|
||||
|
||||
Verify with `apm --version`.
|
||||
|
||||
## Step 2 — Install or manage an agent runtime
|
||||
## Step 3 — Install or manage an agent runtime
|
||||
|
||||
Default:
|
||||
|
||||
@@ -46,7 +60,7 @@ Default:
|
||||
apm runtime setup copilot
|
||||
```
|
||||
|
||||
Other targets: `apm runtime setup codex`, `apm runtime setup gemini`, `apm runtime setup llm`.
|
||||
Other targets: `apm runtime setup codex`, `apm runtime setup gemini`, `apm runtime setup llm`. In a repo that pins apm, spell each of these as `uv run --frozen apm runtime …`.
|
||||
|
||||
- `apm runtime list` — show installed runtimes.
|
||||
- `apm runtime status` — show which runtime `apm run` will pick by default.
|
||||
|
||||
Reference in new issue
Block a user