feat(mise): add APM CLI to the devcontainer#488
Merged
Conversation
Install the Agent Package Manager (`apm`) via mise's pipx backend (PyPI `apm-cli`), pinned to 0.21.0 and tracked by Renovate. Because the dotfiles devcontainer Dockerfile copies .mise.toml and runs `mise install` during prebuild, `apm` is baked into the published image and available on PATH (via mise shims) in every downstream devcontainer. The pipx backend is used deliberately: APM's GitHub binary release is a PyInstaller bundle (apm + _internal/), which mise's github/ubi backends extract incompletely (missing libpython), so the binary fails to run. The PyPI package installs cleanly and `apm --version` works. This lets every devcontainer consume APM packages like DevSecNinja/ai-toolkit (`apm install …`).
List `apm --version` under the manifest's Key tools so the prebuilt image's release notes advertise APM alongside Node.js, Task and the rest. (It also appears automatically under the mise tools section via `mise ls --current`.)
`mise install` failed in CI with "No version is set for shim: uv": the pipx backend shells out to `uv tool install`, but uv was not a declared tool. The earlier local test passed only because uv was already present from prior `uv pipx:` installs. Declare uv explicitly (matching how the org lint workflow installs `uv pipx:<tool>`). Verified a clean `mise install` now provisions uv then apm-cli, and `apm --version` works.
Owner
Author
|
Fixed the CI failures in Root cause: Fix: declare Verified locally with a clean |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds the Agent Package Manager (
apm) to the dotfiles devcontainer so every container built fromghcr.io/devsecninja/dotfiles-devcontainercanapm installAI agent primitives (e.g.DevSecNinja/ai-toolkit).How
One line in
.mise.toml:The Dockerfile copies
.mise.tomland runsmise installduring prebuild, and mise shims are on the bakedENV PATH— soapmlands in the published image and is available in every downstream devcontainer's lifecycle hooks. Version-pinned and Renovate-tracked, following the same inline# renovate:pattern already used forchezmoiin this file.Also lists
apm --versionunder the software manifest's Key tools (it already auto-appears in themise ls --currentsection).Why pipx, not the github binary backend
I verified this empirically before choosing:
ubi:/github:backends extract only theapmexecutable from APM's release, but it's a PyInstaller bundle (apm+_internal/). The bundle'slibpython3.12.sois left behind →apm --versionfails withFailed to load Python shared library. (ubiis also deprecated in mise.)curl … | shinstaller works but isn't version-pinned/Renovate-friendly and adds a bespoke install path.pipx:apm-cli(PyPI, same project — v0.21.0 matches the GitHub release) installs cleanly andapm --version→Agent Package Manager (APM) CLI version 0.21.0. It also matches the org's existing misepipx:usage (pipx:yamllint,pipx:checkovin.github'slint.yml).Verification
Locally, on this branch's config:
Note for reviewer
I couldn't trigger the actual devcontainer prebuild from here — please let the
devcontainer-prebuildworkflow build the image and confirmapmresolves in the resulting container. The mise/pipx install was verified in isolation; the only integration assumption is that prebuild'smise installpicks up the new tool (same mechanism as every other tool in this file).