Repository navigation
4/n astryx init foolproof: scope CLI invocation (no bare npx astryx footgun) - #4151
Merged
Merged
Conversation
josephfarina
requested review from
cixzhang,
ejhammond and
imdreamrunner
as code owners
July 22, 2026 00:40
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
npx astryx never hits the squatternpx astryx footgun)
This was referenced Jul 22, 2026
josephfarina
force-pushed
the
navi/vibe/cli-scoped-invocation
branch
from
July 22, 2026 01:18
5b609ac to
948bca7
Compare
josephfarina
changed the base branch from
navi/vibe/install-init-foolproof
to
main
July 22, 2026 01:18
josephfarina
enabled auto-merge (squash)
July 22, 2026 01:27
…uatter Bare `npx astryx` resolves to an unrelated package on the npm registry when the CLI isn't installed. Route every command the CLI prints through a single install-aware source of truth (getCliInvocation / formatCliCommand / getDlxPrefix / isCliOneOff in package-manager.mjs): - installed / global / dev runs -> `<pm> astryx <cmd>` (unchanged) - one-off runs (npx / pnpm dlx / yarn dlx / bunx cache) -> `<dlx> @astryxdesign/cli <cmd>` Applied to search, component, hook, docs, build, template, swizzle, discover, theme, init, upgrade, doctor, update-check, the manifest pointer, the postinstall banner, and the injected AGENTS.md/CLAUDE.md index. Structured `--json` fields keep the canonical bare `astryx <cmd>` form; only human output is rewritten. Docs use the scoped package for bootstrap and bare `astryx` for references (fails cleanly, never a look-alike fetch). Also fixes the stale `npx xds init` postinstall banner and the core <Theme> runtime warning. Stacked on #4147. Co-authored-by: Cursor <[email protected]>
josephfarina
force-pushed
the
navi/vibe/cli-scoped-invocation
branch
from
July 22, 2026 01:34
948bca7 to
cb5e651
Compare
github-actions
Bot
requested review from
cvkxx,
ernestt,
kentonquatman and
rubyycheung
July 22, 2026 01:34
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsCheckboxInput · View in Storybook
DropdownMenu · View in Storybook
Field · View in Storybook
NumberInput · View in Storybook
Selector · View in Storybook
SideNav · View in Storybook
Switch · View in Storybook
TextArea · View in Storybook
TextInput · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
josephfarina
added a commit
that referenced
this pull request
Jul 22, 2026
…4207) * feat(core): docs.mjs redirects to the Astryx CLI instead of printing docs core's bundled docs.mjs was a self-sufficient off-ramp: agents (and humans) got component docs from it and never reached the CLI or ran `astryx init` — which is what installs the full component guide + design rules + tokens into AGENTS.md/CLAUDE.md. It was also a shallower view than the CLI (e.g. Button: 82 lines here vs 269 via `astryx component Button` — no Import, no Variants, terser). Redirect docs.mjs to the CLI so everyone converges on the current, richer source and gets init: - any invocation now prints how to install + run the CLI, using the scoped `npx @astryxdesign/cli` form (never the bare `npx astryx` footgun — see #4151). - README "Component Docs" section updated to point at the CLI. Validated in the fresh-install harness (Opus 4.8 + Sonnet 5): agents converge on the CLI + init; docs.mjs is no longer a dead-end off-ramp. * test(core): update docs-script tests for CLI redirect behavior docs.mjs now redirects to the Astryx CLI instead of printing a component catalog / per-component docs, so assert the redirect banner + exit 0 regardless of args rather than the old catalog output. Co-authored-by: Cursor <[email protected]> --------- Co-authored-by: Cursor <[email protected]>
This branch was successfully deployed
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.
Problem
Bare
npx astryxresolves to an unrelated package on the npm registry (https://www.npmjs.com/package/astryx, an empty0.0.0squat) whenever our CLI isn't installed. Our docs, runtime hints, and the injectedAGENTS.md/CLAUDE.mdindex all told users (and agents) to runnpx astryx …, so a first-run / one-off invocation silently fetched a look-alike package. The postinstall banner also printed a stalenpx xds init.Fix
A single install-aware source of truth in
package-manager.mjs—getCliInvocation/formatCliCommand/getDlxPrefix/isCliOneOff:<pm> astryx <cmd>(e.g.pnpm exec astryx …) — unchangednpx/pnpm dlx/yarn dlx/bunxcache inprocess.argv[1]) →<dlx> @astryxdesign/cli <cmd>, which always resolves to usRouted through every runtime hint the CLI prints —
search,component,hook,docs,build,template,swizzle,discover,theme,init,upgrade,doctor,update-check, the manifest pointer, and the postinstall banner — plus the injected agent-docs index. Structured--jsonfields (searchcommand, upgradesuggestedCommand) keep the canonical bareastryx <cmd>form; only human output is rewritten.Docs: bootstrap commands use the scoped package (
npx @astryxdesign/cli …); reference commands use bareastryx <cmd>(fails cleanly if uninstalled — never a look-alike fetch). Also fixes the stalenpx xds initbanner and the core<Theme>runtime warning.Testing
isCliOneOff,getDlxPrefix,getCliInvocation,formatCliCommand) + updated agent-docs/init tests.npx astryx/bunx astryxorxdsleaks in one-off output.Stacked on #4147 (base retargets to
mainonce that merges).Made with Cursor