@craftpipe/cashflow-cli
v1.0.0
Published
CLI tool for financial operations — transactions, balances, invoices, forecasting, and more.
Downloads
89
Maintainers
Readme
Financial operations CLI — transactions, balances, invoices, forecasting, and more. Connect to Stripe, Exact Online, Moneybird, QuickBooks Online, and FreshBooks from your terminal.
Overview
cashflow-cli is a developer-first CLI tool for financial operations. Query transactions, check balances, generate P&L reports, forecast cash flow, and reconcile data across multiple providers — all from your terminal. Supports Stripe, Exact Online, Moneybird, and QuickBooks Online.
cashflow transactions --provider stripe --from 2024-01-01 --to 2024-12-31
cashflow pnl --providers stripe --period quarter
cashflow forecast --providers stripe --months 6Architecture
graph TB
CLI[cashflow CLI] --> FREE[Free Commands]
CLI --> PRO[Pro Commands]
FREE --> T[transactions]
FREE --> B[balances]
FREE --> I[invoices]
FREE --> R[revenue]
FREE --> E[expenses]
FREE --> H[health]
PRO --> PNL[pnl]
PRO --> FC[forecast]
PRO --> RC[reconcile]
PRO --> AN[anomalies]
PRO --> TX[tax]
PRO --> MC[multi-currency]
T & B & I & R & E & H --> AF[Adapter Factory]
PNL & FC & RC & AN & TX & MC --> AF
AF --> SA[StripeAdapter]
AF --> EA[ExactOnlineAdapter]
AF --> MA[MoneybirdAdapter]
AF --> QA[QuickBooksAdapter]
AF --> FA[FreshBooksAdapter]
PNL --> PnLAnalysis[analysis/pnl.ts]
FC --> CFAnalysis[analysis/cashflow.ts]
RC --> RecAnalysis[analysis/reconciliation.ts]
AN --> AnoAnalysis[analysis/anomaly.ts]
TX --> TaxAnalysis[analysis/tax.ts]
MC --> MCAnalysis[analysis/multi-currency.ts]Installation
npm install -g cashflow-cliSetup
Set environment variables for your providers:
# Stripe
export STRIPE_SECRET_KEY=sk_live_...
# Exact Online
export EXACT_CLIENT_ID=...
export EXACT_CLIENT_SECRET=...
export EXACT_REFRESH_TOKEN=...
export EXACT_DIVISION=12345
# Moneybird
export MONEYBIRD_TOKEN=...
export MONEYBIRD_ADMINISTRATION_ID=...
# QuickBooks Online
export QUICKBOOKS_ACCESS_TOKEN=...
export QUICKBOOKS_REALM_ID=...
export QUICKBOOKS_SANDBOX=true # optional, for sandbox environment
# FreshBooks
export FRESHBOOKS_ACCESS_TOKEN=...
export FRESHBOOKS_ACCOUNT_ID=...Free Commands
transactions
cashflow transactions --provider stripe [--from <date>] [--to <date>] [--limit <n>] [--json]balances
cashflow balances --provider stripe [--json]invoices
cashflow invoices --provider stripe [--status paid|pending|overdue] [--json]revenue
cashflow revenue --provider stripe --period day|week|month|quarter|year [--json]expenses
cashflow expenses --provider stripe [--categories infrastructure,marketing] [--json]health
cashflow health --providers stripe,exact-online [--json]Pro Commands
pnl
cashflow pnl --providers stripe --period month|quarter|year [--json]forecast
cashflow forecast --providers stripe --months 3|6|12 [--json]Forecast methodology: Weighted moving average over 3-month lookback window (weights 1:2:3). Three scenarios: conservative (-20% income), realistic (base), optimistic (+20% income).
reconcile
cashflow reconcile --source stripe --target exact-online [--from <date>] [--to <date>] [--json]Matching criteria: Exact amount + date within ±2 days + description similarity >=20%. Confidence score: 40% date proximity + 60% description similarity.
anomalies
cashflow anomalies --providers stripe [--sensitivity low|medium|high] [--json]Detection rules:
- Duplicate: same amount + similar description within 24 hours
- Large variance: transaction > N times category average (N: low=3.0, medium=2.0, high=1.5)
tax
cashflow tax --provider stripe --period quarter|year [--jurisdiction NL|DE|FR|GB|US|EU] [--json]multi-currency
cashflow multi-currency --providers stripe --base EUR|USD|GBP [--json]Output Modes
All commands support --json for machine-readable output:
cashflow balances --provider stripe --json | jq '.[] | .available'Development
npm install
npm run build
npm test
npm run test:coverageProviders
| Provider | Transactions | Balances | Invoices | Expenses | Subscriptions | |----------|:---:|:---:|:---:|:---:|:---:| | Stripe | yes | yes | yes | yes | yes | | Exact Online | yes | yes | yes | yes | - | | Moneybird | yes | - | yes | yes | - | | QuickBooks Online | yes | yes | yes | yes | - | | FreshBooks | yes | - | yes | yes | - |
License
MIT — see LICENSE.
