Repository navigation
fix(cli): component and template show their doc text's commands with the reader's runner - #12211
Closed
josephfarina wants to merge 1 commit into
Closed
josephfarina wants to merge 1 commit into
josephfarina wants to merge 1 commit into
Conversation
…the reader's runner
josephfarina
requested review from
cixzhang and
imdreamrunner
as code owners
November 17, 2026 01:59
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
AI review status for this pull request.
|
Contributor
Author
|
Closing in favor of #12212, which fixes the same bug in one place: |
4 tasks done
Contributor
Author
|
Closed in favor of #12212, which fixes the same thing by prefixing the already-rendered doc text, so an escaped command token stays as written. |
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.
User impact
astryx docsshows every command a doc names with the name the reader runs the CLI by:npx astryx …,pnpm exec astryx …, or the command a tool that runs the CLI declares.astryx componentandastryx templatedid not. They printed the commands in a component's or a template's own doc text as written, bare:In a project without a global install, or through a tool that runs the CLI for you, a bare
astryxmay not run, and the same output's own pointer lines (npx astryx component CheckboxInput --props prints them whole) already used the right name. A{@command}token in that text was not rendered at all.After this change, that text shows each command with the same name the rest of the output uses:
JSON output keeps the doc text as written, as
docs --jsondoes.Problem and solution fit
docspasses a doc's text throughprefixCliCommandswith the run's invocation when it prints it (clients/cli/commands/docs.mjs).componentandtemplateprint their docs' text without that step, andcomponentnever renders tokens.astryxcan fail or reach another version.Expected behavior and authority
spec:AST-081FR5: every command the CLI prints or writes for its caller to run starts with the command name the one picker chooses.spec:AST-047FR9: a link inside a doc's text reads as the command that opens its doc. It still does; in text, that command now starts with the picker's name.Smallest restoration
foundation/doc-compiler/links.mjs:showDocText(text, stem)renders a text's tokens, then starts each CLI command withstem(prefixCliCommands), the two stepsdocsapplies.clients/cli/commands/component.mjs: the full, compact, brief and props views print the doc's text through it, with the run's invocation.clients/cli/commands/template.mjs: the template descriptions it prints (the list and the skeleton header) go through it.Evidence
npx astryx component CheckboxInput --props: "Seeastryx docs icons" before, "Seenpx astryx docs icons" after. The--jsonoutput is the same before and after.host astryx),component CheckboxInput --propsshows "Seehost astryx docs icons" (fails before, passes after);showDocTextstarts a bare command and a token's command with the runner, leaves a code example and a non-command word alone, and changes nothing for the global command. The component doc-link test now reads its link as the door's command in text, and as written in JSON.Scope
Components: CLI (
componentandtemplatetext output)Testing
vitest run --project nodeoverclients/cli/commands/component*,clients/cli/commands/template*,foundation/doc-compiler,api/component,api/template,test/golden-reads.test.mjsandtest/global-local*: 109 files; 1,023 passed and 2 failed, then both passed on a rerun (the doc-link test, updated above, and one test that timed out under load).tsc --project tsconfig.strict.json, ESLint and Prettier on the changed files.