Lossless Changelog
component

Table Generator CLI Tool

New standalone CLI for running the table generator agent outside the full pipeline. Scans memo sections and structured state data for tabular data opportunities, generates markdown tables, and inserts them into section files.

Changelog - 2026-03-17_02

Table Generator CLI Tool

New standalone CLI for running the table generator agent outside the full pipeline. Scans memo sections and structured state data for tabular data opportunities, generates markdown tables, and inserts them into section files.


Why

The table generator agent (src/agents/table_generator.py) was only accessible via a full pipeline run. When a memo is already generated and you want to add tables to sections that would benefit from structured data (funding history, team credentials, market sizing, traction metrics), re-running the entire pipeline is wasteful (~$10, ~15 minutes). This CLI enables targeted table insertion on existing output directories.


What Changed

New File: cli/generate_tables.py

~245 lines. Standalone CLI wrapping table_generator_agent.

Core functions:

  • resolve_output_dir(): Multi-strategy path resolution — accepts direct paths, company names, or company + firm + version combinations. Search order: direct path → firm-scoped (io/{firm}/deals/{company}/outputs/) → auto-detect firm from io/ → legacy output/ directory

  • load_state(): Loads state.json from resolved output directory

  • dry_run(): Preview mode — runs all four extractors, shows row counts, target sections, table previews, and overflow anchors without writing anything

  • main(): Argparse CLI entry point with --version, --firm, and --dry-run flags

CLI interface:

BASH
# Direct path
python -m cli.generate_tables io/humain/deals/Metabolic/outputs/Metabolic-v0.2.1

# By company name (auto-resolves latest version)
python -m cli.generate_tables "Metabolic"

# With firm and version
python -m cli.generate_tables "Metabolic" --firm humain --version v0.2.1

# Dry run preview
python -m cli.generate_tables "Metabolic" --dry-run

Post-insertion behavior:

After tables are inserted into 2-sections/*.md files, the CLI automatically reassembles the final draft via cli.assemble_draft so tables appear in the combined output. Falls back gracefully with a manual command suggestion if reassembly fails.

Four data extractors used (from src/agents/table_generator):

ExtractorTarget SectionData Source
extract_funding_historyFunding & Termsstate.json research/deck data
extract_team_credentialsTeamstate.json team data
extract_market_sizingMarket Contextstate.json market data
extract_traction_metricsTraction & Milestonesstate.json traction data

Files Changed

FileChange
cli/generate_tables.pyNEW — Standalone CLI for table generation on existing output directories

Performance

  • Time: ~5 seconds (no API calls — extracts from existing state.json)

  • Cost: Free (pure local extraction and markdown generation)

  • Dry run: Instant preview with row counts and table previews