Complete command-line interface reference for RMAgent.
- Command Overview
- Global Options
- Person Command
- Biography Command
- Quality Command
- Ask Command
- Timeline Command
- Export Command
- Search Command
- Common Workflows
- Tips & Best Practices
RMAgent provides 7 main commands for interacting with your RootsMagic database:
# Using uv (default project workflow)
uv run rmagent [GLOBAL OPTIONS] COMMAND [COMMAND OPTIONS]
# Using a local Python interpreter (no uv)
python -m rmagent.cli.main [GLOBAL OPTIONS] COMMAND [COMMAND OPTIONS]| Command | Purpose | Requires LLM |
|---|---|---|
person |
Query person information | No |
bio |
Generate biography | Optional |
quality |
Run data quality checks | No |
ask |
Ask questions about the database | Yes |
timeline |
Generate interactive timeline | No |
export |
Export to Hugo blog format | Optional |
search |
Search database by name/place | No |
These options work with all commands:
uv run rmagent [OPTIONS] COMMAND [ARGS]
Options:
--database PATH Path to RootsMagic database (.rmtree)
Overrides RM_DATABASE_PATH in config/.env
--llm-provider TEXT LLM provider: anthropic, openai, or ollama
Overrides DEFAULT_LLM_PROVIDER in config/.env
--verbose Enable verbose logging
Shows detailed execution information
--help Show help message and exit
--version Show version and exit# Use alternative database
uv run rmagent --database data/other.rmtree person 1
# Use different LLM provider
uv run rmagent --llm-provider openai bio 1
# Enable verbose logging
uv run rmagent --verbose quality
# Show version
uv run rmagent --version
# Same commands without uv (activate .venv first)
python -m rmagent.cli.main --versionThe CLI ships with a completion helper that prints shell-specific completion scripts. Install it once per machine:
# Bash
python -m rmagent.cli.main completion bash > ~/.config/bash_completion/rmagent.bash
source ~/.config/bash_completion/rmagent.bash
# Zsh
python -m rmagent.cli.main completion zsh > "${ZDOTDIR:-$HOME}/.zfunc/_rmagent"
autoload -U compinit && compinit
# Fish
python -m rmagent.cli.main completion fish > ~/.config/fish/completions/rmagent.fish
# PowerShell
python -m rmagent.cli.main completion powershell | Out-String | Invoke-ExpressionOnce installed, press Tab to complete command names, options, and subcommands.
Query and display information about a person.
uv run rmagent person <PERSON_ID> [OPTIONS]| Option | Description | Default |
|---|---|---|
--events |
Show all events for the person | False |
--family |
Show immediate family (parents, spouses, children) | False |
--ancestors |
Show ancestor tree | False |
--generations N |
Number of ancestor generations to show | 3 |
--descendants |
Show descendant tree | False |
uv run rmagent person 1Output:
📋 Person: Michael Dorsey Iams (1968-)
PersonID: 1
Sex: Male
Living: Yes
Birth: 30 Apr 1968 in Palo Alto, California
uv run rmagent person 1 --eventsOutput:
📋 Person: Michael Dorsey Iams (1968-)
─────────────────────────────────────────
Events:
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Date ┃ Type ┃ Place ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━┩
│ 30 Apr 68 │ Birth │ Palo Alto, California │
│ 1988 │ Education │ Tucson, Arizona │
│ 29 May 17 │ DNA test │ │
│ 2008 │ Genealogist │ │
└───────────┴──────────────┴────────────────────────┘
uv run rmagent person 1 --familyOutput:
📋 Person: Michael Dorsey Iams (1968-)
─────────────────────────────────────────
Family:
┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Relation ┃ Name ┃ Birth-Death ┃
┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ Father │ Donald Richard Iams │ 1937-2017 │
│ Mother │ Gail Cynthia Shepherd │ 1943- │
│ Spouse │ Jennifer L. Cubbage │ 1971- │
│ Child │ Elena Dorsey Iams │ 2001- │
│ Child │ Natalie Grace Iams │ 2004- │
└──────────┴───────────────────────┴──────────────┘
uv run rmagent person 1 --ancestors --generations 3Shows direct ancestors for 3 generations (parents, grandparents, great-grandparents).
uv run rmagent person 1 --descendantsShows all descendants (children, grandchildren, etc.).
Generate biographical narratives about a person.
uv run rmagent bio <PERSON_ID> [OPTIONS]| Option | Description | Default |
|---|---|---|
--length |
Biography length: short, standard, comprehensive | standard |
--citation-style |
Citation style: footnote, parenthetical, narrative | footnote |
--output PATH |
Write to file instead of stdout | - |
--no-ai |
Use template-based generation (no LLM required) | False |
--no-sources |
Exclude sources section | False |
- short: 2-3 paragraphs, key facts only (~300 words)
- standard: 5-7 paragraphs, complete narrative (~800 words)
- comprehensive: 9+ sections, detailed analysis (~1500+ words)
- footnote:
John was born in 1850.[1] - parenthetical:
John was born in 1850 (Smith 2020, p. 45). - narrative:
According to Smith's research, John was born in 1850.
uv run rmagent bio 1Generates standard-length biography using AI.
uv run rmagent bio 1 --no-aiGenerates biography using templates only (no LLM API call required).
uv run rmagent bio 1 --length shortuv run rmagent bio 1 --length comprehensive --output bio_comprehensive.md# Footnote style (default)
uv run rmagent bio 1 --citation-style footnote
# Parenthetical style
uv run rmagent bio 1 --citation-style parenthetical
# Narrative style
uv run rmagent bio 1 --citation-style narrativeuv run rmagent bio 1 --output biographies/john_smith.mduv run rmagent bio 1 --no-sourcesRun data quality validation checks on your database.
uv run rmagent quality [OPTIONS]| Option | Description | Default |
|---|---|---|
--category |
Filter by category (see below) | all |
--severity |
Filter by severity: critical, high, medium, low | all |
--format |
Output format: markdown, html, csv | markdown |
--output PATH |
Write to file instead of stdout | - |
required- Required Field Combinations (5 rules)logical- Logical Consistency (6 rules)integrity- Referential Integrity (4 rules)sources- Source Documentation Quality (3 rules)dates- Date Validity (3 rules)values- Value Range Constraints (4 rules)
uv run rmagent qualityOutput:
📊 Data Quality Summary
┏━━━━━━━━━━━━━━━━━┳━━━━━━━━┓
┃ Metric ┃ Count ┃
┡━━━━━━━━━━━━━━━━━╇━━━━━━━━┩
│ Total People │ 11,571 │
│ Total Events │ 29,543 │
│ Total Sources │ 337 │
│ Total Citations │ 10,838 │
└─────────────────┴────────┘
┏━━━━━━━━━━━┳━━━━━━━━┓
┃ Severity ┃ Count ┃
┡━━━━━━━━━━━╇━━━━━━━━┩
│ 🔴 Critical │ 7 │
│ 🟠 High │ 32,665 │
│ 🟡 Medium │ 15,643 │
│ 🟢 Low │ 742 │
└───────────┴────────┘
⚠️ Total Issues: 49,057
# Show only critical issues
uv run rmagent quality --severity critical
# Show high priority issues
uv run rmagent quality --severity high# Check logical consistency only
uv run rmagent quality --category logical
# Check source documentation
uv run rmagent quality --category sources
# Check date validity
uv run rmagent quality --category dates# Markdown report
uv run rmagent quality --format markdown --output quality_report.md
# HTML report
uv run rmagent quality --format html --output quality_report.html
# CSV for spreadsheet analysis
uv run rmagent quality --format csv --output quality_issues.csv# Critical logical consistency issues
uv run rmagent quality --category logical --severity critical
# High severity source quality issues
uv run rmagent quality --category sources --severity high --output source_issues.mdInteractive Q&A about your database using AI.
uv run rmagent ask "<QUESTION>" [OPTIONS]| Option | Description | Default |
|---|---|---|
--interactive |
Enter conversation mode (multiple questions) | False |
- Requires LLM provider: This command always requires an LLM API key
- Conversation memory: The agent maintains context across questions in interactive mode
- Database queries: The AI can query your database to answer questions
uv run rmagent ask "Who were John Smith's parents?"Output:
⠋ Searching database...
John Smith's parents were:
👨 Father: William Smith (1820-1890)
- Born: 15 Mar 1820 in Maryland
- Died: 22 Nov 1890 in Pennsylvania
👩 Mother: Mary Jones (1825-1895)
- Born: 3 Jul 1825 in Virginia
- Died: 10 Jan 1895 in Pennsylvania
Source: FamilyTable (FamilyID: 145), PersonTable
# Ask about family relationships
uv run rmagent ask "How many children did William Smith have?"
# Ask about locations
uv run rmagent ask "Which families lived in Baltimore, Maryland?"
# Ask about time periods
uv run rmagent ask "Show me all births between 1850 and 1860"
# Ask about sources
uv run rmagent ask "What census records do we have for the Smith family?"uv run rmagent ask --interactiveOutput:
🤖 RMAgent Interactive Q&A
Type 'quit' or 'exit' to end the session.
You: Who were John Smith's parents?
Assistant: John Smith's parents were William Smith (1820-1890)...
You: When did William die?
Assistant: William Smith died on 22 Nov 1890 in Pennsylvania...
You: exit
Goodbye!
Generate interactive timelines in TimelineJS3 format.
uv run rmagent timeline <PERSON_ID> [OPTIONS]| Option | Description | Default |
|---|---|---|
--format |
Output format: json, html | json |
--output PATH |
Write to file instead of stdout | - |
--group-by-phase |
Group events by life phases | False |
--include-family |
Include spouse/children events | False |
- json: TimelineJS3 JSON format (for embedding in websites)
- html: Standalone HTML viewer (open in browser)
- Early Life (0-17 years)
- Education (college years)
- Early Career (20s-30s)
- Family Formation (marriage, children)
- Mid Career (40s-50s)
- Later Life (60s+)
- Death & Legacy
uv run rmagent timeline 1 --output timeline.jsonCreates timeline.json that can be embedded using TimelineJS3 library.
uv run rmagent timeline 1 --format html --output timeline.htmlCreates standalone HTML file. Open timeline.html in any web browser for interactive viewing.
uv run rmagent timeline 1 --group-by-phase --output timeline.jsonEvents are color-coded and grouped by life phases.
uv run rmagent timeline 1 --include-family --output timeline.htmlIncludes events for spouse and children alongside the person's events.
uv run rmagent timeline 1 \
--format html \
--group-by-phase \
--include-family \
--output john_smith_timeline.htmlExport biographies to Hugo blog format.
uv run rmagent export hugo <PERSON_ID> [OPTIONS]| Option | Description | Default |
|---|---|---|
--output-dir PATH |
Output directory | exports |
--bio-length |
Biography length: short, standard, comprehensive | standard |
--include-timeline |
Include timeline files | True |
--media-base-path |
Base path for media URLs | /media/ |
--batch-ids |
Comma-separated list of PersonIDs | - |
--all |
Export all persons (use with caution!) | False |
For each person, creates:
{person-name}.md- Hugo blog post with YAML front matterstatic/timelines/{person-name}.json- Timeline JSON (if --include-timeline)static/timelines/{person-name}.html- Timeline HTML (if --include-timeline)
uv run rmagent export hugo 1 --output-dir content/peopleCreates content/people/john-smith.md
uv run rmagent export hugo 1 \
--output-dir content/people \
--bio-length comprehensiveuv run rmagent export hugo \
--batch-ids 1,2,3,4,5 \
--output-dir content/peopleCreates 5 blog posts and generates an index page.
# WARNING: This may take a long time for large databases!
uv run rmagent export hugo --all --output-dir content/peopleuv run rmagent export hugo 1 \
--output-dir content/people \
--include-timeline=falseuv run rmagent export hugo 1 \
--output-dir content/people \
--media-base-path /static/genealogy-photos/The exported files are ready for Hugo static site generator:
- Place exported
.mdfiles incontent/people/ - Place timeline files in
static/timelines/ - Run
hugo serverto preview - Run
hugoto build the site
Search your database by name or place.
uv run rmagent search [OPTIONS]| Option | Description | Default |
|---|---|---|
--name TEXT |
Search by name (surname or full name) | - |
--place TEXT |
Search by place name | - |
--limit N |
Maximum results to return | 10000 |
--exact |
Disable phonetic matching | False |
--married-name |
Include married surnames for women | False |
- Name Search: Searches primary and alternate names with phonetic (Metaphone) matching
- Surname Variations: Use bracket syntax
[variant]or[ALL]for multiple variations - Married Names: Use
--married-nameto find women by spouse surnames - Place Search: Searches all place names with LIKE pattern matching
- Exact Match: Uses exact string matching (no phonetics)
Use bracket syntax to search multiple surname spellings:
- Single variation:
"John Iiams [Ijams]"→ searches "John Iiams" and "John Ijams" - Multiple variations:
"John Iams [Ijams] [Imes]"→ searches "John Iams", "John Ijams", "John Imes" - [ALL] keyword:
"John [ALL]"→ searches all configured variants
Configure variants in config/.env:
SURNAME_VARIANTS_ALL=Iams,Iames,Iiams,Iiames,Ijams,Ijames,Imes,Eimesuv run rmagent search --name "Smith"Output:
🔍 Found 247 person(s) matching 'Smith':
────────────────────────────────────────────────────────────
┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ ID ┃ Name ┃ Birth ┃ Death ┃
┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ 145 │ John Smith │ 1825 │ 1890 │
│ 146 │ William Smith │ 1850 │ 1920 │
│ 147 │ Mary Smith │ 1855 │ 1932 │
│ ... │ ... │ ... │ ... │
└──────────┴────────────────────┴────────────┴────────────┘
uv run rmagent search --name "John Smith"Searches for people with given name "John" and surname "Smith".
# Search two surname spellings
uv run rmagent search --name "John Iiams [Ijams]"Output:
Searching 2 name variations...
🔍 Found 82 person(s) matching 'John Iiams [Ijams]':
────────────────────────────────────────────────────────────
┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ ID ┃ Name ┃ Birth ┃ Death ┃
┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ 85 │ John Iiams │ 1816 │ 1878 │
│ 106 │ John Iiams │ 1782 │ 1827 │
│ 501 │ John Iiams │ 1747 │ 1785 │
│ 3916 │ John Ijams │ 1825 │ 1890 │
│ ... │ ... │ ... │ ... │
└──────────┴────────────────────┴────────────┴────────────┘
# Search multiple variations
uv run rmagent search --name "John Iams [Ijams] [Imes]"Searches for "John Iams", "John Ijams", and "John Imes".
# Search ALL configured variants
uv run rmagent search --name "John [ALL]"Searches for all 8 configured surname variants (Iams, Iames, Iiams, Iiames, Ijams, Ijames, Imes, Eimes).
uv run rmagent search --place "Maryland"Finds all people with events in Maryland.
uv run rmagent search --name "Smith" --limit 10Returns only the first 10 matches.
uv run rmagent search --name "Smith" --exactUses exact string matching instead of phonetic (Metaphone) matching.
# Find Smiths in Maryland (first 20 results)
uv run rmagent search --name "Smith" --place "Maryland" --limit 20# 1. Find the person
uv run rmagent search --name "John Smith"
# 2. View detailed information (use PersonID from search)
uv run rmagent person 145 --events --family
# 3. Generate biography
uv run rmagent bio 145 --length comprehensive --output john_smith_bio.md
# 4. Create timeline
uv run rmagent timeline 145 --format html --group-by-phase --output john_smith_timeline.html
# 5. Export to Hugo
uv run rmagent export hugo 145 --output-dir content/people# 1. Run complete quality check
uv run rmagent quality --output quality_full.md
# 2. Review critical issues
uv run rmagent quality --severity critical --output quality_critical.md
# 3. Check logical consistency
uv run rmagent quality --category logical --severity high
# 4. Generate CSV for spreadsheet analysis
uv run rmagent quality --format csv --output quality_issues.csv# 1. Search for family surname
uv run rmagent search --name "Smith"
# 2. Export multiple biographies
uv run rmagent export hugo --batch-ids 145,146,147,148,149 --output-dir content/people
# 3. Verify exports
ls -l content/people/
ls -l static/timelines/# Start interactive Q&A
uv run rmagent ask --interactive
# Example questions:
# > Who were the children of John Smith?
# > When did they get married?
# > Where did the Smith family live in 1880?
# > What census records do we have?
# > exit-
Use --no-ai for testing: Test biography generation without LLM calls:
uv run rmagent bio 1 --no-ai
-
Limit search results: Use --limit to avoid overwhelming output:
uv run rmagent search --name "Smith" --limit 10 -
Save output to files: Redirect long output to files:
uv run rmagent quality > quality_report.txt
- Use template-based biographies: Save API costs with --no-ai
- Use Ollama for testing: Free local LLM for development
- Cache LLM responses: RMAgent logs all LLM calls to
logs/llm_debug.jsonl
- Run quality checks regularly: Identify issues early
- Fix critical issues first: Focus on
--severity criticalfirst - Export to CSV: Easier to review in spreadsheet software
-
Use comprehensive length for featured people:
uv run rmagent bio 1 --length comprehensive
-
Choose appropriate citation style:
- Academic:
--citation-style footnote - Narrative:
--citation-style narrative
- Academic:
-
Review AI-generated content: Always verify facts and sources
-
Create shell scripts for common tasks:
#!/bin/bash # generate_family_biographies.sh for id in 145 146 147 148 149; do uv run rmagent bio $id --output bio_$id.md done
-
Use configuration file: Set defaults in
config/.envto avoid repetitive flags -
Combine commands with pipes:
uv run rmagent quality --format csv | grep "Critical"
- Configuration Guide: See
CONFIGURATION.mdfor advanced settings - Examples: See
EXAMPLES.mdfor real-world usage scenarios - FAQ: See
FAQ.mdfor troubleshooting - API Reference: See
API.mdfor programmatic usage
Happy researching! If you have questions, check FAQ.md or open an issue on GitHub.