@actual-app/cli 26.5.0-nightly.20260503 → 26.5.1
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.
- package/README.md +16 -38
- package/dist/cli.js +135 -1811
- package/dist/stats.json +1112 -1721
- package/package.json +3 -7
package/README.md
CHANGED
|
@@ -43,16 +43,13 @@ Configuration is resolved in this order (highest priority first):
|
|
|
43
43
|
|
|
44
44
|
### Environment Variables
|
|
45
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
|
-
| `ACTUAL_CACHE_TTL` | Cache TTL in seconds (default: 60) |
|
|
54
|
-
| `ACTUAL_LOCK_TIMEOUT` | Budget-dir lock wait timeout in seconds (default: 10) |
|
|
55
|
-
| `ACTUAL_NO_LOCK` | Set to `1` to disable budget-dir locking |
|
|
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 |
|
|
56
53
|
|
|
57
54
|
### Config File
|
|
58
55
|
|
|
@@ -62,10 +59,7 @@ Create an `.actualrc.json` (or `.actualrc`, `.actualrc.yaml`, `actual.config.js`
|
|
|
62
59
|
{
|
|
63
60
|
"serverUrl": "http://localhost:5006",
|
|
64
61
|
"password": "your-password",
|
|
65
|
-
"syncId": "1cfdbb80-6274-49bf-b0c2-737235a4c81f"
|
|
66
|
-
"cacheTtl": 60,
|
|
67
|
-
"lockTimeout": 10,
|
|
68
|
-
"noLock": false
|
|
62
|
+
"syncId": "1cfdbb80-6274-49bf-b0c2-737235a4c81f"
|
|
69
63
|
}
|
|
70
64
|
```
|
|
71
65
|
|
|
@@ -80,11 +74,6 @@ Create an `.actualrc.json` (or `.actualrc`, `.actualrc.yaml`, `actual.config.js`
|
|
|
80
74
|
| `--session-token <token>` | Session token |
|
|
81
75
|
| `--sync-id <id>` | Budget Sync ID |
|
|
82
76
|
| `--data-dir <path>` | Data directory |
|
|
83
|
-
| `--cache-ttl <seconds>` | Cache TTL; `0` disables caching (default: 60) |
|
|
84
|
-
| `--refresh` | Force a sync on this call, ignoring the cache |
|
|
85
|
-
| `--no-cache` | Alias for `--refresh` |
|
|
86
|
-
| `--lock-timeout <secs>` | Lock wait timeout (default: 10) |
|
|
87
|
-
| `--no-lock` | Disable budget-dir locking (use with care) |
|
|
88
77
|
| `--format <format>` | Output format: `json` (default), `table`, `csv` |
|
|
89
78
|
| `--verbose` | Show informational messages |
|
|
90
79
|
|
|
@@ -103,7 +92,6 @@ Create an `.actualrc.json` (or `.actualrc`, `.actualrc.yaml`, `actual.config.js`
|
|
|
103
92
|
| `schedules` | Manage scheduled transactions |
|
|
104
93
|
| `query` | Run an ActualQL query |
|
|
105
94
|
| `server` | Server utilities and lookups |
|
|
106
|
-
| `sync` | Refresh or inspect local cache |
|
|
107
95
|
|
|
108
96
|
Run `actual <command> --help` for subcommands and options.
|
|
109
97
|
|
|
@@ -147,32 +135,22 @@ All monetary amounts are **integer cents** when passed as input (flags, JSON):
|
|
|
147
135
|
|
|
148
136
|
- **Split transactions:** When summing or counting transactions, filter `"is_parent": false` to avoid double-counting. A split parent holds the total amount, and its children hold the individual parts — including both would count the total twice.
|
|
149
137
|
|
|
150
|
-
- **
|
|
138
|
+
- **Avoid rapid sequential requests:** Each CLI invocation opens a new server connection. Running queries in a tight loop (e.g. one per month) may trigger rate limiting or authentication failures. Instead, fetch all data in a single query with a date range filter and process locally:
|
|
151
139
|
|
|
152
140
|
```bash
|
|
153
|
-
|
|
154
|
-
actual
|
|
155
|
-
|
|
141
|
+
# Good: single query for the full year
|
|
142
|
+
actual query run --table transactions \
|
|
143
|
+
--filter '{"$and":[{"date":{"$gte":"2025-01-01"}},{"date":{"$lte":"2025-12-31"}}]}' \
|
|
144
|
+
--limit 5000
|
|
145
|
+
|
|
146
|
+
# Bad: one query per month in a loop (may fail with auth errors)
|
|
147
|
+
for month in 01 02 03 ...; do actual query run ...; done
|
|
156
148
|
```
|
|
157
149
|
|
|
158
150
|
- **Uncategorized transactions:** `category.name` is `null` for transactions without a category. Account for this when filtering or grouping by category.
|
|
159
151
|
|
|
160
152
|
- **No date sub-fields in AQL:** `date.month`, `date.year`, etc. are not supported as query fields. To group by month, fetch raw transactions with a date range filter and aggregate locally in a script.
|
|
161
153
|
|
|
162
|
-
## Caching
|
|
163
|
-
|
|
164
|
-
The CLI keeps a local copy of your budget so repeated commands don't hit the sync server on every call. Within the TTL (default `60` seconds), read commands (`list`, `balance`, `query run`, …) reuse the cached budget without a network round-trip. Write commands (`add`, `update`, `set-amount`, …) always sync with the server before and after the write.
|
|
165
|
-
|
|
166
|
-
- `actual sync` — refresh the cache now.
|
|
167
|
-
- `actual sync --status` — show how stale the local cache is.
|
|
168
|
-
- `actual sync --clear` — delete the local cache; the next command re-downloads.
|
|
169
|
-
- `--refresh` (or `--no-cache`) — force a sync on a single call.
|
|
170
|
-
- `--cache-ttl <seconds>` — override the TTL for a single call (use `0` to disable caching).
|
|
171
|
-
|
|
172
|
-
### Concurrency
|
|
173
|
-
|
|
174
|
-
The CLI takes a shared lock for reads and an exclusive lock for writes on the per-budget cache directory. Many parallel reads are safe; writes serialize. If another CLI process is holding the lock, subsequent invocations wait up to `--lock-timeout` seconds (default `10`) before failing with an error. Pass `--no-lock` to opt out in trusted single-process setups.
|
|
175
|
-
|
|
176
154
|
## Running Locally (Development)
|
|
177
155
|
|
|
178
156
|
If you're working on the CLI within the monorepo:
|