AGENTS.md instructions for /Users/jdx/.codex/worktrees/0f43/mise
This file provides guidance to AI coding agents when working with code in this repository. It keeps the CLAUDE.md filename for compatibility with existing tooling, and AGENTS.md symlinks to it for other agents.
Registry Submissions: READ THIS FIRST
Most registry PRs from agents get rejected. Before adding anything to registry/, understand the rules:
mise does not host self-written, personal, niche, or low-popularity tools. The registry is curated for tools that are already widely used. "It works" or "it has tests" is not the bar.
Tools that aren't VERY popular will be rejected without explanation. Per contributing.md: "@jdx won't explain why a given tool wasn't accepted." There is no appeal, no checklist, no second chance — the PR is closed and that's it.
Wasted PRs are the default outcome for tools the agent or user has not vetted against this bar. Do not submit one speculatively.
Required pre-submission check
Before touching registry/, ALWAYS do the following:
Ask the user: "Is this tool already widely used outside your own projects?" — if it's the user's own tool, a fork, an internal/company tool, or something with a small audience, stop and tell them the PR will be rejected. Do not submit.
Actively check popularity for every registry PR — no exceptions. Look up real numbers; do not guess. Useful sources:
Whether the project shows up in third-party docs, awesome-lists, or other tools
Apply the bar. Rough signals — very low numbers are disqualifying:
GitHub stars in the thousands, not hundreds
Active maintenance (recent releases, not abandoned)
Real third-party usage (referenced in docs, blog posts, other tools, package registries)
Recognizable in its ecosystem
Include the popularity data in the PR description. Every registry PR body MUST contain a short section like:
code
## Popularity
- GitHub: 12.3k stars, 480 forks, last release 2026-04-12
- crates.io: 1.2M downloads
- Used by: <project A>, <project B>
This is non-negotiable — it lets the maintainer evaluate the submission without re-doing the research. PRs without it look speculative and are more likely to be rejected.
If the tool is borderline or numbers are low, warn the user clearly that the PR is likely to be rejected without reason, and ask if they still want to proceed. Do not soften this — users have repeatedly been surprised when their PR was closed, and the agent should have warned them up front.
Suggest the alternative: users can install any tool themselves via explicit backend syntax (mise use aqua:owner/repo, mise use github:owner/repo, mise use cargo:name, mise use npm:name, etc.) or by writing a tool plugin. The registry is only for shorthand convenience for popular tools — not for enabling installation.
Backend choice: aqua (preferred) or github
For registry entries the backend tiers are:
Tier 1 — preferred:aqua:, github:, and gitlab:. These are the routinely accepted backends.
Prefer aqua: when the tool is in the aqua registry. Better UX, SLSA verification, and per-version logic.
Use github: when the tool isn't in aqua but ships GitHub releases.
Use gitlab: for tools released through GitLab.
Tier 2 — high bar, but lower than tier 3:conda:. Potentially acceptable when the tool can't be supported via aqua/github. The bar is lower than tier 3 because the conda backend in mise does not require a separately-installed package manager — mise downloads and extracts packages directly from anaconda.org via rattler, so users don't need conda/mamba on PATH. Still requires a popular, well-maintained tool.
Tier 3 — extremely high bar, almost never accepted:npm:, pipx:, gem:, cargo:, go:, dotnet:. These all rely on a separately-installed runtime/toolchain being present on PATH (node, python, ruby, cargo, go, dotnet), which is fragile — the wrong version, a missing install, or PATH ordering quirks all break them. npm:/pipx:/gem: are particularly painful because tools installed via them silently bind to whichever node/python/ruby was on PATH at install time. Don't reach for these for a registry PR unless the user has explicitly confirmed @jdx wants it that way for this specific tool.
Not accepted at all:
New asdf: plugins — supply-chain security. Use aqua/github instead.
New vfox: plugins — same reason. Use aqua/github instead.
ubi: is deprecated and will not be accepted under any circumstances.
Users can still install via any backend themselves with explicit syntax (mise use vfox:..., mise use cargo:..., etc.) — they just don't get a registry shorthand for it.
Development Commands
Building and Testing
mise run build or mise run b - Build the project with cargo
target/debug/mise - Run the built binary directly
mise run test or mise run t - Run all tests (unit + e2e)
mise run test:unit - Run unit tests only
mise run test:e2e - Run end-to-end tests only
mise run snapshots - Update test snapshots with cargo insta
Debugging
Use MISE_DEBUG=1 or MISE_TRACE=1 environment variables to enable debug output (not RUST_LOG)
Code Quality and Testing
mise run lint - Run all linting tasks
mise run lint-fix - Run linting and automatically fix issues
mise run format - Format code (part of CI task)
mise run ci - Run format, build, and test
mise run test:e2e [test_filename]... - Run specific e2e tests (use this instead of executing test files directly)
mise --cd crates/vfox run test - Run tests for the vfox crate
mise --cd crates/vfox run lint - Run linting for the vfox crate
mise --cd crates/vfox run lint-fix - Run linting and fix issues for the vfox crate
mise task ls - List all available tasks
Documentation and Generation
mise run render - Generate all documentation and completions
mise run render:usage - Generate CLI usage documentation
mise run render:completions - Generate shell completions
mise run docs - Start documentation dev server
mise run docs:build - Build documentation
Development
mise run install-dev - Install development version locally
mise run clean - Clean cargo build artifacts
Code Architecture
High-Level Structure
Mise is a Rust CLI tool that manages development environments, tools, tasks, and environment variables. The codebase follows a modular architecture:
Core Components:
src/main.rs - Entry point and CLI initialization
src/cli/ - Command-line interface implementation with subcommands
src/config/ - Configuration file parsing and management
registry: - Any changes to registry/ (no scope needed, use for both new tools and fixes)
Scopes:
For command-specific changes, use the command name: install, activate, use, exec, etc.
For subsystem changes: config, backend, env, task, vfox, python, github, release, completions, http, schema, doctor, shim, core, deps, ci
Use task (not run) for task-related changes, even if the code lives in src/cli/run.rs or src/cmd.rs
Description Style:
Use lowercase after the colon
Use imperative mood ("add feature" not "added feature")
Keep it concise but descriptive
Examples:
fix(install): resolve version mismatch for previously installed tools
feat(activate): add fish shell support
feat(vfox): add semver Lua module for version sorting
feat(env): add environment caching with module cacheability support
docs(contributing): update hk usages
chore: release 2026.1.6
chore(ci): add FORGEJO_TOKEN for API authentication
registry: add miller
Pre-commit Process
Run hk install --mise once to set up pre-commit hooks (runs hk fix automatically on commit)
Run mise run lint-fix and git add any lint fixes before committing
Use mise run test:e2e [test_filename]... for running specific e2e tests
Never run e2e tests by executing them directly - always use the mise task
Deprecation Policy
When deprecating a feature or backend:
Immediately: Mark as deprecated in docs (add warning banner)
6 months later (warn_at): Display deprecation warning in CLI using deprecated_at! macro from src/output.rs
12 months after warn (remove_at): debug_assert! in deprecated_at! fires, signaling the code should be removed
Use mise version format for dates (e.g., deprecated_at!("2026.10.0", "2027.10.0", "id", "message")).
If the replacement has been available for a long time, the CLI warning can start immediately (set warn_at to the current version).
Important Implementation Notes
Backend System
When implementing new tool backends, follow the pattern in src/backend/mod.rs. Each backend must implement the Backend trait with methods for listing versions, installing tools, and managing tool metadata.
DO NOT ASSUME SEMVER
Do not assume tool versions follow semver or any other orderable scheme. mise manages hundreds of tools with wildly different versioning conventions:
Tool-specific meanings of latest (e.g. some exclude pre-releases, some don't)
Rules:
Do not call versions::Versioning::new(...) (or any other semver comparator) at a new call site to pick the "newest" version, "resolve latest", or sort a version list. That crate silently returns None / arbitrary ordering for non-semver strings, which means wrong versions get chosen for many tools.
To resolve a version request (latest, a prefix, a channel name), delegate to the backend via Backend::latest_version, Backend::latest_installed_version, Backend::list_versions_matching, or ToolRequest::resolve — the backend knows what "latest" means for its tool.
To list installed versions in a meaningful order, use Backend::list_installed_versions_matching or the toolset's resolved versions. Do not reorder them yourself.
Lockfile version strings must be treated as opaque — compare with ==, never with a version ordering. Never write a non-concrete string (latest, lts/*, a prefix) into the lockfile; resolve first.
A few existing call sites (e.g. runtime symlinks) do use Versioning ordering today, but that's legacy behavior and arguably also wrong — do not point at them to justify new semver assumptions.
If you think you need to pick "the newest installed version" at a new call site, stop and ask — that call almost always belongs on the backend, not inline.
Plugin Development
Core tools are implemented in src/plugins/core/
External plugins use ASDF or vfox compatibility layers
Plugin metadata is defined in mise.plugin.toml files
Configuration Parsing
The configuration system supports multiple file formats and environment-specific configs. Changes to settings require updating settings.toml and running mise run render:schema.
Testing Strategy
E2E tests are organized by feature area (cli/, config/, backend/, etc.)
Use snapshot testing for CLI output verification
Backend-specific tests verify tool installation and version management
Slow tests (marked with _slow suffix) test actual tool compilation/installation
Cross-Platform Considerations
Windows-specific implementations in files ending with _windows.rs
Platform-specific tool installation logic in core plugins
Shim system varies by platform (especially Windows)
we don't chmod mise e2e tests to be executable
GitHub Interactions
When posting comments on GitHub PRs or discussions, always include a note that the comment was AI-generated (e.g., "This comment was generated by an AI coding assistant.").
Documentation
URL Structure
When referencing mise documentation URLs, use the correct path structure based on the docs/ directory layout:
Dev tools & backends: mise.en.dev/dev-tools/backends/<backend>.html (e.g., mise.en.dev/dev-tools/backends/s3.html)
Configuration: mise.en.dev/configuration/...
Tasks: mise.en.dev/tasks/...
Environments: mise.en.dev/environments/...
CLI reference: mise.en.dev/cli/...
Do NOT use shortened paths like mise.en.dev/backends/... - always include the full path matching the docs/ directory structure.
I’ll take a look at the discussion itself and any linked context so I can summarize the actual issue rather than guessing from the number.
Assistant
The discussion is a fresh bug report from today: npm 12 changes the JSON shape for a specific npm view ... versions time --json call, and mise’s npm backend currently assumes the npm 10/11 shape. I’m checking the local backend code now to see exactly how brittle that path is.
Assistant
The local npm is still 11.16.0 here, so it won’t naturally reproduce the reporter’s npm 12 output. I’m going to inspect the parser and then simulate the npm 12 JSON payload against the shape mise expects.
Assistant
The interesting bit is that the report is not about installing packages; it fails earlier during remote version listing. The current code calls npm view <package> versions time --json, parses the top-level JSON as an object, and errors if versions is not directly present.
Assistant
With npm 11.16.0, I can confirm mise works and npm returns the old object shape. npm 12.0.0 is published, so I’m going to invoke npm 12 directly via npx and compare the same command.
Assistant
Npm 12 does reproduce the report: the payload is a one-element array whose first element has the old { versions, time } object. It also looks like dist-tags --json has the same wrapper, which means latest resolution may quietly return None under npm 12 even where the version list parser is fixed.
Assistant
It is not scoped-package-specific; lodash behaves the same under npm 12. So the compatibility issue is general for the npm backend whenever the user’s active npm is 12.x.
Assistant
One more wrinkle: npm 12 even changes single-field view output for versions from a direct array of strings into a one-element object wrapper. That makes a small normalization helper the cleanest fix, not just a one-off patch at versions/time.
Assistant
It’s a real compatibility bug, not user error.
npm 12.0.0 changed npm view --json as a documented breaking change: it now always returns an array. See the npm 12.0.0 release notes. The discussion reports that npm view @director.run/cli versions time --json used to return:
json
{ "versions": [...], "time": {...} }
but npm 12 returns:
json
[{ "versions": [...], "time": {...} }]
mise currently parses the old shape in src/backend/npm.rs, so data["versions"] is missing and it errors with invalid versions.
I also confirmed locally:
npm 11.16.0: old object shape, mise ls-remote npm:@director.run/cli works.
npm 12.0.0 via npx: array wrapper shape.
dist-tags --json is also wrapped in npm 12, so latest_stable_version likely needs the same normalization.
The fix should be small: unwrap npm 12’s one-element npm view --json array at the boundary, then use the normalized object for both versions/time and dist-tags. Add unit coverage for both npm 11 object shape and npm 12 array shape. The discussion has no replies yet.
User
make a pr
Assistant
I’ll patch this on a fresh codex/ branch, add focused coverage for both npm 11 and npm 12 JSON shapes, then push and open the PR. First I’m checking the current worktree and nearby tests so I don’t step on anything already in flight.
Assistant
The worktree is clean but currently detached, so I’m going to create codex/npm-12-view-json from this checkout before editing. The unit tests for this backend already live at the bottom of src/backend/npm.rs, which is a nice narrow place for this.
Assistant
I’ve got the branch. Next edit is a tiny parser normalization helper plus swapping both npm view JSON reads through it, so npm 10/11 object output and npm 12 array output land in the same code path.
Assistant
I’m factoring the JSON parsing enough to test the behavior directly: one helper normalizes npm 12’s wrapper, one builds VersionInfo, and one reads the latest dist-tag. That also catches the less obvious dist-tags break.
Assistant
I’m making the file edit now. It’s deliberately local to src/backend/npm.rs; no registry or backend behavior beyond npm view --json parsing.
Assistant
The parser helper is in. I’m adding tests that exercise the exact two shapes: legacy top-level object and npm 12’s one-element array wrapper, for both version metadata and dist-tags.
Assistant
The tests are added. I’m going to format the Rust file and run the focused npm backend unit tests first; after that I’ll decide whether a broader unit pass is worth the extra time.
Assistant
The focused test kicked off a cold-ish Rust compile, so it’s taking a minute. cargo fmt --check is already clean.
Assistant
Still compiling dependencies; nothing has failed yet. Once that finishes, the actual four new tests should run quickly.
Assistant
The targeted parser tests pass. I’m doing the whole npm backend unit slice now, since the compile is warm and this touches shared npm parsing helpers.
Assistant
All npm backend unit tests pass. I’m checking the diff and then I’ll run one build-level command so the PR has a clean verification story.
Assistant
The diff is small and matches the intended fix. I’m running the repository build task now; this gives the PR a repo-native verification line instead of just raw Cargo tests.
Assistant
The build is still compiling the all-features graph. No errors so far; I’ll let it finish before committing.
Assistant
Still waiting on cargo build --all-features; it’s quiet now, which usually means linking/late compile rather than a failure.
Assistant
Build passed. I’m doing the last hygiene checks now, then I’ll stage, commit with a conventional message, push, and open the PR.
Assistant
Hygiene looks good: no whitespace issues, build passed, and the real ls-remote path still works with the installed npm 11. I’m staging and committing now.
Assistant
Commit is created. I’m pushing the branch to origin next, then I’ll open the PR against the default branch with the discussion linked.
Assistant
The branch is clean at commit 92d0e7ca6. Pushing now.
Assistant
Push succeeded. I’m creating the PR with a compact body: summary, tests run, and a reference back to discussion #10887.
Assistant
Default branch is main. The PR status probe used an unsupported gh field, but that doesn’t affect anything; I’m creating the PR directly.
It normalizes npm 12’s npm view --json one-item array wrapper for both version metadata and dist-tags.latest, with tests for npm 11-style object output and npm 12-style wrapped output.
Verified with:
cargo fmt --check, cargo test backend::npm::tests -- --nocapture, mise run build, and a real target/debug/mise ls-remote npm:@director.run/cli | head -5.
I’ll add a short discussion reply linking the PR and flagging that it was AI-generated, per the repo guidance.
Assistant
Replied to the discussion with the PR link: comment.
User
address pr feedback and failing pr checks if any
Assistant
I’ll pull the PR state from GitHub first: reviews, inline comments, and check runs. Then I’ll patch whatever is actionable locally and rerun the relevant tests before pushing.
Assistant
Current PR state: no checks have failed yet; several are still pending. The only actionable feedback so far is Greptile’s two hardening notes: make unexpected multi-result npm JSON fail clearly, and don’t require time metadata if the registry omits it.
Assistant
I’ve made the parser stricter where the shape is truly unexpected and more tolerant when only timestamps are missing. Now I’m updating the focused tests to cover both behaviors.
Assistant
Tests now cover the review cases too: missing time falls back to created_at: None, while multiple npm view results produce a direct shape error. I’m formatting and running the npm backend unit slice again.
Assistant
The tests pass; formatting found two line wraps, so I’m applying rustfmt and then I’ll rerun the quick checks cleanly.
Assistant
Rustfmt is applied. I’m rerunning format-check, the focused npm tests, and checking the PR checks again in parallel.
Assistant
Local format and npm tests are green. CI still has pending jobs but no failures yet. I’m reviewing the final diff, then I’ll commit and push the feedback fix.
Assistant
The diff is clean and scoped to the review notes. I’m committing it as a follow-up fix and pushing it to the PR branch.
Assistant
Pushed the feedback commit. I’m refreshing review threads and CI now; because the branch changed, some checks will restart, so I’m watching for actual failures rather than treating pending as broken.
Assistant
CodeRabbit finished its first pass with one nitpick: add negative-path tests around malformed JSON. That’s cheap and useful, so I’m adding those now rather than leaving review noise behind.
Assistant
The negative-path tests are in, including the empty npm 12 array case where this PR now intentionally errors instead of silently returning no latest tag. Running the focused validation again.
Assistant
Focused validation is clean: format check, whitespace check, and all 44 npm backend tests pass. I’m committing and pushing the extra test coverage now.
Assistant
Second feedback commit is pushed. I’m refreshing review threads and CI one more time to see whether anything new or failing appeared after the latest push.
Assistant
Both Greptile review threads now show as resolved. CI restarted after the latest push and is pending, with no failures visible yet. I’m running the repo build locally again while GitHub catches up.
Assistant
Local mise run build passed after the feedback changes. I’m doing the real npm backend smoke test once more and then I’ll refresh CI status.
Assistant
Smoke test is good, and the latest CI wave has no failures so far. Only non-code-review services and benchmark are still pending/queued; I’ll give those a little time in case they surface new feedback.
Assistant
I’m still waiting on the delayed CI/check refresh command to return. No local work is outstanding; this is just making sure no late failing check or new review popped up.
Assistant
The latest full build/unit jobs have started now; still no failures, just pending. I’ll keep polling until the current wave settles or something actionable appears.
Assistant
CI is still in the wait window. The local branch remains clean and pushed; I’m just giving GitHub time to report the build/unit results.
Assistant
CodeRabbit is now complete and passing, and no new review comments showed up in that check summary. The build/unit jobs are still pending; I’m going to poll again for those.
Assistant
Review threads are resolved and CodeRabbit’s earlier nitpick is covered by the new tests. The current wait command is still polling the longer GitHub build jobs.
Assistant
The Ubuntu build passed; the e2e/lint/unit matrix has started and is still pending. Still no failures. I’ll keep watching until this wave gives a real pass/fail signal.
Assistant
Still in the scheduled wait. Nothing new to patch locally; this is just CI observation now.
Assistant
Most of the e2e matrix and unit-macos have passed. Remaining pending jobs are lint, two e2e shards, Windows/nightly, and benchmark; still no failures.
Assistant
Still waiting on the slow CI tail. I’ll keep it to status checks unless something actually fails.
Assistant
Windows build/unit and all visible e2e shards have passed; lint, windows-e2e, and benchmark are the only remaining pending jobs. No failures yet.
Assistant
Still just waiting on the last three CI entries. Local verification is already complete and pushed.
Assistant
Everything except benchmark has passed now, including lint and windows-e2e. Benchmark is still pending; I’ll give it one more poll so I can give you the cleanest status.
Assistant
Still waiting inside that final benchmark poll. No new edits or failures have appeared.
Assistant
Addressed PR feedback on #10888 and pushed two follow-up commits:
6a7f00102 hardens npm view JSON parsing: multi-result/empty arrays now fail with a clear error, and missing/non-object time falls back to created_at: None.
e39406f94 adds malformed-shape tests for missing/non-array versions, missing latest tag, empty arrays, and the new optional time behavior.
Validated locally with cargo fmt --check, git diff --check, cargo test backend::npm::tests -- --nocapture, mise run build, and the real target/debug/mise ls-remote npm:@director.run/cli | head -5 smoke test.
All PR checks are passing now, including lint, e2e, Windows, benchmark, CodeRabbit, and the security checks.