command-facts-sync

command
v0.17.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL