Commit aa4e658
committed
AI CLIs: fix resolver returning early on empty + add nodejs/npm/nano/npm_globals to [packages.ai]
Operator-flagged 2026-05-10:
╰─❯ gemini
-bash: gemini: command not found
╰─❯ claude
-bash: claude: command not found
╰─❯ nano mios.toml
-bash: nano: command not found
Two coupled bugs + a missing-pkg:
1. install-ai-clis.sh's _resolve_npm_globals() short-circuited on
empty awk output. The form `awk | grep | tr && return 0` always
returns 0 because tr (last cmd in pipe) exits 0 regardless of
input. Result: function exits without echoing the vendor
fallback, install loop sees EOF from while-read, no packages
ever get `npm install -g`'d.
Fix: capture pipe output into a var and `[ -n "$extracted" ]
&& echo "$extracted" && return 0`. Only return EARLY when output
actually exists; otherwise fall through to the vendor fallback
(claude-code + gemini-cli).
2. mios.git's /usr/share/mios/mios.toml [packages.ai] section was
missing the nodejs + npm packages + npm_globals list. (mios-bootstrap
had them but the runtime resolver reads mios.git's copy because /
IS mios.git's working tree.) Added:
pkgs: + nodejs + npm + nano
npm_globals: ["@anthropic-ai/claude-code", "@google/gemini-cli"]
3. nano: added to [packages.ai].pkgs since the dev VM ships
without a baseline text editor and operators need to edit
mios.toml from the terminal. Operator-flagged: "nano:
command not found".
Verified live 2026-05-10: after deploying the fixed script +
running it manually on the running dev VM, claude + gemini
binstubs landed at /usr/local/bin/{claude,gemini} as expected.1 parent 9154abf commit aa4e658
2 files changed
Lines changed: 26 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
40 | 45 | | |
41 | 46 | | |
42 | 47 | | |
43 | 48 | | |
44 | 49 | | |
45 | 50 | | |
46 | 51 | | |
47 | | - | |
48 | 52 | | |
49 | 53 | | |
50 | 54 | | |
| |||
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
58 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
59 | 67 | | |
60 | | - | |
| 68 | + | |
| 69 | + | |
61 | 70 | | |
62 | 71 | | |
63 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1380 | 1380 | | |
1381 | 1381 | | |
1382 | 1382 | | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
1383 | 1395 | | |
1384 | 1396 | | |
1385 | 1397 | | |
| |||
0 commit comments