CLI 1.33.0: mods from aitmpl.com, short names, --search, system-folder guard
Merged
DA
13d ago+882+882+012345678901234567890123456789-71-71-01234567890123456789
Requested by Daniel · project thread
What this PR does
Initiative 6 of the traction plan (CLI 1.33). Targets: mod-run failures 15.5% → <3%, total failures 2.4% → ≤1.5%.
- Mods from aitmpl.com (
cli-tool/src/component-content.js): one request towww.aitmpl.com/component-content/mods/{cat}/{name}.json, accepted only if its files equalmeta.files(same paths, same byte sizes, no extra files, safe paths). Otherwise it falls back to the GitHub contents API, which now names its rate limit in the error. All 50 current mod content files pass the check (covered by a test). Skills still come from GitHub, as the spec says. - System-folder guard (
target-guard.js): refuses%SystemRoot%(and anything under it) and drive roots (/on POSIX), writes nothing, exits 1 and says which folder to open. A user-scope--pluginis exempt because it writes nothing in the cwd. The refusal is tracked aserrorType: unsafe_directory, so it still counts as a failure ininstallation_outcomes. - Short names and "did you mean" (
catalog-lookup.js, Catalog API v1 with the catalog browser's cache): a name resolves only when exactly one component of that type has it (--agent frontend-developer→development-team/frontend-developer). Ambiguous or missing names are still attempted as typed, because the catalog can lagmain. When they fail, the summary printsDid you mean:commands or a--searchcommand, never the same failing Retry. If the catalog is unreachable, names stay as typed. --search "<words>": up to 5 results ranked by text match (never by downloads), each with a page (utm_medium=search) and an install command. It is tracked as thesearchcommand with the result count only, never the words.- After an install:
Page:lines (utm_source=cli&utm_medium=install) and, for 2 or more components, aStack:line with the combined command. The/s/stack page (initiative 9) does not exist yet, so the command is the fallback the spec allows. The output is the same plain lines in TTY and non-TTY. - Help examples no longer print
cct --agent. Thecctbinary itself is untouched until decision 16. The no-terminal help lists--pluginand--search. usage-tracking.ts:search,check-updatesandupdateadded toVALID_COMMANDS.- Version synced to 1.33.0 (not published), plus the CHANGELOG, the docs-site flags page with its regenerated snippet, and the README.
Release order: the dashboard deploy that accepts search must be live before npm publish, or the search events get rejected (best effort, so nothing breaks).
Type
- New component
- Change to an existing component
- CLI (
cli-tool/src,cli-tool/bin) - Website (
dashboard/) - Docs or other
How I tested it
npm test(root, now includescli-install-fixes.node-test.js: 14 tests), dashboardusage-tracking.test.tsand the jestinstall-ui/catalog-browsersuites: all green.check_docs.pyOK.- From the
npm packtarball (1.33.0) installed into a scratch project, withCCT_NO_TRACKING=true:--mod stack-viewer,games/cc-arcade --skill pdf --agent frontend-develper --yes: both mods came from aitmpl.com (6 and 34 files),stack-viewerandpdfresolved by short name, the typo printedDid you mean: … --agent development-team/frontend-developer, then the Page and Stack lines.--search "secret redactor",--directory /(refused, exit 1) and the no-TTY help.- With
CCT_CONTENT_URLpointing at a dead host, the GitHub fallback ran. The container's IP was rate-limited by GitHub, which reproduced the real-world failure with the new message. The skill install failed with a GitHub 403 for the same reason, which is unrelated to this PR.
- Not tested on real Windows. The guard is unit-tested with
path.win32.
Generated by Claude Code
Summary by cubic
CLI 1.33.0 ships install-reliability fixes: mods now download from aitmpl.com instead of the rate-limited GitHub contents API, short names resolve through the catalog, a new --search flag finds components, and the CLI refuses to install into system folders.
Notes
- CLI (
cli-tool/src,cli-tool/bin): mod downloads first trywww.aitmpl.com/component-content/mods/{cat}/{name}.json, accepted only when files matchmeta.files(paths and byte sizes); GitHub is the fallback and now names its rate limit. Skills still come from GitHub. - New
--search "<words>"prints up to 5 text matches with their page and install command; missing or ambiguous names printDid you mean:commands instead of repeating the failing install. A guard refusesC:\Windows(and below) and drive roots, writes nothing, and exits 1. --modand--searchadd no new.jsonsources, so the catalog (docs/components.json) needs no regeneration; only source modules (catalog-lookup.js,component-content.js,target-guard.js) and tests were added.- Website: the dashboard's
usage-tracking.tsaccepts the newsearchcommand (pluscheck-updates/updatereserved for 1.34); docs-site flags page, README, and CHANGELOG updated. - No new secrets; optional
CCT_CONTENT_URLenv var (https,/component-contentsuffix only) overrides the content host for testing. The dashboard deploy that acceptssearchmust be live beforenpm publishso search events are not rejected.