feat(environments): install the usage CLI so mise completions work - #106
Merged
Conversation
`mise completion fish` does not emit a completion script of its own. It
emits one generated by usage-cli, whose first act is to check for the
`usage` binary and bail:
if ! type -p usage &> /dev/null
echo "Error: usage CLI not found. This is required for
completions to work in mise." >&2
return 1
roles/fish/files/fish/config.fish regenerates that file into
~/.config/fish/completions/mise.fish on every interactive shell, so
without the binary the completion file exists, looks installed, and
refuses to do anything. Nothing reports the gap: `mise doctor` says "No
problems found", correctly, since from mise's own point of view nothing
is wrong. It is the generated script that needs the binary.
Cross-platform rather than Linux-only. No Brewfile declares usage, so
the Macs have the same dead completions, and apt has no usage package
either, which leaves mise as the route on both.
Declared in BOTH files/mise.toml and defaults/main.yml, which the latter
already warns about for lua and rust: an entry in mise.toml alone leaves
`mise ls --missing` reporting the tool on every run while the install
loop never reaches it, so the role could never converge to changed=0.
That convergence is what specs/dev-services Task 7 has to demonstrate,
so a one-file version of this change would have quietly blocked it.
Verified by installing 5.0.0 on this host rather than trusting the
registry entry resolves.
Claude-Session: https://claude.ai/code/session_01F8oKrXASMQSXMVjSvuJpn9
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.
Adds the
usageCLI (5.0.0) to the environments role, so mise's shellcompletions work.
Why
mise completion fishdoes not emit a completion script of its own. It emitsone generated by usage-cli, and that script's first act is to check for the
usagebinary and give up:roles/fish/files/fish/config.fish:158regenerates that file into~/.config/fish/completions/mise.fishon every interactive shell. So thecompletion file exists and looks installed, and does nothing.
The gap is invisible to the obvious check:
mise doctorreports "No problemsfound", and it is right to — from mise's point of view nothing is wrong. It is
the generated completion script, not mise, that needs the binary.
Cross-platform, not Linux-only
No Brewfile declares
usage, so the Macs have exactly the same deadcompletions. apt has no
usagepackage either. That leaves mise as the route onboth platforms, which is why this goes in
roles/environments/rather thanroles/linux/files/mise/linux.toml.Declared in two places, deliberately
usageis added to bothfiles/mise.tomlanddefaults/main.yml'senvironments_mise_tools.defaults/main.ymlalready carries a note about this, from whenluaandrustwere added tomise.tomlalone:A
mise.toml-only version of this change would leavemise ls --missingreporting
usageon every run while the install loop never reaches it, so therole could never reach
changed=0. That convergence is precisely whatspecs/dev-servicesTask 7 has to demonstrate, so the one-file version wouldhave quietly blocked it.
Verification
usage@5.0.0installed on this host rather than trusting that the registryentry (
aqua:jdx/usage) resolves. It does.yamllint,gitleaks,syntax-check,ansible-lintall pass.environments_mise_toolshas a matchingmise.tomlentry, so this change does not reintroduce the lua/rust skew itcites.
Activation note
~/.config/mise.tomlis a symlink into the primary checkout:So merging this and pulling in the primary checkout activates it directly. No
Ansible run is required for the config itself, and in particular no
mise run linux— which matters right now, because thepowertasks in thattag are currently able to deadlock the kernel on this host's Thunderbolt eGPU.
A fresh host still needs
mise run environmentsto install the binary.