Skip to content

Finance Commands

ReturnPro financial pipeline: uploads, audits, KPIs, monthly close, R1 volume.

Commands

optimal finance audit

Compare staged financials against confirmed income statements

FlagDescriptionDefaultRequired
--months <csv>Comma-separated YYYY-MM months to audit (default: all)
--tolerance <n>Dollar tolerance for match detection1.00
bash
optimal finance audit --months 2026-03
optimal finance audit --months 2026-01,2026-02,2026-03 --tolerance 0.01

optimal finance kpis

Export KPI totals by program/client from ReturnPro financial data

FlagDescriptionDefaultRequired
--months <csv>Comma-separated YYYY-MM months (default: 3 most recent)
--programs <csv>Comma-separated program name substrings to filter
--format <fmt>Output format: table or csvtable
bash
optimal finance kpis --months 2026-01,2026-02,2026-03
optimal finance kpis --months 2026-03 --programs "Program A,Program B" --format csv

optimal finance template

Generate a blank NetSuite XLSX upload template

FlagDescriptionDefaultRequired
--output <path>Output file pathnetsuite-template.xlsx
bash
optimal finance template --output ./netsuite-template-march.xlsx

optimal finance upload

Upload NetSuite CSV/XLSX to ReturnPro staging

FlagDescriptionDefaultRequired
--file <path>Path to NetSuite file (CSV, XLSX, or XLSM)yes
--user-id <uuid>Supabase user UUIDyes
bash
optimal finance upload --file ./netsuite-march.xlsm --user-id <uuid>

optimal finance upload-confirmed

Upload confirmed income statement CSV to ReturnPro

FlagDescriptionDefaultRequired
--file <path>Path to income statement CSVyes
--user-id <uuid>Supabase user UUIDyes
bash
optimal finance upload-confirmed --file ./income-stmt-march.csv --user-id oracle

optimal finance upload-r1

Upload R1 XLSX file to ReturnPro staging

FlagDescriptionDefaultRequired
--file <path>Path to R1 XLSX fileyes
--user-id <uuid>Supabase user UUIDyes
--month <YYYY-MM>Month in YYYY-MM formatyes
--volume-type <type>Volume type: checked_in, order_closed, ops_completechecked_in
bash
optimal finance upload-r1 --file ./check-in-march.xlsx --user-id <uuid> --month 2026-03 --volume-type checked_in
optimal finance upload-r1 --file ./orders-closed.xlsx --user-id <uuid> --month 2026-03 --volume-type order_closed
optimal finance upload-r1 --file ./ops-complete.xlsx --user-id <uuid> --month 2026-03 --volume-type ops_complete

optimal finance sync-dims

Sync dim tables from NetSuite XML export

FlagDescriptionDefaultRequired
--file <path>Path to NetSuite MasterProgramProgramResults .xls fileyes
--executeApply changes (default is dry-run)
bash
optimal finance sync-dims --file ./dim-accounts.csv
optimal finance sync-dims --file ./dim-accounts.csv --execute

optimal finance preflight

Pre-template validation for a month

FlagDescriptionDefaultRequired
--month <YYYY-MM>Target monthyes
--income-statement <path>MP-level income statement CSV for gap analysis
bash
optimal finance preflight --month 2026-03
optimal finance preflight --month 2026-03 --income-statement ./income-stmt.csv

optimal finance diagnose

Run diagnostic checks on staging data for specified months

FlagDescriptionDefaultRequired
--months <csv>Comma-separated YYYY-MM months (default: all)
bash
optimal finance diagnose --months 2026-03
optimal finance diagnose --months 2026-01,2026-02,2026-03

optimal finance anomalies

Detect rate anomalies via z-score analysis on ReturnPro data

FlagDescriptionDefaultRequired
--from <YYYY-MM>Start month
--to <YYYY-MM>End month
--threshold <n>Z-score threshold2.0
bash
optimal finance anomalies --from 2026-01 --to 2026-03
optimal finance anomalies --from 2026-01 --to 2026-03 --threshold 0.05

optimal finance budget

Run FY26 budget projections with adjustments on FY25 checked-in units

FlagDescriptionDefaultRequired
--adjustment-type <type>Adjustment type: percent or flatpercent
--adjustment-value <n>Adjustment value (e.g., 4 for 4%)0
--format <fmt>Output format: table or csvtable
--fiscal-year <fy>Base fiscal year for actuals2025
--user-id <uuid>Supabase user UUID to filter by
--file <path>JSON file of CheckedInUnitsSummary[] (skips Supabase)

optimal finance export-budget

Export FY26 budget projections as CSV

FlagDescriptionDefaultRequired
--adjustment-type <type>Adjustment type: percent or flatpercent
--adjustment-value <n>Adjustment value (e.g., 4 for 4%)0
--fiscal-year <fy>Base fiscal year for actuals2025
--user-id <uuid>Supabase user UUID to filter by
--file <path>JSON file of CheckedInUnitsSummary[] (skips Supabase)

optimal finance month-close

Interactive monthly close workflow

FlagDescriptionDefaultRequired
--month <YYYY-MM>Target month (e.g., 2026-02)yes
--from <step>Start from step number1
--skip <steps>Comma-separated step numbers to skip
--user-id <uuid>User ID for uploads00000000-0000-0000-0000-000000000000
bash
optimal finance month-close --month 2026-03
optimal finance month-close --month 2026-03 --from audit
optimal finance month-close --month 2026-03 --skip upload,template

optimal finance pipeline

Trigger ReturnPro audit/anomaly/dims pipeline via n8n

FlagDescriptionDefaultRequired
--month <YYYY-MM>Target month for context
--steps <csv>Specific steps: audit,anomaly_scan,dims_check,notify
--no-pollFire and forget without waiting for results
bash
optimal finance pipeline --month 2026-03
optimal finance pipeline --month 2026-03 --steps upload,audit --poll

Built by Carlos Lenis in Miami