sheetlink 0.1.0 → 0.1.2
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 +84 -0
- package/package.json +2 -2
- package/src/commands/auth.js +4 -8
package/README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# sheetlink
|
|
2
|
+
|
|
3
|
+
CLI for SheetLink — sync your bank transactions to any destination.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
npm install -g sheetlink
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Requires a [SheetLink](https://sheetlink.app) account on the **PRO** or **MAX** tier.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Commands
|
|
14
|
+
|
|
15
|
+
### `sheetlink auth`
|
|
16
|
+
Authenticate with SheetLink.
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
sheetlink auth # OAuth login (PRO)
|
|
20
|
+
sheetlink auth --api-key sl_... # API key (MAX — for automation)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### `sheetlink sync`
|
|
24
|
+
Sync transactions from all connected banks.
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
sheetlink sync # JSON to stdout (default)
|
|
28
|
+
sheetlink sync | jq '.items[].transactions | length' # Pipe to jq
|
|
29
|
+
sheetlink sync --output csv # CSV snapshot
|
|
30
|
+
sheetlink sync --output csv --file ~/finances.csv # CSV to custom path
|
|
31
|
+
sheetlink sync --output postgres://localhost/mydb # Upsert to Postgres (MAX)
|
|
32
|
+
sheetlink sync --output sqlite:///~/finance.db # Upsert to SQLite (MAX)
|
|
33
|
+
sheetlink sync --item <item_id> # One bank only
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### `sheetlink items`
|
|
37
|
+
List connected bank accounts.
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
sheetlink items
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### `sheetlink config`
|
|
44
|
+
View or update CLI configuration.
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
sheetlink config # Show current config
|
|
48
|
+
sheetlink config --set default_output=csv # Set default output
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**Settable keys:**
|
|
52
|
+
- `default_output` — `json`, `csv`, `postgres://...`, `sqlite://...`
|
|
53
|
+
- `api_url` — Backend URL (default: `https://api.sheetlink.app`)
|
|
54
|
+
|
|
55
|
+
**Environment variable overrides:**
|
|
56
|
+
- `SHEETLINK_API_KEY` — API key (MAX tier)
|
|
57
|
+
- `SHEETLINK_OUTPUT` — Default output destination
|
|
58
|
+
- `SHEETLINK_API_URL` — Backend URL
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Tiers
|
|
63
|
+
|
|
64
|
+
| Feature | PRO | MAX |
|
|
65
|
+
|---|---|---|
|
|
66
|
+
| JSON / CSV output | ✅ | ✅ |
|
|
67
|
+
| Postgres output | — | ✅ |
|
|
68
|
+
| SQLite output | — | ✅ |
|
|
69
|
+
| API key auth (unattended/cron) | — | ✅ |
|
|
70
|
+
|
|
71
|
+
[View pricing →](https://sheetlink.app/pricing)
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Requirements
|
|
76
|
+
|
|
77
|
+
- Node.js 18+
|
|
78
|
+
- A SheetLink account with at least one connected bank ([sheetlink.app/dashboard](https://sheetlink.app/dashboard))
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## License
|
|
83
|
+
|
|
84
|
+
MIT © [SheetLink](https://sheetlink.app)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sheetlink",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "CLI for SheetLink — sync your bank transactions to any destination",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -36,6 +36,6 @@
|
|
|
36
36
|
"license": "MIT",
|
|
37
37
|
"repository": {
|
|
38
38
|
"type": "git",
|
|
39
|
-
"url": "https://github.com/sheetlink/
|
|
39
|
+
"url": "https://github.com/sheetlink/cli"
|
|
40
40
|
}
|
|
41
41
|
}
|
package/src/commands/auth.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import http from 'http';
|
|
17
17
|
import { randomBytes } from 'crypto';
|
|
18
18
|
import { writeConfig, getApiUrl } from '../config.js';
|
|
19
|
-
import { getTierStatus } from '../api.js';
|
|
19
|
+
import { getTierStatus, listItems } from '../api.js';
|
|
20
20
|
|
|
21
21
|
const GOOGLE_CLIENT_ID = '967710910027-qq2tuel7vsi2i06h4h096hbvok8kfmhk.apps.googleusercontent.com';
|
|
22
22
|
const REDIRECT_PORT = 9876;
|
|
@@ -41,14 +41,10 @@ export async function cmdAuth(options) {
|
|
|
41
41
|
console.log('API key saved to ~/.sheetlink/config.json');
|
|
42
42
|
console.log('');
|
|
43
43
|
|
|
44
|
-
// Verify it works
|
|
44
|
+
// Verify it works by hitting an API-key-aware endpoint
|
|
45
45
|
try {
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
console.error(`Warning: This key belongs to a ${status.subscription_tier} account. MAX tier is required for API key auth.`);
|
|
49
|
-
process.exit(1);
|
|
50
|
-
}
|
|
51
|
-
console.log(`Authenticated as ${status.email} (${status.subscription_tier} tier)`);
|
|
46
|
+
const { items } = await listItems();
|
|
47
|
+
console.log(`Authenticated. ${items.length} bank${items.length !== 1 ? 's' : ''} connected.`);
|
|
52
48
|
} catch (e) {
|
|
53
49
|
console.error(`Could not verify key: ${e.message}`);
|
|
54
50
|
process.exit(1);
|