Repository navigation
S12: the command-line guide, a page per command, every example run - #42
Merged
Merged
Conversation
docs/guide/command-line is the command-line section of the Relix programming guide, laid out as the engine's manuals are: a README.md index of chapters, and index.json as the machine-readable index. Hand-written pages cover the command and where scripts come from, input binding (-i, formats, standard input, headings, unbounded inputs, -a), output formats, the catalog (discovery, the overlay, trust, relixrc), secrets and profiles, and pipelines with jq, awk, find and xargs. The command reference, commands/*.md, is generated by CommandPages from the picocli model --help and the man pages come from, followed by each command's hand-written examples in docs/command-examples. ./gradlew commandPages rewrites them; GuideStructureTest fails while they are stale, while the index misses a page, or while a link to a page or a heading, here or in the engine's manuals, is broken. GuideExamplesTest runs every shell block over a copy of the fixture under src/test/resources/docs-fixture, the ~/shop the pages describe, and compares standard output and the exit status. A plain relix command runs in the test's JVM; anything else runs through bash, with a relix shim that treats a stage's streams as a terminal when they are the example's own, as a reader's would be. The guard was probed by mutation: a changed row, a changed or unshown exit status, a dropped output block, a broken link or heading, an unlisted page, a stale command page, an unrun bash block, a change to the table renderer and a change to the harness itself each fail it. ./gradlew docsArchive builds relix-<version>-docs.zip, which the release workflow attaches to each GitHub Release for the site to render. Fixes #16
… own The site renders these chapters after the engine's programming guide's, so each says it is about the command line.
…dings On Linux the JVM decodes its arguments by the locale, so under LC_ALL=C `relix doc σ` looked up '??'. A reader's terminal is UTF-8. On Windows, text=auto checked the generated command pages out with CRLF endings, which then differed from the generator's output; they keep LF, as the .relix files the tests compare do.
picocli wraps the usage synopsis with the platform's line separator, so on Windows the generated pages held CRLF and never matched the checked-in ones.
This was referenced Oct 10, 2026
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.
Fixes #16. Part of #17.
What
The command-line section of the Relix programming guide, in
docs/guide/command-line, laid out the way the engine's manuals are: aREADME.mdindex of chapters and pages, plusindex.jsonas the machine-readable index.-i, its formats, standard input, headings, unbounded inputs,-aparameters); output formats; the catalog (discovery, the overlay, trust,relixrc); secrets and profiles; pipelines withjq,awk,findandxargs.commands/*.md), generated byCommandPagesfrom the same picocli model as--helpand the man pages. Each is followed by that command's hand-written examples fromdocs/command-examples/. Run./gradlew commandPagesto regenerate them. Subcommands such ascatalog trustare sections of their parent's page, each with its own anchor, andindex.jsonlists those anchors.relix-<version>-docs.zip(./gradlew docsArchive), which the release workflow now attaches to each GitHub Release.How it stays true
GuideExamplesTestruns all 116 examples over a fixture~/shop(src/test/resources/docs-fixture) and compares stdout and the exit status. An example exits 0 unless it ends; echo "exit $?", which prints the status for the page to show.relix …runs in the test JVM. Anything else runs throughbash, with arelixshim that treats a stage's streams as a terminal when they are the example's own (fds 8/9). A piped example therefore prints exactly what a reader would see.GuideStructureTestchecks four things:index.jsonmatch the model (stale →./gradlew commandPages);docs/command-examplesfile names a command;bashblock;The site renders this section in the programming guide at
guide/command-line/and links it fromllms.txt; that is a separate PR in DarkCollective/relix. Until releases attach the archive, the site pins a commit of this repository.Found along the way (not changed here)
${VAR}s of one declaration are missing, the engine's error names an arbitrary one, and which one changes between JVM runs. The secrets page's example has only one missing.catalog filesandcatalog lscut paths to 30 characters, so the pages use-o tsvfor them.