3x CLI and Format Reference

Commands, fields, content shapes, and automation behavior

The exact interface for authoring and generating 3x manuals. Return to the scheme guide for the underlying method.

Python 3.9+JSON SchemaNo packages required
The 3x reading contract: every entry explains what it does, how it works, and why it works that way.
No entries match that search.

CLI Commands

Run every command from the repository root with Python 3.9 or newer.

init

#
scaffoldwrite

Create a new manual source with the required structure and visible writing prompts.

python3 scripts/manual.py init OUTPUT [--name NAME] [--force]

What it does

Writes an editable JSON source containing project metadata, theme defaults, one section, and one entry. Its triad contains unfinished-writing prompts and therefore does not pass validation until adapted.

How it works

  1. OUTPUT selects the new JSON file.
  2. --name sets the project name and derives a starter entry ID.
  3. --force permits intentional replacement of an existing target.

Why it works this wayobserved

A complete structural example is faster and less error-prone than starting from an empty file. Deliberately failing prompts prevent the scaffold from being mistaken for finished documentation.

Evidence
  • scripts/manual.py scripts/manual.py
  • tests/test_manual.py tests/test_manual.py

check

#
validateCIevidence

Validate a source and optionally inspect its evidence targets.

python3 scripts/manual.py check SOURCE [--check-evidence] [--root PATH] [--check-urls] [--url-timeout N] [--json] [--set PATH=VALUE ...]

What it does

Reports structural errors and quality warnings, optionally verifies local evidence paths and HTTP targets, prints coverage counts, and exits nonzero when errors exist.

How it works

The command loads JSON, applies overrides, resolves placeholders, validates the complete model, and writes diagnostics to standard error. --check-evidence resolves local targets under --root, --check-urls performs bounded HTTP checks, and --json writes one machine-readable object to standard output.

Why it works this wayobserved

A read-only validation command fits editor hooks, pre-commit checks, and CI without creating generated-file churn. Evidence checks stay opt-in because they inspect the local environment and the network.

Evidence
  • scripts/manual.py scripts/manual.py
  • tests/test_manual.py tests/test_manual.py

build

#
renderHTMLCI

Validate and render a standalone HTML manual, or check it for drift.

python3 scripts/manual.py build SOURCE [--output FILE] [--check] [--set PATH=VALUE ...]

What it does

Creates the requested HTML file only when the prepared source has no validation errors. With --check, compares a fresh render with OUTPUT and never writes.

How it works

After validation, the renderer escapes source text, applies safe inline formatting, embeds presentation and search behavior, creates parent directories as needed, and writes one UTF-8 file. --check fails when OUTPUT is missing or differs from the fresh render.

Why it works this wayobserved

Validation-before-write prevents a failed build from presenting a newly generated incomplete artifact as current documentation. A drift check makes the committed artifact verifiable in CI without rewriting it.

Evidence
  • scripts/manual.py scripts/manual.py
  • tests/test_manual.py tests/test_manual.py

watch

#
previewdevelopment

Rebuild whenever the source file changes.

python3 scripts/manual.py watch SOURCE [--output FILE] [--set PATH=VALUE ...]

What it does

Monitors the source modification time, performs an initial build, and repeats the build after each saved change until interrupted.

How it works

A small polling loop checks the file twice per second. If the source temporarily disappears during an editor's atomic save, the command waits for it to return.

Why it works this wayobserved

Fast feedback makes structural writing and visual review feel like one task while retaining a zero-dependency implementation.

Evidence
  • scripts/manual.py scripts/manual.py

lint

#
validatestyleoptional

Check prose against the optional writing rules without changing the artifact.

python3 scripts/manual.py lint SOURCE [--json] [--set PATH=VALUE ...]

What it does

Validates the source, then scans prose fields for em dashes, invisible or bidirectional characters, validating openers, seesaw definitions, and blended emotional plateaus. Each finding carries a stable rule ID from L001 to L005. Exits nonzero when it finds an issue.

How it works

The command prepares and validates the source, walks manual titles, descriptions, badges, section descriptions, entry titles and summaries, dimension text, and evidence labels, and reports each finding with its rule ID and field location. Literal commands in synopsis, IDs, tags, and evidence targets are not scanned. --json writes a machine-readable object to standard output.

Why it works this wayobserved

The writing contract is useful but not universal. Stable rule IDs let teams discuss and gate specific rules without turning the linter into an editor.

Evidence
  • scripts/manual.py scripts/manual.py
  • tests/test_manual.py tests/test_manual.py

review

#
reviewprovenanceCI

Report entries that need human review without rewriting the source.

python3 scripts/manual.py review SOURCE [--check-evidence] [--root PATH] [--check-urls] [--url-timeout N] [--json] [--strict] [--set PATH=VALUE ...]

