@nuelink/nuelink-cli 1.4.1 → 1.4.3
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 +47 -41
- package/package.json +31 -30
- package/src/commands.js +194 -142
- package/src/http.js +126 -126
- package/src/postPayload.js +26 -20
- package/src/validation.js +94 -50
- package/test/cli.test.mjs +320 -219
package/README.md
CHANGED
|
@@ -78,7 +78,7 @@ The token is stored in:
|
|
|
78
78
|
- Windows: `%USERPROFILE%/.nuelink-cli/config.json`
|
|
79
79
|
- macOS/Linux: `$HOME/.nuelink-cli/config.json`
|
|
80
80
|
|
|
81
|
-
The file stores:
|
|
81
|
+
The file stores:
|
|
82
82
|
|
|
83
83
|
```json
|
|
84
84
|
{
|
|
@@ -86,20 +86,20 @@ The file stores:
|
|
|
86
86
|
"encryptedApiKey": "...",
|
|
87
87
|
"iv": "...",
|
|
88
88
|
"authTag": "..."
|
|
89
|
-
}
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
Saved keys are written through a mode-`0700` config directory and an atomic
|
|
93
|
-
mode-`0600` file replacement where the operating system supports POSIX
|
|
94
|
-
permissions. The CLI refuses symbolic-link config paths. The bundled
|
|
95
|
-
encryption prevents casual disclosure but is not a substitute for filesystem
|
|
96
|
-
permissions; prefer `NUELINK_API_KEY` when a secret manager is available.
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Saved keys are written through a mode-`0700` config directory and an atomic
|
|
93
|
+
mode-`0600` file replacement where the operating system supports POSIX
|
|
94
|
+
permissions. The CLI refuses symbolic-link config paths. The bundled
|
|
95
|
+
encryption prevents casual disclosure but is not a substitute for filesystem
|
|
96
|
+
permissions; prefer `NUELINK_API_KEY` when a secret manager is available.
|
|
97
97
|
|
|
98
98
|
## Global Options
|
|
99
99
|
|
|
100
100
|
- `-a, --api-key <apiKey>`: Use API key for the current invocation only
|
|
101
101
|
- `--auth <apiKey>`: Deprecated alias for `--api-key`
|
|
102
|
-
- `--json`: Output machine-readable JSON for successes and failures
|
|
102
|
+
- `--json`: Output machine-readable JSON for successes and failures
|
|
103
103
|
- `-h, --help`: Show help
|
|
104
104
|
- `-V, --version`: Show version
|
|
105
105
|
|
|
@@ -116,6 +116,7 @@ nuelink-cli me
|
|
|
116
116
|
```bash
|
|
117
117
|
printf '%s' "$NUELINK_API_KEY" | nuelink-cli auth:login --stdin
|
|
118
118
|
nuelink-cli auth:status
|
|
119
|
+
nuelink-cli auth:validate
|
|
119
120
|
nuelink-cli auth:clear
|
|
120
121
|
```
|
|
121
122
|
|
|
@@ -145,9 +146,9 @@ Raw JSON mode:
|
|
|
145
146
|
nuelink-cli --json brands --per-page 5 --page 1
|
|
146
147
|
```
|
|
147
148
|
|
|
148
|
-
In `--json` mode, stdout contains one JSON value so it can be piped directly
|
|
149
|
-
into tools like `jq`. API successes retain the raw response shape. Failures use
|
|
150
|
-
`{"success":false,"error":{"code":"...","message":"...","httpStatus":null,"details":{}}}`.
|
|
149
|
+
In `--json` mode, stdout contains one JSON value so it can be piped directly
|
|
150
|
+
into tools like `jq`. API successes retain the raw response shape. Failures use
|
|
151
|
+
`{"success":false,"error":{"code":"...","message":"...","httpStatus":null,"details":{}}}`.
|
|
151
152
|
|
|
152
153
|
### Collections
|
|
153
154
|
|
|
@@ -160,14 +161,14 @@ Example output includes collection title, status-related fields, and pagination
|
|
|
160
161
|
Create collection:
|
|
161
162
|
|
|
162
163
|
```bash
|
|
163
|
-
nuelink-cli collections:create \
|
|
164
|
+
nuelink-cli collections:create \
|
|
164
165
|
--brand-id 13493 \
|
|
165
166
|
--title "API Brand" \
|
|
166
167
|
--description "Collection from CLI" \
|
|
167
168
|
--max-republish 5 \
|
|
168
169
|
--channels "300294,60112" \
|
|
169
|
-
--queues "Mon 10:10,Mon 12:12" \
|
|
170
|
-
--dry-run
|
|
170
|
+
--queues "Mon 10:10,Mon 12:12" \
|
|
171
|
+
--dry-run
|
|
171
172
|
```
|
|
172
173
|
|
|
173
174
|
### Automations
|
|
@@ -181,7 +182,7 @@ This table view is especially useful for quickly scanning automation status, sub
|
|
|
181
182
|
Create automation:
|
|
182
183
|
|
|
183
184
|
```bash
|
|
184
|
-
nuelink-cli automations:create \
|
|
185
|
+
nuelink-cli automations:create \
|
|
185
186
|
--brand-id 13493 \
|
|
186
187
|
--collection-id 720 \
|
|
187
188
|
--feed-url "https://www.nasa.gov/rss/dyn/breaking_news.rss" \
|
|
@@ -190,8 +191,8 @@ nuelink-cli automations:create \
|
|
|
190
191
|
--title "NASA Breaking News" \
|
|
191
192
|
--type FEED \
|
|
192
193
|
--dynamic-title "{{title}}" \
|
|
193
|
-
--dynamic-body "{
|
|
194
|
-
--dry-run
|
|
194
|
+
--dynamic-body "{{description}} {{link}}" \
|
|
195
|
+
--dry-run
|
|
195
196
|
```
|
|
196
197
|
|
|
197
198
|
### Channels
|
|
@@ -215,7 +216,7 @@ Media list output highlights file name, type, size, and timestamps.
|
|
|
215
216
|
Upload media:
|
|
216
217
|
|
|
217
218
|
```bash
|
|
218
|
-
nuelink-cli media:upload --brand-id 13493 --file ./assets/image.jpg --dry-run
|
|
219
|
+
nuelink-cli media:upload --brand-id 13493 --file ./assets/image.jpg --dry-run
|
|
219
220
|
```
|
|
220
221
|
|
|
221
222
|
### Posts
|
|
@@ -227,11 +228,14 @@ nuelink-cli posts --brand-id 13493 --collection-id 33273 --per-page 5 --page 1
|
|
|
227
228
|
```
|
|
228
229
|
|
|
229
230
|
Post list output highlights the post ID, type, status, and publish date.
|
|
231
|
+
Optional filters include `--status`, `--post-type`, `--posting-type`,
|
|
232
|
+
`--created-from`, `--created-to`, `--sort-by`, and `--sort-order`.
|
|
233
|
+
Creation date filters use `YYYY-MM-DD HH:mm:ss` UTC timestamps.
|
|
230
234
|
|
|
231
235
|
Create post from JSON payload file:
|
|
232
236
|
|
|
233
237
|
```bash
|
|
234
|
-
nuelink-cli posts:add-json --brand-id 13493 --collection-id 33273 --payload ./post.json --dry-run
|
|
238
|
+
nuelink-cli posts:add-json --brand-id 13493 --collection-id 33273 --payload ./post.json --dry-run
|
|
235
239
|
```
|
|
236
240
|
|
|
237
241
|
You can also pipe JSON through stdin with `--payload -`.
|
|
@@ -278,16 +282,18 @@ nuelink-cli posts:create \
|
|
|
278
282
|
--tiktok-auto-add-music false \
|
|
279
283
|
--youtube-tags "tag1,tag2,tag3" \
|
|
280
284
|
--youtube-playlists '[{"channelId":1,"playlistIds":["1","2"]}]' \
|
|
281
|
-
--googlemybusiness-upload-to-photos-section true \
|
|
282
|
-
--dry-run
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
Review each mutation preview, then repeat the same command without `--dry-run`
|
|
286
|
-
only when you intend to send it.
|
|
285
|
+
--googlemybusiness-upload-to-photos-section true \
|
|
286
|
+
--dry-run
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
Review each mutation preview, then repeat the same command without `--dry-run`
|
|
290
|
+
only when you intend to send it.
|
|
287
291
|
|
|
288
292
|
Supported publish modes are `DRAFT`, `QUEUE`, `SCHEDULE`, and `IMMEDIATE`. When using `SCHEDULE`, pass `--scheduled-at` in `YYYY-MM-DD HH:mm:ss` format. Poll correct-option indexes are zero-based.
|
|
289
293
|
|
|
290
|
-
Pagination uses `--page >= 1` and `--per-page` from 1 through 100. Media type
|
|
294
|
+
Pagination uses `--page >= 1` and `--per-page` from 1 through 100. Media type
|
|
295
|
+
filters are `IMAGE`, `VIDEO`, `GIF`, `APPLICATION`, `DOCUMENT`, and `CSV`.
|
|
296
|
+
Uploads accept JPEG, PNG, BMP, MP4, MOV, or PDF files up to 100 MiB.
|
|
291
297
|
|
|
292
298
|
## Output and Exit Codes
|
|
293
299
|
|
|
@@ -345,20 +351,20 @@ npm test
|
|
|
345
351
|
### Package validation
|
|
346
352
|
|
|
347
353
|
```bash
|
|
348
|
-
npm run check:pack
|
|
349
|
-
npm run check:pack:installed
|
|
354
|
+
npm run check:pack
|
|
355
|
+
npm run check:pack:installed
|
|
350
356
|
```
|
|
351
357
|
|
|
352
358
|
## Release Checklist
|
|
353
359
|
|
|
354
360
|
1. Update version in `package.json`
|
|
355
361
|
2. Run `npm test`
|
|
356
|
-
3. Run `npm run check:pack`
|
|
357
|
-
4. Run `npm run check:pack:installed`
|
|
358
|
-
5. Publish locally with `npm publish --access public`
|
|
359
|
-
|
|
360
|
-
Provenance is available when publishing from a supported cloud CI provider. Do
|
|
361
|
-
not enable it for a local publish.
|
|
362
|
+
3. Run `npm run check:pack`
|
|
363
|
+
4. Run `npm run check:pack:installed`
|
|
364
|
+
5. Publish locally with `npm publish --access public`
|
|
365
|
+
|
|
366
|
+
Provenance is available when publishing from a supported cloud CI provider. Do
|
|
367
|
+
not enable it for a local publish.
|
|
362
368
|
|
|
363
369
|
## Troubleshooting
|
|
364
370
|
|
|
@@ -373,11 +379,11 @@ not enable it for a local publish.
|
|
|
373
379
|
Increase timeout for slower operations:
|
|
374
380
|
|
|
375
381
|
```bash
|
|
376
|
-
NUELINK_TIMEOUT_MS=120000 nuelink-cli media --brand-id 13493
|
|
377
|
-
```
|
|
378
|
-
|
|
379
|
-
`NUELINK_TIMEOUT_MS` must be 1–600000. `NUELINK_GET_RETRIES` must be 0–10;
|
|
380
|
-
retry delay variables must be non-negative integers no greater than 600000.
|
|
382
|
+
NUELINK_TIMEOUT_MS=120000 nuelink-cli media --brand-id 13493
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
`NUELINK_TIMEOUT_MS` must be 1–600000. `NUELINK_GET_RETRIES` must be 0–10;
|
|
386
|
+
retry delay variables must be non-negative integers no greater than 600000.
|
|
381
387
|
|
|
382
388
|
### Command help
|
|
383
389
|
|
package/package.json
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuelink/nuelink-cli",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.3",
|
|
4
4
|
"description": "The official Nuelink CLI for automating social media workflows from your terminal. Schedule posts, upload media, manage brands, and integrate Nuelink into scripts, CI/CD pipelines, and AI agents.",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"author": "Nuelink",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/Nuelink/nuelink-cli.git"
|
|
10
|
-
},
|
|
11
|
-
"homepage": "https://github.com/Nuelink/nuelink-cli#readme",
|
|
12
|
-
"bugs": {
|
|
13
|
-
"url": "https://github.com/Nuelink/nuelink-cli/issues"
|
|
14
|
-
},
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Nuelink",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/Nuelink/nuelink-cli.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/Nuelink/nuelink-cli#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/Nuelink/nuelink-cli/issues"
|
|
14
|
+
},
|
|
15
15
|
"type": "module",
|
|
16
16
|
"main": "./src/cli.js",
|
|
17
17
|
"scripts": {
|
|
18
|
-
"test": "node --test test/cli.test.mjs",
|
|
19
|
-
"smoke:auth": "node src/cli.js auth:status",
|
|
20
|
-
"check:pack": "npm pack --dry-run",
|
|
21
|
-
"check:pack:installed": "node scripts/check-packed-package.mjs"
|
|
18
|
+
"test": "node --test test/cli.test.mjs",
|
|
19
|
+
"smoke:auth": "node src/cli.js auth:status",
|
|
20
|
+
"check:pack": "npm pack --dry-run",
|
|
21
|
+
"check:pack:installed": "node scripts/check-packed-package.mjs"
|
|
22
22
|
},
|
|
23
23
|
"engines": {
|
|
24
24
|
"node": ">=18.17"
|
|
25
25
|
},
|
|
26
|
-
"files": [
|
|
27
|
-
"src",
|
|
28
|
-
"test",
|
|
29
|
-
"CHANGELOG.md",
|
|
30
|
-
"README.md",
|
|
31
|
-
"SECURITY.md",
|
|
32
|
-
"LICENSE"
|
|
33
|
-
],
|
|
34
|
-
"publishConfig": {
|
|
35
|
-
"access": "public"
|
|
36
|
-
},
|
|
26
|
+
"files": [
|
|
27
|
+
"src",
|
|
28
|
+
"test",
|
|
29
|
+
"CHANGELOG.md",
|
|
30
|
+
"README.md",
|
|
31
|
+
"SECURITY.md",
|
|
32
|
+
"LICENSE"
|
|
33
|
+
],
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
37
|
"keywords": [
|
|
38
38
|
"nuelink",
|
|
39
39
|
"cli",
|
|
@@ -41,10 +41,11 @@
|
|
|
41
41
|
"automation"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
+
"@nuelink/nuelink-cli": "^1.4.3",
|
|
44
45
|
"chalk": "^5.6.2",
|
|
45
46
|
"commander": "^13.1.0"
|
|
46
47
|
},
|
|
47
|
-
"bin": {
|
|
48
|
-
"nuelink-cli": "src/cli.js"
|
|
49
|
-
}
|
|
50
|
-
}
|
|
48
|
+
"bin": {
|
|
49
|
+
"nuelink-cli": "src/cli.js"
|
|
50
|
+
}
|
|
51
|
+
}
|