1/n astryx init foolproof: remove TTY gating (init non-interactive)#4147
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
josephfarina
force-pushed
the
navi/vibe/install-init-foolproof
branch
from
July 21, 2026 21:39
15396b2 to
7d4744f
Compare
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
astryx init for AI agents (WIP)
josephfarina
marked this pull request as ready for review
July 21, 2026 23:34
Agents and CI run in non-TTY shells, where bare `astryx init` errored via requireInteractive() and never installed the agent cheat sheet (measured init-ran rate 0–29% across GPT/Opus/Sonnet in fresh-install vibe tests). Remove TTY/interactive gating from the CLI completely: - `init` installs the AGENTS.md/CLAUDE.md cheat sheet non-interactively (no prompts, never hangs or errors on a missing TTY); remove the dead interactive wizard, its @Clack prompts, and the isCancel helper - layout reads stdin only on explicit `-` (kills a non-TTY auto-read hang) - template/swizzle/build-theme: existing files require an explicit --overwrite; remove the now-unreachable @Clack confirm prompts and the orphaned detectThemeCollision/listThemes helpers - ensure-jscodeshift: fail fast with --install-deps instead of prompting - delete the interactive.mjs (requireInteractive/isTTY) module and the isNonInteractive() TTY probe in path-safety - index help: `init` is "Setup + AI agent docs", not "Interactive setup" interactive-guard.test asserts the new behavior: init exits 0, writes the ASTRYX:START cheat sheet, and never hangs headless. A guided `--interactive` mode can return later as an explicit opt-in.
josephfarina
force-pushed
the
navi/vibe/install-init-foolproof
branch
from
July 21, 2026 23:38
7d4744f to
bda49c6
Compare
TTY gating was removed, so `astryx init` is non-interactive and no longer scaffolds a theme/template via prompts. Update user-facing text that still implied otherwise: - init --all tip: "scaffolds a theme + starter template" -> "points you to the theme and page-building workflows" (--all runs the theme/template features, which now just print guidance) - getting-started doc: drop "init wizard / pick a starter template" wording; describe init as the non-interactive agent-docs installer - agent-docs JSDoc: "init wizard" -> "init command" Co-authored-by: Cursor <cursoragent@cursor.com>
josephfarina
requested review from
cixzhang,
ejhammond and
imdreamrunner
as code owners
July 22, 2026 00:16
josephfarina
force-pushed
the
navi/vibe/install-init-foolproof
branch
from
July 22, 2026 00:18
ac9055f to
3ced5d2
Compare
The CLI is fully non-interactive (all TTY prompts were already removed), so clack was only providing non-blocking output — `log.*`, `intro`, `outro`. Replace that with a tiny in-repo logger and drop the dependency: - add src/lib/term-log.mjs mirroring the clack API we used (all output to stdout, matching prior behavior; --json still uses the existing silent no-op log stubs so machine output stays clean) - repoint upgrade.mjs + codemods (ensure-jscodeshift, runner, run-codemod) from '@clack/prompts' to '../lib/term-log.mjs' - remove @clack/prompts from package.json and both lockfiles (pnpm-lock.yaml + the stale packages/cli/package-lock.json); prunes @clack/core and its orphaned transitives - scrub remaining "clack" mentions in comments/CONTRIBUTING No behavioral change. Full CLI suite green (1987/1987). Co-authored-by: Cursor <cursoragent@cursor.com>
josephfarina
force-pushed
the
navi/vibe/install-init-foolproof
branch
from
July 22, 2026 00:30
3ced5d2 to
9ad6257
Compare
josephfarina
added a commit
that referenced
this pull request
Jul 22, 2026
…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 <cursoragent@cursor.com>
josephfarina
added a commit
that referenced
this pull request
Jul 22, 2026
…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 <cursoragent@cursor.com>
josephfarina
added a commit
that referenced
this pull request
Jul 22, 2026
…uatter (#4151) 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 <cursoragent@cursor.com>
cixzhang
added a commit
that referenced
this pull request
Jul 22, 2026
Seven published-behavior PRs merged since v0.1.7 without a changeset, which would leave their contributors uncredited in the CHANGELOG. Add changesets so the v0.1.8 bump credits them: - core docs.mjs redirect to the CLI (#4207) - Table tree-data plugin: useTableTreeState / useTableTreeData (#3789) - Table tree expander aria-label localization (#4149) - foolproof init: postinstall nudges + non-interactive init (#4147, #4153, #4154, #4155)
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
People install
@astryxdesign/corebut agents rarely runastryx init, so the component cheat sheet never lands and agents guess APIs. On a real fresh install (2-turn: install astryx design + NextJS app → build a to-do app), init-ran is 0–29% across GPT-5.5 / Opus 4.8 / GPT-5.2 / Sonnet 4.This PR
Bare
astryx initerrored in the non-TTY shells agents run in (requireInteractive), so it never installed the cheat sheet. Nowinitinstalls theAGENTS.md/CLAUDE.mddocs non-interactively — no prompts, never hangs or errors on a missing TTY. Deletes theinteractive.mjsmodule;interactive-guardtests updated to assert the new behavior (7/7 pass).Impact
Measured via a fresh-install vibe test (headless agents, isolated
/tmp, real npm install; ground truth = the<!-- ASTRYX:START -->marker). Before/after init-ran numbers attached with the PR.Follow-up PRs (each its own data point)
@clack/promptswhere unuseddocs.mjsoff-ramp (route lookups throughnpx astryx component)astryx componentAGENTS.mdin the package +@seein.d.ts)Test plan