What it does

Validates the source, then reports unreviewed, stale-review, inferred-rationale, missing-evidence, and weak-evidence items. It does not edit the manual.

How it works

  1. Run review after check to list items for human attention.
  2. Use --strict to exit nonzero when any item exists, which makes the report usable as a CI gate.
  3. Use --json to emit the items and validation diagnostics for another tool; add --check-evidence or --check-urls to include target checks.

Why it works this wayobserved

Some quality concerns need a person to decide whether the missing context is acceptable. A separate report keeps that judgment explicit while making neglect visible to automation.

Evidence
  • scripts/manual.py scripts/manual.py
  • tests/test_manual.py tests/test_manual.py

Source Format

The JSON Schema is authoritative; these entries explain how its pieces are intended to be used.

Root and metadata fields

#
JSONmetadata

A manual combines project identity, document identity, review metadata, optional theme values, and sections.

What it does

Defines the top-level project, manual, theme, and sections values. An optional $schema field lets compatible editors locate the contract.

How it works

  1. project requires name and version and may contain other scalar placeholder values.
  2. manual requires title and may add subtitle, description, badges, footer, and reviewed.
  3. reviewed requires date and commit and may add by and interval_days.
  4. theme may set six-digit accent and accent_secondary colors plus a short icon.
  5. sections is a nonempty ordered array.

Why it works this wayrecorded

Separating project identity from document metadata supports multiple manuals for one project and keeps release values reusable. A review record ties the document to a specific commit and date.

Evidence
  • scheme/manual.schema.json scheme/manual.schema.json
  • scheme/example.manual.json scheme/example.manual.json

Section fields

#
navigationgrouping

Sections create ordered navigation groups around reader-oriented concepts.

What it does

Each section requires a stable id, a title, and at least one entry. It may include a short description.

How it works

IDs use lowercase kebab-case and share one namespace with entry IDs. Array order controls both sidebar and document order.

Why it works this wayrecorded

Stable identifiers make links durable while explicit order lets authors teach a subject progressively rather than accepting an alphabetical or filesystem-derived sequence.

Evidence
  • scheme/manual.schema.json scheme/manual.schema.json
  • scripts/manual.py scripts/manual.py

Entry fields

#
triadcontent

Entries hold one documented subject, its complete 3x explanation, and the basis for its rationale.

What it does

Requires id, title, what, how, why, and why_basis. Optional fields are summary, synopsis, tags, evidence, and related.

How it works

  1. Use summary for the one-sentence orientation shown before the triad.
  2. Use synopsis for a literal command, API, signature, or compact contract.
  3. Set why_basis to recorded, observed, inferred, or external.
  4. Use tags for filtering vocabulary and evidence for supporting targets.
  5. Use related to list stable entry IDs in reading order.

Why it works this wayrecorded

The required core guarantees a useful minimum and makes provenance reviewable. Optional context supports discovery and verification without making every subject pretend to be a command or source-code component.

Evidence
  • scheme/manual.schema.json scheme/manual.schema.json
  • scheme/example.manual.json scheme/example.manual.json

What, How, and Why shapes

#
content shapetriad

A dimension can be prose, ordered points, or a lead paragraph followed by points.

What it does

Accepts a nonempty string, a nonempty array of strings, or an object containing lead, points, or both.

How it works

Strings render as paragraphs. Arrays render as ordered lists. Objects render lead as a paragraph and points as an ordered list.

Why it works this wayrecorded

A small set of semantic shapes covers most technical explanations while remaining predictable for validation, transformation, and agent generation.

Evidence
  • scheme/manual.schema.json scheme/manual.schema.json
  • scripts/manual.py scripts/manual.py

Evidence and related fields

#
provenancelinks

Evidence records provenance and kind; related IDs create lateral navigation.

What it does

Evidence accepts either a target string or an object with label, target, and optional kind. Kinds are source, test, decision, spec, url, command, and document. Related accepts an array of entry IDs.

How it works

Local evidence targets render as code-like paths and HTTP targets render as links. --check-evidence verifies local targets under --root; --check-urls probes HTTP targets. Related IDs resolve to entry titles and local anchors; unknown IDs produce warnings.

Why it works this wayrecorded

Keeping provenance structured enables renderers and audits while allowing concise input for the common file-path case. Kind labels let reviewers distinguish a test from a decision record and let checks treat commands and URLs differently.

Evidence
  • scheme/manual.schema.json scheme/manual.schema.json
  • scripts/manual.py scripts/manual.py

Processing Rules

Preparation is deterministic: overrides, placeholders, validation, then rendering.

Overrides and placeholders

#
variablesrelease automation

Scalar configuration can flow from source metadata or the build command.

