Skip to content

install: wire a tool's pit aliases into installing it - #432

Merged
ralyodio merged 1 commit into
mainfrom
tool-aliases-install
Aug 19, 2026
Merged

install: wire a tool's pit aliases into installing it#432
ralyodio merged 1 commit into
mainfrom
tool-aliases-install

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Follow-up to #431, which landed the mechanism as its own verb. That was the wrong shape: a set of commands behind one dispatcher is not usable from the pit until the words that reach them exist, so wiring them up belongs to installing the tool — not to a second thing you have to remember afterwards.

What changes

mosh ▸ /install cli-tools          # or /tools install cli-tools
✓ cli-tools installed. 🤘
  ✓ /blog → blog-post
  ✓ /free → domainfree
  • /install <tool>, /tools install <tool> and moshcode install <tool> adopt whatever aliases the tool proposes.
  • /upgrade does the same. An upgrade is where a tool gains commands, so a roster adopted once at install time goes stale the first time it ships something new — which is exactly how cli-tools' own generate-names never reached anybody's prompt.
  • /tools install <name> now routes to the installer instead of answering unknown tool "install". It is the obvious spelling right after /tools has printed the roster.
  • /alias install <tool> | --all from install: wire a tool's pit aliases into installing it #431 stays, for tools installed before this existed.

Why it is safe to hang off an install

Quiet by construction. A tool that offers nothing — every engine, most tools — prints nothing and spawns nothing. A tool that cannot be asked stays silent rather than following a successful install with an error about a nicety. Names you bound yourself are still never overwritten, and the merge is capped and validated exactly as in #431.

Test fixes this surfaced

Both pre-existing in test/tools.test.mjs, both real:

  • Its fake shell is a spy, and a tool's own shebang can re-enter that same fake shell and overwrite the capture — so the assertion could read the wrong invocation. It now records the first.
  • Its runner never isolated $HOME. Now that a successful install may write ~/.moshcode/aliases.json, the suite could edit the aliases of whoever ran it.

Full suite green: 2324 tests, 0 fail.

🤖 Generated with Claude Code

Follow-up to the previous commit, which made this its own verb. Wrong
call: a set of commands behind one dispatcher is not usable from the pit
until the words that reach them exist, so wiring them up is part of
installing the tool, not a second thing to remember afterwards.

/install <tool>, /tools install <tool>, and `moshcode install <tool>` now
adopt whatever aliases the tool proposes, and /upgrade does the same —
an upgrade is where a tool gains commands, so a roster adopted once at
install time goes stale the first time it ships something new. That is
exactly how cli-tools' own generate-names never reached anybody.

Quiet by construction, which is what makes it safe to hang off an
install: a tool that offers nothing (every engine, most tools) prints
nothing, and one that cannot be asked is silent rather than following a
successful install with an error about a nicety. Names you bound
yourself are still never overwritten. /alias install <tool> stays, for
tools installed before this existed.

/tools install <name> now routes to the installer instead of answering
`unknown tool "install"` — it is the obvious spelling after /tools has
just printed the roster.

Two test fixes this surfaced, both real: test/tools.test.mjs used a fake
shell as a spy that a tool's own shebang could overwrite, and its runner
never isolated $HOME — so a successful install in the suite could write
the aliases of whoever ran it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

3 finding(s) in the 8 file(s) this pull request changes.

MEDIUM: 3

Severity Rule Location
MEDIUM sql-string-concatenation src/cli-schema.mjs:161
MEDIUM sql-string-concatenation src/cli-schema.mjs:463
MEDIUM sql-string-concatenation src/cli-schema.mjs:589
52 pre-existing finding(s) elsewhere in the repository — **HIGH/CRITICAL**: 5 | **MEDIUM**: 41 | **LOW**: 6

Not introduced by this pull request. The full set is in the Security tab.

Severity Rule Location
HIGH js-ssrf-outbound-request apps/pwa/public/sw.js:45
HIGH tls-verification-disabled apps/pwa/src/lib/moshpit-gateway.mjs:299
HIGH sh-remote-script-execution install.sh:79
HIGH sh-remote-script-execution install.sh:83
HIGH tls-verification-disabled src/dns.mjs:741
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:68
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:82
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:108
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:295
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:299
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:344
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:568
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:749
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:751
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:810
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:856
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:926
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1029
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1052
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1074

…and 32 more. Full results in the Security tab.

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio merged commit 44f4503 into main Aug 19, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant