@ofi/ledger-cli
v1.0.1
Published
CLI tools to download OFi / Open Collective transactions and convert them to hledger journals
Readme
@ofi/ledger-cli
CLI tools to download OFi / Open Collective transactions and convert them to hledger journals for double-entry accounting.
Tools
| Command | Description |
| ------------------------------------------------------ | ------------------------------------------------------ |
| ofi-hledger | All-in-one: download, convert, and query journals |
| ofi-csv-download | Download transaction CSVs from the Open Collective API |
| ofi-hledger-convert | Convert CSVs to hledger journal files |
| ofi-balance-download | Download opening balances from the API |
| ofi-ledger-cli-init | Initialize an account directory |
Configuration: ofi-ledger.config.js | Rules: rules
Prerequisites
- Node.js 24+
- hledger (
brew install hledger) - (Optional) A
PERSONAL_TOKENfrom https://opencollective.com/applications for private data
npm install -g @ofi/ledger-cliQuick start
# Recent data only (recommended for first use)
ofi-hledger eslint --auto --from 2024-01-01 bs
# All history (downloads from oldest transaction)
ofi-hledger eslint --auto bsThis initializes the account directory, downloads transactions and opening balances, converts to a journal, then queries the balance sheet. Without --from, it downloads from the oldest transaction date (set by init in config).
Step by step
Each account lives in its own directory with an ofi-ledger.config.js:
eslint/
ofi-ledger.config.js
rules-eslint.js # optional custom rules
eslint-opening-balances.csv
2025/
2026/
eslint-transactions.journal1. Download transactions
ofi-csv-download eslint2. Convert to journal
ofi-hledger-convert eslint3. Query
ofi-hledger eslint bs # Balance sheet
ofi-hledger eslint is # Income statementBatch processing
ofi-hledger-convert ofico ofitech opensource raft phpfoundationDevelopment
npm run lint # ESLint
npm run lint:fix # ESLint auto-fix
npm run prettier:check
npm run prettier:write
npm run graphql:update # Fetch latest GraphQL schemaLicense
MIT
