Documentation
¶
Overview ¶
Command command-facts-sync writes the derived copies of the command facts (itd-2610301346085246, spc-2610301431075964 step 3): one JSON file per top-level verb under docs/reference/cli/commands/, and the two generated blocks of every command page under commands/, the ask-the-binary block straight after the page's H1 heading and the command-facts block at its end. Each is rendered from cli.CommandFacts, the one source of the facts, by the functions in internal/surface/cli/commandfacts.go, which the drift tests call too. The facts are changed in the command tree, never in a copy.
It mirrors asking-sync, run by hand via `make command-facts-sync`. Nothing in CI invokes it: the drift is gated by the tests in internal/surface/cli/commandfacts_drift_test.go, under precheck and preflight, which fail when a committed copy differs from the rendering.
It never creates a page: which verbs have one is the menu test's rule (TestCommandPagesMatchTheMenu). A visible verb with no page gets its JSON file alone. A JSON file left in the directory for a verb the tree no longer has is removed.
Exit codes: 0 nothing to do (or, with no -check, the copies were written); 1 a fault; 3 with -check, a copy is out of date and nothing was written.