@actual-app/cli 26.4.0-nightly.20260319

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +155 -0
  2. package/dist/cli.js +159882 -0
  3. package/dist/stats.json +3968 -0
  4. package/package.json +35 -0
package/README.md ADDED
@@ -0,0 +1,155 @@
1
+ # @actual-app/cli
2
+
3
+ > **WARNING:** This CLI is experimental.
4
+
5
+ Command-line interface for [Actual Budget](https://actualbudget.org). Query and modify your budget data from the terminal — accounts, transactions, categories, payees, rules, schedules, and more.
6
+
7
+ > **Note:** This CLI connects to a running [Actual sync server](https://actualbudget.org/docs/install/). It does not operate on local budget files directly.
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ npm install -g @actual-app/cli
13
+ ```
14
+
15
+ Requires Node.js >= 22.
16
+
17
+ ## Quick Start
18
+
19
+ ```bash
20
+ # Set connection details
21
+ export ACTUAL_SERVER_URL=http://localhost:5006
22
+ export ACTUAL_PASSWORD=your-password
23
+ export ACTUAL_SYNC_ID=your-sync-id # Found in Settings → Advanced → Sync ID
24
+
25
+ # List your accounts
26
+ actual accounts list
27
+
28
+ # Check a balance
29
+ actual accounts balance <account-id>
30
+
31
+ # View this month's budget
32
+ actual budgets month 2026-03
33
+ ```
34
+
35
+ ## Configuration
36
+
37
+ Configuration is resolved in this order (highest priority first):
38
+
39
+ 1. **CLI flags** (`--server-url`, `--password`, etc.)
40
+ 2. **Environment variables**
41
+ 3. **Config file** (via [cosmiconfig](https://github.com/cosmiconfig/cosmiconfig))
42
+ 4. **Defaults** (`dataDir` defaults to `~/.actual-cli/data`)
43
+
44
+ ### Environment Variables
45
+
46
+ | Variable | Description |
47
+ | ---------------------- | --------------------------------------------- |
48
+ | `ACTUAL_SERVER_URL` | URL of the Actual sync server (required) |
49
+ | `ACTUAL_PASSWORD` | Server password (required unless using token) |
50
+ | `ACTUAL_SESSION_TOKEN` | Session token (alternative to password) |
51
+ | `ACTUAL_SYNC_ID` | Budget Sync ID (required for most commands) |
52
+ | `ACTUAL_DATA_DIR` | Local directory for cached budget data |
53
+
54
+ ### Config File
55
+
56
+ Create an `.actualrc.json` (or `.actualrc`, `.actualrc.yaml`, `actual.config.js`):
57
+
58
+ ```json
59
+ {
60
+ "serverUrl": "http://localhost:5006",
61
+ "password": "your-password",
62
+ "syncId": "1cfdbb80-6274-49bf-b0c2-737235a4c81f"
63
+ }
64
+ ```
65
+
66
+ **Security:** Do not store plaintext passwords in config files (e.g. `.actualrc.json`, `.actualrc`, `.actualrc.yaml`, `actual.config.js`). Add these files to `.gitignore` if they contain secrets. Prefer the `ACTUAL_SESSION_TOKEN` environment variable instead of the `password` field. See [Environment Variables](#environment-variables) for using a session token.
67
+
68
+ ### Global Flags
69
+
70
+ | Flag | Description |
71
+ | ------------------------- | ----------------------------------------------- |
72
+ | `--server-url <url>` | Server URL |
73
+ | `--password <pw>` | Server password |
74
+ | `--session-token <token>` | Session token |
75
+ | `--sync-id <id>` | Budget Sync ID |
76
+ | `--data-dir <path>` | Data directory |
77
+ | `--format <format>` | Output format: `json` (default), `table`, `csv` |
78
+ | `--verbose` | Show informational messages |
79
+
80
+ ## Commands
81
+
82
+ | Command | Description |
83
+ | ----------------- | ------------------------------ |
84
+ | `accounts` | Manage accounts |
85
+ | `budgets` | Manage budgets and allocations |
86
+ | `categories` | Manage categories |
87
+ | `category-groups` | Manage category groups |
88
+ | `transactions` | Manage transactions |
89
+ | `payees` | Manage payees |
90
+ | `tags` | Manage tags |
91
+ | `rules` | Manage transaction rules |
92
+ | `schedules` | Manage scheduled transactions |
93
+ | `query` | Run an ActualQL query |
94
+ | `server` | Server utilities and lookups |
95
+
96
+ Run `actual <command> --help` for subcommands and options.
97
+
98
+ ### Examples
99
+
100
+ ```bash
101
+ # List all accounts (as a table)
102
+ actual accounts list --format table
103
+
104
+ # Find an entity ID by name
105
+ actual server get-id --type accounts --name "Checking"
106
+
107
+ # Add a transaction (amount in integer cents: -2500 = -$25.00)
108
+ actual transactions add --account <id> \
109
+ --data '[{"date":"2026-03-14","amount":-2500,"payee_name":"Coffee Shop"}]'
110
+
111
+ # Export transactions to CSV
112
+ actual transactions list --account <id> \
113
+ --start 2026-01-01 --end 2026-12-31 --format csv > transactions.csv
114
+
115
+ # Set budget amount ($500 = 50000 cents)
116
+ actual budgets set-amount --month 2026-03 --category <id> --amount 50000
117
+
118
+ # Run an ActualQL query
119
+ actual query run --table transactions \
120
+ --select "date,amount,payee" --filter '{"amount":{"$lt":0}}' --limit 10
121
+ ```
122
+
123
+ ### Amount Convention
124
+
125
+ All monetary amounts are **integer cents**:
126
+
127
+ | CLI Value | Dollar Amount |
128
+ | --------- | ------------- |
129
+ | `5000` | $50.00 |
130
+ | `-12350` | -$123.50 |
131
+
132
+ ## Running Locally (Development)
133
+
134
+ If you're working on the CLI within the monorepo:
135
+
136
+ ```bash
137
+ # 1. Build the CLI
138
+ yarn build:cli
139
+
140
+ # 2. Start a local sync server (in a separate terminal)
141
+ yarn start:server-dev
142
+
143
+ # 3. Open http://localhost:5006 in your browser, create a budget,
144
+ # then find the Sync ID in Settings → Advanced → Sync ID
145
+
146
+ # 4. Run the CLI directly from the build output
147
+ ACTUAL_SERVER_URL=http://localhost:5006 \
148
+ ACTUAL_PASSWORD=your-password \
149
+ ACTUAL_SYNC_ID=your-sync-id \
150
+ node packages/cli/dist/cli.js accounts list
151
+
152
+ # Or use a shorthand alias for convenience
153
+ alias actual-dev="node $(pwd)/packages/cli/dist/cli.js"
154
+ actual-dev budgets list
155
+ ```