Skip to content

La Famille / Field notes

Command Line Interface Reference

La Famille is equipped with a robust command-line interface (CLI) powered by the cobra library. The CLI provides commands for initializing projects, generating the site, serving content locally, and exporting AI-ready datasets.

Global Execution

To execute the CLI, run the compiled binary or use go run targeting the package directory:

go run ./cmd/la-famille [command] [flags]

Tip: Running the CLI with the tui subcommand will launch the interactive Terminal UI (TUI).

The runtime-independent identity commands are available from any directory:

la-famille --version
la-famille --version --json

--json is valid with --version and returns stable version, commit, build_date, target, and go_version fields. Release builds set the first three fields with -X main.buildVersion=..., -X main.buildCommit=..., and -X main.buildDate=....

Global path flags are resolved before the config is loaded:

The precedence order is explicit flags, then config.yaml, then the current directory/defaults.


Commands

tui

Launches the semi-graphical user interface.

go run ./cmd/la-famille tui

init

Initializes a new La Famille workspace.

go run ./cmd/la-famille init

build

Generates the static site from your Markdown files.

go run ./cmd/la-famille build [flags]

Example: go run ./cmd/la-famille build -c my_docs -o dist -t templates/custom.html

After the build, a static Knowledge Graph Explorer page is also written to <output>/graph/index.html (default enabled). The explorer page is self-contained — opening it directly in a browser, or serving the public/ directory with any static file server, works without any runtime backend. To opt out, set graph_explorer: false in config.yaml.

init installs the embedded default layout, required partial, and runtime assets only when the corresponding site files are absent. Existing site files remain the explicit override. Run publish-check --output public before uploading an artifact to get a deterministic file manifest and validate local HTML references.

diff

Compares the semantic site manifests from two builds:

la-famille diff public-before public
la-famille diff public-before/site-manifest.json public/site-manifest.json --json
la-famille diff ref:v1.0.0 ref:HEAD
la-famille diff public-before public --gate --report-dir reports

Each input can be an output directory, a site-manifest.json file, or a Git revision. Git revisions read a committed <output_dir>/site-manifest.json, or build an isolated source archive with the current generator when generated files are not committed. The revision’s configuration selects its inputs; external paths and symlinks are rejected. No repository scripts run and the checkout is unchanged. Prefix a revision with ref: to force Git interpretation when it matches a local path. The default output is a readable summary; --json writes the structured change report. The command reports page and metadata changes, tag/category membership, internal link and graph-edge deltas, orphan transitions, newly broken or resolved links, published file hashes, and sitemap deltas. --report-dir saves diff.json and diff.txt. --gate exits nonzero only for regression classes (or incomplete snapshots). It writes the report before failing, including with --json.

Every build also publishes its own ledger against the previous successful build. See the Change Ledger guide for baseline behavior, gate policy, TUI controls, and advisory CI rollout.

serve

Starts a local HTTP server to preview your generated site.

go run ./cmd/la-famille serve [flags]

Example: go run ./cmd/la-famille serve -p 3000 -w

rag

Generates a Retrieval-Augmented Generation (RAG) archive.

go run ./cmd/la-famille rag

publish-check

Validates a generated static artifact and prints every relative file path:

la-famille --project-root /path/to/site publish-check --output public
la-famille --project-root /path/to/site publish-check --output public --json

The check rejects an accidentally published .la-famille-cache.json, verifies local href/src references, and requires the graph explorer’s payload and companion CSS/JS when graph/index.html is present.

pack

Builds, verifies, compares, applies, publishes, pulls, and watches content-only Corpus Packs from existing public artifacts and rag-content.md:

la-famille pack build --output corpus.tar
la-famille pack build --site-output public --rag-dir rag-archive --output corpus.tar
la-famille pack verify corpus.tar
la-famille pack diff before.tar after.tar --output delta.tar
la-famille pack diff before.tar after.tar --output delta-json.tar --json
la-famille pack apply before.tar delta.tar --output result.tar
la-famille pack verify result.tar
la-famille pack pull /path/to/feed --output subscriber-v1.tar
la-famille pack pull /path/to/feed --base subscriber-v1.tar --output subscriber-v2.tar
la-famille pack publish --previous /path/to/feed-v1 --retain 3 --output /path/to/feed-v2
la-famille pack pull https://publisher.example/corpus-packs/pack-feed.json \
  --allow-https --output subscriber.tar
la-famille pack watch https://publisher.example/corpus-packs/pack-feed.json \
  --allow-https --state subscriber --interval 30s --trace-http

The destination must not exist. Relative paths resolve from --project-root. Packaging does not refresh its inputs. Verify, diff, apply, pull, and watch need no usable site configuration and never extract or execute members. Apply binds to the exact base archive and publishes only a verified new pack. Deltas operate on whole members, including the entire rag-content.md, not individual pages. See Corpus Packs v1 for the explicit allowlist, USTAR/manifest format and bounds, and Local Diff and Apply for the delta schema, readable/JSON reports and canonical-builder byte-identity contract. See Publish, Pull, and Watch for pack-feed.json, strict path/size/count limits, verified cold copies, exact-base delta selection, explicit full-pack fallback when no delta matches, bounded publishing history, HTTPS network restrictions/timeouts, durable watch state and subscriber-only updates.

pr

Manages GitHub Pull Requests (Clear the Litterbox).

go run ./cmd/la-famille pr [command]

new

Scaffolds a new Markdown content file with YAML frontmatter.

go run ./cmd/la-famille new <slug-or-filename> [flags]

Example: go run ./cmd/la-famille new blog/my-first-post --title "My First Post" --tags "tech,go" --categories "news"