scripts/pipelines/cash-flow-forecast.py
bash
cd /Users/samshouse/.openclaw/workspace
# Standard 13-week forecast
python3 scripts/pipelines/cash-flow-forecast.py --slug glowlabs
# 6-month history for better seasonality
python3 scripts/pipelines/cash-flow-forecast.py --slug sb-paulson --months 6
# Custom low-cash threshold (GlowLabs: high burn)
python3 scripts/pipelines/cash-flow-forecast.py --slug glowlabs \
--low-cash-threshold 50000 \
--critical-threshold 25000 \
--out ~/Desktop/reports
# Sandbox testing
python3 scripts/pipelines/cash-flow-forecast.py --slug glowlabs --sandbox
FlagDefaultDescription--slugrequiredQBO company slug--weeks13Forecast horizon (weeks)--months3Months of CF history to pull (1–6)--low-cash-threshold25000Warn when balance < X--critical-threshold10000Critical alert when balance < X--accountautoSpecific bank account name filter--out~/DesktopOutput directory--sandboxfalseUse QBO sandbox
ScenarioCollectionsExpensesBaseHistorical avgHistorical avgOptimistic+10%UnchangedPessimistic-15%+5%
Automatically classified from QBO CF rows:
Operating — Inflows
collections: Revenue, AR, Net Income, payment processor receiptsinterest: Interest incomeOperating — Outflows
payroll: Wages, salaries, officer comp, Deel (GlowLabs)rent: Rent, lease, occupancyvendors: AP, COGS, professional fees, software, subscriptionsinterest: Interest expense (SB Paulson: material line)taxes, insuranceInvesting
capex: Equipment, property, asset purchasesFinancing
debt: Loans, line of credit, notes payableequity: Owner distributions/contributionssafe: SAFE notes (GlowLabs)The script reads clients/{slug}/sop.md automatically and adjusts:
SOP SignalEffect"burn rate", "runway", "high cash burn"Burn Rate tab emphasized, 🔴 alert"interest expense"Interest tracked separately"POS collection", "collected at POS"No AR lag — flat weekly inflow distribution"accounts receivable"AR-based: note 30-45 day receipt lag"SAFE"SAFE financing category added"crypto", "wallet", "ETH"Crypto wallet note added"Deel"Deel inbound classified as expense reduction
Default week-of-month distribution (configurable in script CONFIG section):
WeekInflowsOutflowsRationaleWeek 1 (days 1–7)30%35%Collections/payroll land earlyWeek 2 (days 8–14)20%20%Mid-month quietWeek 3 (days 15–21)20%25%Mid-month payroll + rentWeek 4 (days 22–28)30%20%End-month collectionsWeek 5 (overflow)0%0%Rarely used
POS clients (e.g. SB Paulson): inflows flattened to equal weekly distribution.
starting_cash, first_week_balance, avg_monthly_burn, months_of_runwaystarting_cash against prior first_week_balance.cache/cash-flow-forecast/{slug}.jsonColorExcel FillCondition✅ OKWhiteBalance ≥ low threshold⚠ WarnYellowBalance < $25K (configurable)🔴 CriticalOrange/RedBalance < $10K (configurable)
--low-cash-threshold 50000 --critical-threshold 25000 recommended--months 6 for better seasonality (salon business is seasonal)text
pip install openpyxl
Node.js QBO client must be authenticated with a valid token.
CashFlowForecast_{slug}_{YYYY-MM-DD}.xlsx
Default output: ~/Desktop/
pl-quick-compare.py — P&L variance analysispl-deep-analysis.py — Controller-level with GL drill-downbank-reconciliation.py — Bank statement reconciliation