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 fromio/→ legacyoutput/directoryload_state(): Loadsstate.jsonfrom resolved output directorydry_run(): Preview mode — runs all four extractors, shows row counts, target sections, table previews, and overflow anchors without writing anythingmain(): Argparse CLI entry point with--version,--firm, and--dry-runflags
CLI interface:
# 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-runPost-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):
| Extractor | Target Section | Data Source |
extract_funding_history | Funding & Terms | state.json research/deck data |
extract_team_credentials | Team | state.json team data |
extract_market_sizing | Market Context | state.json market data |
extract_traction_metrics | Traction & Milestones | state.json traction data |
Files Changed
| File | Change |
cli/generate_tables.py | NEW — 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