CLI guide
--json is a global option, so place it before the subcommand:
archledger --json read ... rather than archledger read --json.
init — Initialize a workspace
Creates archledger.toml, the state directory, section stubs, record-type
subdirectories, and storage.yaml in one step.
Fails if a config file already exists in the target workspace.
Synopsis
archledger init [OPTIONS]
Quick start
# Markdown project
archledger init --source-format markdown
# AsciiDoc project (default when --source-format is omitted)
archledger init --source-format asciidoc
What init creates
Running init produces:
archledger.toml— project configuration (see Configuration)<archledger-dir>/— state directory (default.archledger)<archledger-dir>/sections/— 12 arc42 section stubs (defaultal_0001throughal_0012)<archledger-dir>/records/— typed subdirectories:building_blocks,concepts,constraints,contexts,decisions,deployment,diagrams,glossary,quality_goals,quality_requirements,quality_scenarios,requirements,risks,runtime,stakeholders,strategy<archledger-dir>/archive/— for archived records<archledger-dir>/build/— default build output directory<archledger-dir>/storage.yaml— ledger counter state
Section files are numbered by configured [ids] format (default al_0001 through al_0012) matching the 12
major arc42 sections:
Introduction and Goals
Architecture Constraints
Context and Scope
Solution Strategy
Building Block View
Runtime View
Deployment View
Cross-cutting Concepts
Architecture Decisions
Quality Requirements
Risks and Technical Debt
Glossary
After init, add starter content with:
archledger seed arc42-minimal
Core options
--source-format FORMATCanonical source dialect:
markdownorasciidoc. Default:asciidoc. Determines file extensions, default build output name, and template rendering for all generated section stubs.--archledger-dir PATHState directory to create, relative to the config path unless absolute. Default:
.archledger. Use an absolute path to store state outside the project tree.--project-name TEXTStable project identity stored in
archledger.toml. Defaults to the workspace directory basename (slug-normalized).--project-uuid TEXTStable project UUID. Auto-generated when omitted. Must be a valid UUID format.
--id-prefix TEXTLedger ID prefix for generated section/record IDs (for example
alorta). Default:al.--id-width NMinimum digit width for generated ledger IDs. Default:
4.--id-segment-mode MODELedger ID segment mode:
noneortype. Default:none.
Build options
--build-default-format FORMATDefault build output format:
markdown,asciidoc,pdf, ordocx. When omitted, defaults to the source format.--build-default-output FILENAMEDefault build output filename. When omitted, defaults to
architecture.<ext>matching the source format.--build-default-output-dir DIRBuild output directory, relative to the config path. Default:
build.--build-include-draftInclude draft records in build output.
--build-include-supersededInclude superseded records in build output.
--build-strictEnable strict build mode.
--build-keep-intermediateKeep intermediate build files.
--build-converter TOOLBuild converter tool:
auto,pandoc, orasciidoctor. Default:auto.--build-pdf-engine ENGINEPDF engine for pandoc builds.
--build-reference-docx PATHReference docx template for pandoc builds.
Diagram options
--diagrams/--no-diagramsEnable diagram support. Default:
--no-diagrams.--diagram-renderer RENDERERDiagram renderer:
pass-through,mermaid-cli, orasciidoctor-diagram. Default:pass-through.--diagram-default-type TYPEDefault diagram type:
text,ascii,unicode,svgbob, ormermaid. Default:text.--diagram-output-dir DIRDiagram output directory. Default:
diagrams.--diagram-image-format FORMATDiagram image format:
svgorpng. Default:svg.--diagram-kroki-url URLKroki server URL (reserved for future renderers).
arc42 options
--arc42-title TEXTarc42 template title. Default:
Architecture Documentation.--arc42-language CODEarc42 template language. Default:
en.--arc42-template-version VERSIONarc42 template version. Default:
9.0-EN.--arc42-include-help/--no-arc42-include-helpInclude arc42 help sections in generated section stubs. Default:
--no-arc42-include-help.
Tracking options
--tracking/--no-trackingEnable source tracking. Default:
--tracking.--tracking-scanner SCANNERTracking scanner:
auto,git, orfilesystem. Default:auto.--tracking-state-file FILENAMETracking state filename. Default:
source-state.json.--tracking-max-file-bytes NMaximum file size in bytes for tracking. Default:
1000000.--tracking-include GLOBGlob pattern for tracking includes. Repeatable.
--tracking-exclude GLOBGlob pattern for tracking excludes. Repeatable.
Examples
Minimal Markdown project with build output at the project root:
archledger init --source-format markdown \
--build-default-output ARCHITECTURE.md \
--build-default-output-dir .
AsciiDoc project with diagram support, German arc42 template, and custom tracking excludes:
archledger init --source-format asciidoc \
--diagrams \
--diagram-default-type mermaid \
--arc42-title "Meine Systemarchitektur" \
--arc42-language de \
--tracking-exclude "vendor/**" \
--tracking-exclude "**/__pycache__/**"
External state directory:
archledger init --archledger-dir /shared/archledger-state
Segmented IDs for record-type-based naming:
archledger init --source-format markdown --id-segment-mode type
JSON output for automation:
archledger --json init --source-format markdown
Other commands
Inspect the current source state:
archledger --json paths
archledger --json status
archledger --json check
archledger --json doctor
archledger --json read --body --include-drafts
Track implementation drift:
archledger --json source snapshot --reason after-archledger-update
archledger --json source changed
Create records:
archledger new requirement "Render architecture document" --status proposed
archledger new adr "Treat source fragments as canonical" --status proposed
archledger new diagram "Runtime login flow" --section runtime_view --status proposed
Archive and repair:
archledger archive al_0022 --reason "obsolete after al_0041"
archledger doctor
archledger doctor --repair
Renumber IDs and references:
archledger renumber --prefix ta --width 3
archledger renumber --prefix ta --width 3 --apply
archledger renumber --id-segment-mode type
archledger renumber --id-segment-mode type --apply
archledger renumber --id-segment-mode none --apply
check is read-only. It validates numbering and integrity but does not mutate counters or source files.
Build output:
archledger build --format markdown
archledger build --format asciidoc
archledger build --format html --format markdown