@actual-app/cli 26.5.0 → 26.6.0-nightly.20260505
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 +38 -16
- package/dist/cli.js +1811 -135
- package/dist/stats.json +1721 -1112
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -43,13 +43,16 @@ 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
|
|
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 |
|
|
53
56
|
|
|
54
57
|
### Config File
|
|
55
58
|
|
|
@@ -59,7 +62,10 @@ Create an `.actualrc.json` (or `.actualrc`, `.actualrc.yaml`, `actual.config.js`
|
|
|
59
62
|
{
|
|
60
63
|
"serverUrl": "http://localhost:5006",
|
|
61
64
|
"password": "your-password",
|
|
62
|
-
"syncId": "1cfdbb80-6274-49bf-b0c2-737235a4c81f"
|
|
65
|
+
"syncId": "1cfdbb80-6274-49bf-b0c2-737235a4c81f",
|
|
66
|
+
"cacheTtl": 60,
|
|
67
|
+
"lockTimeout": 10,
|
|
68
|
+
"noLock": false
|
|
63
69
|
}
|
|
64
70
|
```
|
|
65
71
|
|
|
@@ -74,6 +80,11 @@ Create an `.actualrc.json` (or `.actualrc`, `.actualrc.yaml`, `actual.config.js`
|
|
|
74
80
|
| `--session-token <token>` | Session token |
|
|
75
81
|
| `--sync-id <id>` | Budget Sync ID |
|
|
76
82
|
| `--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) |
|
|
77
88
|
| `--format <format>` | Output format: `json` (default), `table`, `csv` |
|
|
78
89
|
| `--verbose` | Show informational messages |
|
|
79
90
|
|
|
@@ -92,6 +103,7 @@ Create an `.actualrc.json` (or `.actualrc`, `.actualrc.yaml`, `actual.config.js`
|
|
|
92
103
|
| `schedules` | Manage scheduled transactions |
|
|
93
104
|
| `query` | Run an ActualQL query |
|
|
94
105
|
| `server` | Server utilities and lookups |
|
|
106
|
+
| `sync` | Refresh or inspect local cache |
|
|
95
107
|
|
|
96
108
|
Run `actual <command> --help` for subcommands and options.
|
|
97
109
|
|
|
@@ -135,22 +147,32 @@ All monetary amounts are **integer cents** when passed as input (flags, JSON):
|
|
|
135
147
|
|
|
136
148
|
- **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.
|
|
137
149
|
|
|
138
|
-
- **
|
|
150
|
+
- **Rapid sequential requests:** The CLI caches the budget locally (see [Caching](#caching)), so read-heavy scripts no longer need a single-query workaround by default. For very chatty scripts, run `actual sync` once and then use a long `--cache-ttl` for reads:
|
|
139
151
|
|
|
140
152
|
```bash
|
|
141
|
-
|
|
142
|
-
actual query run
|
|
143
|
-
|
|
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
|
|
153
|
+
actual sync
|
|
154
|
+
actual --cache-ttl 3600 query run ...
|
|
155
|
+
actual --cache-ttl 3600 accounts list
|
|
148
156
|
```
|
|
149
157
|
|
|
150
158
|
- **Uncategorized transactions:** `category.name` is `null` for transactions without a category. Account for this when filtering or grouping by category.
|
|
151
159
|
|
|
152
160
|
- **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.
|
|
153
161
|
|
|
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
|
+
|
|
154
176
|
## Running Locally (Development)
|
|
155
177
|
|
|
156
178
|
If you're working on the CLI within the monorepo:
|