@vpdn/moneymoney-cli
Version:
Command-line interface for MoneyMoney app - list accounts and fetch transactions
116 lines (88 loc) • 2.56 kB
Markdown
# MoneyMoney CLI
A command-line interface tool for MoneyMoney app that allows you to:
- List all available accounts
- Fetch transactions for specific accounts
- Filter transactions by date range
- Export data in JSON or text format
## Prerequisites
- macOS (MoneyMoney is a macOS-only application)
- [MoneyMoney](https://moneymoney-app.com/) installed and running
- Node.js 14 or higher
- Terminal access to control MoneyMoney (grant in System Preferences > Security & Privacy > Privacy > Automation)
## Installation
### Via npm (recommended)
```bash
npm install -g @vpdn/moneymoney-cli
```
### From source
```bash
git clone https://github.com/vpdn/moneymoney-cli.git
cd moneymoney-cli
npm install
npm run build
npm install -g .
```
## Usage
### List All Accounts
```bash
# Text format (default)
moneymoney-cli accounts
# JSON format
moneymoney-cli accounts --format json
# Using global --json option
moneymoney-cli --json accounts
```
### Fetch Transactions
```bash
# All transactions from all accounts
moneymoney-cli transactions
# Transactions from specific accounts
moneymoney-cli transactions --accounts "1234567890,0987654321"
# Transactions with date range
moneymoney-cli transactions --from 2024-01-01 --to 2024-12-31
# Combine filters and output as JSON
moneymoney-cli transactions --accounts "1234567890" --from 2024-01-01 --format json
# Using global --json option
moneymoney-cli --json transactions --from 2024-01-01
```
### Command Options
#### Global Options
- `--json` - Output raw data as JSON (overrides any format options)
- `--version` - Show version number
- `--help` - Show help
#### `accounts` command
- `-f, --format <format>` - Output format: `json` or `text` (default: `text`)
#### `transactions` command
- `-a, --accounts <accounts>` - Comma-separated list of account numbers
- `-f, --from <date>` - Start date in YYYY-MM-DD format
- `-t, --to <date>` - End date in YYYY-MM-DD format
- `-o, --format <format>` - Output format: `json` or `text` (default: `text`)
## JSON Output Format
When using `--format json`, the output follows this structure:
### Accounts
```json
[
{
"accountNumber": "1234567890",
"name": "Checking Account",
"owner": "John Doe",
"bankCode": "12345678",
"currency": "EUR",
"balance": 1234.56,
"type": "Giro"
}
]
```
### Transactions
```json
[
{
"name": "Grocery Store",
"accountNumber": "1234567890",
"amount": -45.67,
"bookingDate": "2024-01-15T00:00:00.000Z",
"purpose": "Purchase at Store XYZ",
"category": "Groceries"
}
]
```