Finance Commands
ReturnPro financial pipeline: uploads, audits, KPIs, monthly close, R1 volume.
Commands
optimal finance audit
Compare staged financials against confirmed income statements
| Flag | Description | Default | Required |
|---|---|---|---|
--months <csv> | Comma-separated YYYY-MM months to audit (default: all) | ||
--tolerance <n> | Dollar tolerance for match detection | 1.00 |
optimal finance audit --months 2026-03
optimal finance audit --months 2026-01,2026-02,2026-03 --tolerance 0.01optimal finance kpis
Export KPI totals by program/client from ReturnPro financial data
| Flag | Description | Default | Required |
|---|---|---|---|
--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 csv | table |
optimal finance kpis --months 2026-01,2026-02,2026-03
optimal finance kpis --months 2026-03 --programs "Program A,Program B" --format csvoptimal finance template
Generate a blank NetSuite XLSX upload template
| Flag | Description | Default | Required |
|---|---|---|---|
--output <path> | Output file path | netsuite-template.xlsx |
optimal finance template --output ./netsuite-template-march.xlsxoptimal finance upload
Upload NetSuite CSV/XLSX to ReturnPro staging
| Flag | Description | Default | Required |
|---|---|---|---|
--file <path> | Path to NetSuite file (CSV, XLSX, or XLSM) | yes | |
--user-id <uuid> | Supabase user UUID | yes |
optimal finance upload --file ./netsuite-march.xlsm --user-id <uuid>optimal finance upload-confirmed
Upload confirmed income statement CSV to ReturnPro
| Flag | Description | Default | Required |
|---|---|---|---|
--file <path> | Path to income statement CSV | yes | |
--user-id <uuid> | Supabase user UUID | yes |
optimal finance upload-confirmed --file ./income-stmt-march.csv --user-id oracleoptimal finance upload-r1
Upload R1 XLSX file to ReturnPro staging
| Flag | Description | Default | Required |
|---|---|---|---|
--file <path> | Path to R1 XLSX file | yes | |
--user-id <uuid> | Supabase user UUID | yes | |
--month <YYYY-MM> | Month in YYYY-MM format | yes | |
--volume-type <type> | Volume type: checked_in, order_closed, ops_complete | checked_in |
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_completeoptimal finance sync-dims
Sync dim tables from NetSuite XML export
| Flag | Description | Default | Required |
|---|---|---|---|
--file <path> | Path to NetSuite MasterProgramProgramResults .xls file | yes | |
--execute | Apply changes (default is dry-run) |
optimal finance sync-dims --file ./dim-accounts.csv
optimal finance sync-dims --file ./dim-accounts.csv --executeoptimal finance preflight
Pre-template validation for a month
| Flag | Description | Default | Required |
|---|---|---|---|
--month <YYYY-MM> | Target month | yes | |
--income-statement <path> | MP-level income statement CSV for gap analysis |
optimal finance preflight --month 2026-03
optimal finance preflight --month 2026-03 --income-statement ./income-stmt.csvoptimal finance diagnose
Run diagnostic checks on staging data for specified months
| Flag | Description | Default | Required |
|---|---|---|---|
--months <csv> | Comma-separated YYYY-MM months (default: all) |
optimal finance diagnose --months 2026-03
optimal finance diagnose --months 2026-01,2026-02,2026-03optimal finance anomalies
Detect rate anomalies via z-score analysis on ReturnPro data
| Flag | Description | Default | Required |
|---|---|---|---|
--from <YYYY-MM> | Start month | ||
--to <YYYY-MM> | End month | ||
--threshold <n> | Z-score threshold | 2.0 |
optimal finance anomalies --from 2026-01 --to 2026-03
optimal finance anomalies --from 2026-01 --to 2026-03 --threshold 0.05optimal finance budget
Run FY26 budget projections with adjustments on FY25 checked-in units
| Flag | Description | Default | Required |
|---|---|---|---|
--adjustment-type <type> | Adjustment type: percent or flat | percent | |
--adjustment-value <n> | Adjustment value (e.g., 4 for 4%) | 0 | |
--format <fmt> | Output format: table or csv | table | |
--fiscal-year <fy> | Base fiscal year for actuals | 2025 | |
--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
| Flag | Description | Default | Required |
|---|---|---|---|
--adjustment-type <type> | Adjustment type: percent or flat | percent | |
--adjustment-value <n> | Adjustment value (e.g., 4 for 4%) | 0 | |
--fiscal-year <fy> | Base fiscal year for actuals | 2025 | |
--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
| Flag | Description | Default | Required |
|---|---|---|---|
--month <YYYY-MM> | Target month (e.g., 2026-02) | yes | |
--from <step> | Start from step number | 1 | |
--skip <steps> | Comma-separated step numbers to skip | ||
--user-id <uuid> | User ID for uploads | 00000000-0000-0000-0000-000000000000 |
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,templateoptimal finance pipeline
Trigger ReturnPro audit/anomaly/dims pipeline via n8n
| Flag | Description | Default | Required |
|---|---|---|---|
--month <YYYY-MM> | Target month for context | ||
--steps <csv> | Specific steps: audit,anomaly_scan,dims_check,notify | ||
--no-poll | Fire and forget without waiting for results |
optimal finance pipeline --month 2026-03
optimal finance pipeline --month 2026-03 --steps upload,audit --poll