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:
--project-rootselects the site root. Relative content, template, asset, output, and RAG paths are resolved from it.--configselects a config file. Without--project-root, its directory is the project root. An explicit--project-roottakes precedence.
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
- Description: Starts the interactive Bubbletea Terminal UI. This provides a menu-driven interface to build, serve, export RAG data, and view project stats. Every screen shows its valid keys in the footer; press
?orhfor the full legend,dfor diagnostics (withNext:action hints), andwto toggle Watch Mode. See the Terminal UI Guide for the complete keybinding table and diagnostics-to-CLI linkage. - Keybindings:
↑/k↓/jnavigate,Enter/Spaceselect,mtoggle menu,ddiagnostics drawer,wtoggle watch,?/hhelp,cclear diagnostics (in drawer),q/Escback/quit,Ctrl+Cforce quit. Menu selection hasfocus-visiblea11y highlight mirroringtemplates/layout.html.
init
Initializes a new La Famille workspace.
go run ./cmd/la-famille init
- Description: Creates a default
config.yamlfile in the current directory. This is the first step when setting up a new site. - Existing configuration: If
config.yamlis already there,initrefuses rather than replacing it, so a second run cannot discard yoursiteurl,output_diror theme. --force/-f: Replaces an existingconfig.yaml, keeping the current one asconfig.yaml.bak. This is also how aconfig.yamltoo broken to parse gets regenerated — the backup means the original is still there to read afterwards.
build
Generates the static site from your Markdown files.
go run ./cmd/la-famille build [flags]
- Description: Parses the Markdown files in the content directory, processes frontmatter, handles link resolution, sanitizes HTML, and writes the final output (HTML files,
graph.json,backlinks.json,meta.json) to the output directory. - Flags:
--content,-c(string): The path to the directory containing your Markdown source files. Defaults tocontent.--output,-o(string): The path to the directory where the generated HTML should be placed. Defaults topublic.--template,-t(string): The path to the default HTML layout template to use. Defaults totemplates/layout-octoburger.html, the flagship octoburger theme.--asset-dir(string): The directory containing static assets. Defaults toassets.--site-url/--siteurl(-s) (string): The public base URL of the site. Used for canonical links,og:url, and absolute URLs in the sitemap, feed, and Knowledge Graph page. Defaults to unset (root-relative URLs only).
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]
- Description: Launches a local web server (using Go’s
http.FileServer) pointing to the configured output directory (usuallypublic/). This allows you to instantly preview your generated site in your web browser. - Flags:
--port,-p(int): The port to run the server on. Overrides the value set inconfig.yaml. Defaults to8080if not set in config.--watch,-w(bool): Watch for file changes and auto-rebuild.
Example: go run ./cmd/la-famille serve -p 3000 -w
rag
Generates a Retrieval-Augmented Generation (RAG) archive.
go run ./cmd/la-famille rag
- Description: Scans the generated output and metadata to construct an optimized dataset designed for Large Language Models (LLMs). This exports files like
rag-system.md,rag-config.md, andrag-content.mdinto therag-archive/directory. See the RAG Export Guide for more details. - Flags:
--outputselects the archive directory,--project-rootselects the source project, and--content,--asset-dir, and--templateselect the source inputs. These flags allow CI to write directly topublic/rag-archivewithout changing the checkout.
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]
- Description: Tools for managing automation PRs. The
syncsubcommand inspects open bot-authored pull requests and applies an explicit merge policy. pr sync: Dry-run by default. RequiresGITHUB_TOKEN. Mutations require--apply. Merges require thelitterbox-approvedlabel (configurable via--required-label). Zero checks are not accepted by default. Conflicts are not closed by default (--close-conflicts). Local working-tree publishing is off by default (--publish-local-changes). When--baseis omitted, the repositorydefault_branchis resolved via the GitHub API. This repository’s nightly workflow targetsmasterexplicitly. Jules CI verifies but does not merge.- Flags (
pr sync):--base(string): Target base branch (empty → API default branch).--apply(bool): Perform mutations (default false / dry-run).--required-label(string): Label required to merge or close (defaultlitterbox-approved).--close-conflicts(bool): Authorize closing conflicting PRs that pass identity gates.--allow-no-checks(bool): Allow merge when no check runs are reported.--publish-local-changes(bool): Authorize staging all local changes and opening a PR.--bot-author(strings): Bot author allowlist (defaults include Jules bots).--head-prefix(strings): Optional head ref prefix restrictions.
- See Also: Pull Request Management Guide for the full policy contract.
new
Scaffolds a new Markdown content file with YAML frontmatter.
go run ./cmd/la-famille new <slug-or-filename> [flags]
- Description: Creates a new Markdown file in the configured content directory (
content/by default). Generates valid frontmatter with default or custom metadata, creating parent directories if needed. - Flags:
--title,-t(string): Title of the page. Defaults to title-cased filename if omitted.--tags(strings): Comma-separated list or multiple instances of tags.--categories(strings): Comma-separated list or multiple instances of categories.--layout(string): Layout template name for the page.--date(string): Publication date inYYYY-MM-DDformat. Defaults to today’s date.--force,-f(bool): Force overwrite an existing file.--content,-c(string): Override target content directory.
Example: go run ./cmd/la-famille new blog/my-first-post --title "My First Post" --tags "tech,go" --categories "news"