fix(install): resolve tools by the name people actually say - #528
Merged
Merged
Conversation
`/install profullstack` answered `unknown engine or tool "profullstack"`. The set is published under the Profullstack name and installs from github.com/profullstack/cli-tools, so that is the first thing anyone types -- but the registry key is `cli-tools`, and it is the one key whose name mentions neither the brand nor a binary it provides. Engines have had ENGINE_ALIASES for exactly this since `/agents cc`. Tools never got the equivalent, so resolveTool was exact-match only. This adds TOOL_ALIASES in the same shape and teaches resolveTool to consult it, which fixes every surface at once -- the pit's /install and /uninstall and the CLI's `moshcode install` all already route through resolveInstallable. Aliased: profullstack (+ the binaries the set symlinks, since someone who has only ever run blog-post has no reason to know the dispatcher installs it), bufferoverride -> bo, compute -> c0mpute, and the handful of other spellings that differ from their key. A test asserts every alias points at a real tool and shadows no existing key, and own-property lookup is kept so `__proto__` still resolves to nothing. Also: the pit's unknown-target line was a dead end. `moshcode install <x>` prints the full engine and tool roster on a miss, but the pit printed one line and stopped. It now suggests the nearest names, or points at /engines and /tools when nothing is close. suggestTargets stays quiet for an unrelated word rather than offering a confusing near miss. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ThreatCrush Security Scan0 finding(s) in the 3 file(s) this pull request changes. Nothing in the files this pull request changes. 101 pre-existing finding(s) elsewhere in the repository — **HIGH/CRITICAL**: 8 | **MEDIUM**: 82 | **LOW**: 11Not introduced by this pull request. The full set is in the Security tab.
…and 81 more. Full results in the Security tab. Snippets are redacted; ThreatCrush never prints matched credential material. |
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.
/install profullstackanswered:The set is published under the Profullstack name and installs from
github.com/profullstack/cli-tools, so that is the first thing anyone types —but the registry key is
cli-tools, and it is the one key whose name mentionsneither the brand nor any binary it provides.
The fix
Engines have had
ENGINE_ALIASESfor exactly this since/agents cc. Toolsnever got the equivalent, so
resolveToolwas exact-match only. This addsTOOL_ALIASESin the same shape and teachesresolveToolto consult it —which fixes every surface at once, because the pit's
/installand/uninstalland the CLI'smoshcode installall already route throughresolveInstallable.profullstack,profullstack/cli-tools,clitools,toolscli-toolsblog-post,domainfree,gh-prscli-toolsbufferoverride,buffer-overridebocomputec0mputeeleven,im,do, …The symlinked binaries are in there because someone who has only ever run
blog-posthas no reason to know a dispatcher is what installs it.The pit's error was also a dead end
moshcode install <x>prints the full engine and tool roster on a miss. Thepit printed one line and stopped. It now points somewhere:
suggestTargetsstays quiet for an unrelated word rather than offering aconfusing near miss, and falls back to "try
/enginesor/tools".Tests
Six new cases in
test/tools.test.mjs, including one that walks every aliasand asserts it points at a real tool and shadows no existing key — so a future
rename cannot leave a dangling alias behind. Own-property lookup is kept, so
__proto__andconstructorstill resolve to nothing.node --test "test/*.test.mjs"→ 2511 pass, 0 fail, 4 skipped. (Theapps/pwasuites fail on this machine for the usual missing@libsql/client— unrelated to these files.)
🤖 Generated with Claude Code