--set project.version=2.1.0 --set 'theme.accent=#ff6b35'

What it does

Overrides existing dotted paths and resolves double-braced dotted-path placeholders in all strings.

How it works

Values that parse as JSON scalars retain their types; other values remain strings. Paths must already exist, placeholders must resolve to scalars, and unknown paths stop processing.

Why it works this wayobserved

Existing-path enforcement catches spelling mistakes and prevents command-line options from silently inventing configuration the schema does not describe.

Evidence
  • scripts/manual.py scripts/manual.py
  • tests/test_manual.py tests/test_manual.py

Errors and warnings

#
diagnosticsquality

Errors reject the document; warnings flag concerns that still need contextual judgment.

What it does

Treats invalid JSON, missing required values including why_basis, unknown fields, malformed IDs, duplicate IDs, invalid content shapes, empty dimensions, invalid why_basis or evidence kind, invalid reviewed metadata, and recognized writing placeholders as errors. Missing evidence, unknown related IDs, missing review metadata, stale reviews, and recorded rationales that describe themselves as inferred are warnings.

How it works

Diagnostics include a JSON-like location so authors and agents can identify the affected section, entry, or field. The process exits with status one when errors exist. review --strict turns review items into a CI failure; --check-evidence and --check-urls add opt-in target warnings.

Why it works this wayrecorded

A deterministic validity boundary makes automation dependable, while warnings keep nonmechanical quality issues visible without blocking early discovery work. Review items remain a separate report because a stale link or an unconfirmed rationale may be an acceptable, documented choice.

Evidence
  • scripts/manual.py scripts/manual.py
  • tests/test_manual.py tests/test_manual.py

Optional writing rules

#
styleproseoptional

The lint command checks a small, explicit prose contract with stable rule IDs.

What it does

Flags L001 em dash, L002 invisible or bidirectional control character, L003 validating opener, L004 seesaw definition, and L005 blended emotional plateau in prose fields.

How it works

Each rule is a deterministic regular expression with a stable ID and field location. The command reports the matched text and exits one. It does not rewrite content. --json emits findings with the same IDs.

Why it works this wayrecorded

A short list of observable patterns is reviewable and teachable. Stable IDs let teams discuss and gate specific rules without treating the linter as an editor.

Evidence
  • scripts/manual.py scripts/manual.py
  • tests/test_manual.py tests/test_manual.py

Review report rules

#
reviewprovenancefreshness

Review items identify provenance and freshness concerns that need a person.

What it does

Reports unreviewed manuals, stale reviews, inferred rationale, missing evidence, and weak evidence. Weak-evidence checks run only when at least one evidence item has a kind.

How it works

  1. unreviewed: manual.reviewed is missing or not an object.
  2. stale-review: the review date is older than interval_days, which defaults to 180.
  3. inferred-rationale: an entry has why_basis: inferred.
  4. missing-evidence: an entry has no evidence.
  5. weak-evidence: at least one evidence item has a kind, but the evidence kinds do not include the support expected for the basis. recorded expects decision or spec; observed expects source, test, document, or spec; external expects url or spec.

Why it works this wayrecorded

Some quality concerns need a person to decide whether the missing context is acceptable. A named report keeps that judgment repeatable and lets CI fail on it when a project decides that every item must be resolved.

Evidence
  • scripts/manual.py scripts/manual.py
  • tests/test_manual.py tests/test_manual.py

Safe inline notation

#
securityformatting

A deliberately small formatting vocabulary improves readability without accepting raw HTML.

What it does

Supports backticks for code, double asterisks for strong text, single asterisks for emphasis, and Markdown-style links to HTTP, email, relative, or local-anchor targets.

How it works

The renderer escapes source text first, recognizes only the supported patterns, validates link schemes or relative paths, and leaves unsupported markup visible as text.

Why it works this wayrecorded

Restricting markup keeps generated manuals portable and reduces injection risk while preserving the inline conventions technical authors use most often.

Evidence
  • scripts/manual.py scripts/manual.py
  • tests/test_manual.py tests/test_manual.py

Generated output contract

#
artifactbrowser

HTML is a disposable artifact; JSON remains the source of truth.

What it does

Emits semantic headings, stable anchors, sidebar navigation, client-side search, responsive layouts, provenance badges, evidence kind labels, review metadata, related links, and print rules in one file.

How it works

CSS and a small search script are embedded. Content remains usable without a server or network connection, and narrow screens stack triad columns into a single reading flow. A reviewed manual shows its date and commit in the sidebar header.

Why it works this wayobserved

Treating HTML as generated prevents hand edits from diverging from machine-readable content and makes alternate renderers possible later.

Evidence
  • scripts/manual.py scripts/manual.py
  • index.html index.html
  • commands.html commands.html