Commands
Every LexBuild command follows the {action}-{source} naming pattern. The action describes what to do (download, convert, enrich) and the source identifies the legal dataset.
Command Summary
| Command | Description |
|---|---|
download-usc | Download U.S. Code XML from the OLRC |
convert-usc | Convert U.S. Code XML to Markdown |
list-release-points | List available OLRC release points |
download-ecfr | Download eCFR XML from ecfr.gov or govinfo |
convert-ecfr | Convert eCFR XML to Markdown |
download-fr | Download Federal Register XML and JSON metadata |
convert-fr | Convert Federal Register XML to Markdown |
enrich-fr | Patch FR Markdown frontmatter with API metadata |
Running lexbuild download or lexbuild convert without a source suffix prints an error listing the available source-specific commands.
Common Workflow
Each source follows the same general pattern:
- Download the raw XML from the official source
- Convert the XML into structured Markdown files
- Enrich (FR govinfo bulk only) the converted files with additional API metadata
Title Specification
The --titles flag accepts flexible input for selecting which titles to process. This applies to USC and eCFR commands.
| Format | Example | Selects |
|---|---|---|
| Single number | --titles 1 | Title 1 |
| Comma-separated | --titles 1,5,11 | Titles 1, 5, and 11 |
| Range | --titles 1-5 | Titles 1 through 5 |
| Mixed | --titles 1-5,8,11 | Titles 1 through 5, plus 8 and 11 |
Use --all instead of --titles to process every available title.
Shared Options
These flags are available on all convert commands:
| Flag | Default | Description |
|---|---|---|
-o, --output <dir> | ./output | Output directory for converted Markdown |
-g, --granularity <level> | section | Output granularity (varies by source) |
--link-style <style> | plaintext | Cross-reference link style: plaintext, relative, or canonical |
--dry-run | off | Parse and report statistics without writing files |
-v, --verbose | off | Print detailed output including file paths |
--include-notes / --no-include-notes | on | Include or exclude all notes |
--include-editorial-notes | off | Include only editorial notes |
--include-statutory-notes | off | Include only statutory notes |
--include-amendments | off | Include only amendment history |
[!NOTE] Setting any selective note flag (
--include-editorial-notes,--include-statutory-notes,--include-amendments) automatically disables the broad--include-notesflag.
Full Pipeline Examples
U.S. Code
# Download all 54 titles
lexbuild download-usc --all
# Convert all titles to Markdown
lexbuild convert-usc --all
eCFR
# Download all 50 titles from the eCFR API
lexbuild download-ecfr --all
# Convert all titles to Markdown
lexbuild convert-ecfr --all
Federal Register
# Download the last 30 days of FR documents (XML + JSON from FR API)
lexbuild download-fr --recent 30
# Convert all downloaded documents (JSON sidecar used automatically for rich frontmatter)
lexbuild convert-fr --all
[!NOTE] The
enrich-frstep is only needed when using--source govinfo(bulk XML without JSON metadata). The defaultfr-apisource downloads both XML and JSON, so the converter produces rich frontmatter automatically.
Update Scripts
For routine updates, wrapper scripts handle the full pipeline (detect changes, download, convert, generate artifacts, deploy):
./scripts/update.sh # All sources
./scripts/update.sh --source ecfr # One source
./scripts/update-ecfr.sh --skip-deploy # eCFR, local only
./scripts/update-fr.sh --days 3 # FR, last 3 days
./scripts/update-usc.sh # USC, checks release point
Each script auto-detects what changed and only processes updates. See Incremental Updates for details.
Getting Help
Every command supports --help for a full description of its options and usage examples:
lexbuild convert-usc --help
lexbuild download-ecfr --help
For complete flag tables and option details, see the CLI Reference.