postiz 2.0.5 → 2.0.6
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/CHANGELOG.md +29 -0
- package/LICENSE +13 -657
- package/README.md +54 -23
- package/SKILL.md +28 -6
- package/dist/index.js +234 -12480
- package/dist/index.js.map +1 -1
- package/package.json +29 -8
package/README.md
CHANGED
|
@@ -29,7 +29,6 @@ pnpm link --global
|
|
|
29
29
|
### For Development
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
|
-
cd apps/cli
|
|
33
32
|
pnpm install
|
|
34
33
|
pnpm run build
|
|
35
34
|
pnpm link --global
|
|
@@ -180,6 +179,15 @@ postiz posts:delete <post-id>
|
|
|
180
179
|
postiz upload <file-path>
|
|
181
180
|
```
|
|
182
181
|
|
|
182
|
+
**⚠️ IMPORTANT: Upload Files Before Posting**
|
|
183
|
+
|
|
184
|
+
You **must** upload media files to Postiz before using them in posts. Many platforms (especially TikTok, Instagram, and YouTube) require verified/trusted URLs and will reject external links.
|
|
185
|
+
|
|
186
|
+
**Workflow:**
|
|
187
|
+
1. Upload your file using `postiz upload`
|
|
188
|
+
2. Extract the returned URL
|
|
189
|
+
3. Use that URL in your post's `-m` parameter
|
|
190
|
+
|
|
183
191
|
**Supported formats:**
|
|
184
192
|
- **Images:** PNG, JPG, JPEG, GIF, WEBP, SVG, BMP, ICO
|
|
185
193
|
- **Videos:** MP4, MOV, AVI, MKV, WEBM, FLV, WMV, M4V, MPEG, MPG, 3GP
|
|
@@ -188,11 +196,19 @@ postiz upload <file-path>
|
|
|
188
196
|
|
|
189
197
|
**Example:**
|
|
190
198
|
```bash
|
|
199
|
+
# 1. Upload the file first
|
|
191
200
|
RESULT=$(postiz upload video.mp4)
|
|
192
201
|
PATH=$(echo "$RESULT" | jq -r '.path')
|
|
193
|
-
|
|
202
|
+
|
|
203
|
+
# 2. Use the Postiz URL in your post
|
|
204
|
+
postiz posts:create -c "Check out my video!" -s "2024-12-31T12:00:00Z" -m "$PATH" -i "tiktok-id"
|
|
194
205
|
```
|
|
195
206
|
|
|
207
|
+
**Why this is required:**
|
|
208
|
+
- **TikTok, Instagram, YouTube** only accept URLs from trusted domains
|
|
209
|
+
- **Security:** Platforms verify media sources to prevent abuse
|
|
210
|
+
- **Reliability:** Postiz ensures your media is always accessible
|
|
211
|
+
|
|
196
212
|
---
|
|
197
213
|
|
|
198
214
|
## Platform-Specific Features
|
|
@@ -215,22 +231,31 @@ postiz posts:create \
|
|
|
215
231
|
# Get playlists
|
|
216
232
|
postiz integrations:trigger youtube-id getPlaylists
|
|
217
233
|
|
|
218
|
-
# Upload video
|
|
234
|
+
# Upload video FIRST (required!)
|
|
235
|
+
VIDEO=$(postiz upload video.mp4)
|
|
236
|
+
VIDEO_URL=$(echo "$VIDEO" | jq -r '.path')
|
|
237
|
+
|
|
238
|
+
# Post with uploaded video URL
|
|
219
239
|
postiz posts:create \
|
|
220
240
|
-c "Video description" \
|
|
221
241
|
-s "2024-12-31T12:00:00Z" \
|
|
222
242
|
--settings '{"title":"Video Title","type":"public","tags":[{"value":"tech","label":"Tech"}],"playlistId":"playlist-id"}' \
|
|
223
|
-
-m "
|
|
243
|
+
-m "$VIDEO_URL" \
|
|
224
244
|
-i "youtube-id"
|
|
225
245
|
```
|
|
226
246
|
|
|
227
247
|
### TikTok
|
|
228
248
|
```bash
|
|
249
|
+
# Upload video FIRST (TikTok only accepts verified URLs!)
|
|
250
|
+
VIDEO=$(postiz upload video.mp4)
|
|
251
|
+
VIDEO_URL=$(echo "$VIDEO" | jq -r '.path')
|
|
252
|
+
|
|
253
|
+
# Post with uploaded video URL
|
|
229
254
|
postiz posts:create \
|
|
230
255
|
-c "Video caption #fyp" \
|
|
231
256
|
-s "2024-12-31T12:00:00Z" \
|
|
232
257
|
--settings '{"privacy":"PUBLIC_TO_EVERYONE","duet":true,"stitch":true}' \
|
|
233
|
-
-m "
|
|
258
|
+
-m "$VIDEO_URL" \
|
|
234
259
|
-i "tiktok-id"
|
|
235
260
|
```
|
|
236
261
|
|
|
@@ -268,20 +293,27 @@ postiz posts:create \
|
|
|
268
293
|
|
|
269
294
|
### Instagram
|
|
270
295
|
```bash
|
|
296
|
+
# Upload image FIRST (Instagram requires verified URLs!)
|
|
297
|
+
IMAGE=$(postiz upload image.jpg)
|
|
298
|
+
IMAGE_URL=$(echo "$IMAGE" | jq -r '.path')
|
|
299
|
+
|
|
271
300
|
# Regular post
|
|
272
301
|
postiz posts:create \
|
|
273
302
|
-c "Caption #hashtag" \
|
|
274
303
|
-s "2024-12-31T12:00:00Z" \
|
|
275
304
|
--settings '{"post_type":"post"}' \
|
|
276
|
-
-m "
|
|
305
|
+
-m "$IMAGE_URL" \
|
|
277
306
|
-i "instagram-id"
|
|
278
307
|
|
|
279
|
-
# Story
|
|
308
|
+
# Story (upload first)
|
|
309
|
+
STORY=$(postiz upload story.jpg)
|
|
310
|
+
STORY_URL=$(echo "$STORY" | jq -r '.path')
|
|
311
|
+
|
|
280
312
|
postiz posts:create \
|
|
281
313
|
-c "" \
|
|
282
314
|
-s "2024-12-31T12:00:00Z" \
|
|
283
315
|
--settings '{"post_type":"story"}' \
|
|
284
|
-
-m "
|
|
316
|
+
-m "$STORY_URL" \
|
|
285
317
|
-i "instagram-id"
|
|
286
318
|
```
|
|
287
319
|
|
|
@@ -491,21 +523,20 @@ The CLI provides clear error messages with exit codes:
|
|
|
491
523
|
### Project Structure
|
|
492
524
|
|
|
493
525
|
```
|
|
494
|
-
|
|
495
|
-
├──
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
└── SKILL.md # AI agent reference
|
|
526
|
+
src/
|
|
527
|
+
├── index.ts # CLI entry point with yargs
|
|
528
|
+
├── api.ts # PostizAPI client class
|
|
529
|
+
├── config.ts # Environment configuration
|
|
530
|
+
└── commands/
|
|
531
|
+
├── posts.ts # Post management commands
|
|
532
|
+
├── integrations.ts # Integration commands
|
|
533
|
+
└── upload.ts # Media upload command
|
|
534
|
+
examples/ # Example scripts and JSON files
|
|
535
|
+
package.json
|
|
536
|
+
tsconfig.json
|
|
537
|
+
tsup.config.ts # Build configuration
|
|
538
|
+
README.md # This file
|
|
539
|
+
SKILL.md # AI agent reference
|
|
509
540
|
```
|
|
510
541
|
|
|
511
542
|
### Scripts
|
package/SKILL.md
CHANGED
|
@@ -107,12 +107,19 @@ postiz posts:delete <post-id>
|
|
|
107
107
|
|
|
108
108
|
### Media Upload
|
|
109
109
|
|
|
110
|
+
**⚠️ IMPORTANT:** Always upload files to Postiz before using them in posts. Many platforms (TikTok, Instagram, YouTube) **require verified URLs** and will reject external links.
|
|
111
|
+
|
|
110
112
|
```bash
|
|
111
113
|
# Upload file and get URL
|
|
112
114
|
postiz upload image.jpg
|
|
113
115
|
|
|
114
116
|
# Supports: images (PNG, JPG, GIF, WEBP, SVG), videos (MP4, MOV, AVI, MKV, WEBM),
|
|
115
117
|
# audio (MP3, WAV, OGG, AAC), documents (PDF, DOC, DOCX)
|
|
118
|
+
|
|
119
|
+
# Workflow: Upload → Extract URL → Use in post
|
|
120
|
+
VIDEO=$(postiz upload video.mp4)
|
|
121
|
+
VIDEO_PATH=$(echo "$VIDEO" | jq -r '.path')
|
|
122
|
+
postiz posts:create -c "Content" -s "2024-12-31T12:00:00Z" -m "$VIDEO_PATH" -i "tiktok-id"
|
|
116
123
|
```
|
|
117
124
|
|
|
118
125
|
---
|
|
@@ -455,21 +462,29 @@ postiz posts:create \
|
|
|
455
462
|
|
|
456
463
|
### YouTube
|
|
457
464
|
```bash
|
|
465
|
+
# Upload video first (required!)
|
|
466
|
+
VIDEO=$(postiz upload video.mp4)
|
|
467
|
+
VIDEO_URL=$(echo "$VIDEO" | jq -r '.path')
|
|
468
|
+
|
|
458
469
|
postiz posts:create \
|
|
459
470
|
-c "Video description" \
|
|
460
471
|
-s "2024-12-31T12:00:00Z" \
|
|
461
472
|
--settings '{"title":"Video Title","type":"public","tags":[{"value":"tech","label":"Tech"}]}' \
|
|
462
|
-
-m "
|
|
473
|
+
-m "$VIDEO_URL" \
|
|
463
474
|
-i "youtube-id"
|
|
464
475
|
```
|
|
465
476
|
|
|
466
477
|
### TikTok
|
|
467
478
|
```bash
|
|
479
|
+
# Upload video first (TikTok only accepts verified URLs!)
|
|
480
|
+
VIDEO=$(postiz upload video.mp4)
|
|
481
|
+
VIDEO_URL=$(echo "$VIDEO" | jq -r '.path')
|
|
482
|
+
|
|
468
483
|
postiz posts:create \
|
|
469
484
|
-c "Video caption #fyp" \
|
|
470
485
|
-s "2024-12-31T12:00:00Z" \
|
|
471
486
|
--settings '{"privacy":"PUBLIC_TO_EVERYONE","duet":true,"stitch":true}' \
|
|
472
|
-
-m "
|
|
487
|
+
-m "$VIDEO_URL" \
|
|
473
488
|
-i "tiktok-id"
|
|
474
489
|
```
|
|
475
490
|
|
|
@@ -497,20 +512,27 @@ postiz posts:create \
|
|
|
497
512
|
|
|
498
513
|
### Instagram
|
|
499
514
|
```bash
|
|
515
|
+
# Upload image first (Instagram requires verified URLs!)
|
|
516
|
+
IMAGE=$(postiz upload image.jpg)
|
|
517
|
+
IMAGE_URL=$(echo "$IMAGE" | jq -r '.path')
|
|
518
|
+
|
|
500
519
|
# Regular post
|
|
501
520
|
postiz posts:create \
|
|
502
521
|
-c "Caption #hashtag" \
|
|
503
522
|
-s "2024-12-31T12:00:00Z" \
|
|
504
523
|
--settings '{"post_type":"post"}' \
|
|
505
|
-
-m "
|
|
524
|
+
-m "$IMAGE_URL" \
|
|
506
525
|
-i "instagram-id"
|
|
507
526
|
|
|
508
527
|
# Story
|
|
528
|
+
STORY=$(postiz upload story.jpg)
|
|
529
|
+
STORY_URL=$(echo "$STORY" | jq -r '.path')
|
|
530
|
+
|
|
509
531
|
postiz posts:create \
|
|
510
532
|
-c "" \
|
|
511
533
|
-s "2024-12-31T12:00:00Z" \
|
|
512
534
|
--settings '{"post_type":"story"}' \
|
|
513
|
-
-m "
|
|
535
|
+
-m "$STORY_URL" \
|
|
514
536
|
-i "instagram-id"
|
|
515
537
|
```
|
|
516
538
|
|
|
@@ -545,9 +567,9 @@ postiz posts:create \
|
|
|
545
567
|
1. **API Key not set** - Always `export POSTIZ_API_KEY=key` before using CLI
|
|
546
568
|
2. **Invalid integration ID** - Run `integrations:list` to get current IDs
|
|
547
569
|
3. **Settings schema mismatch** - Check `integrations:settings` for required fields
|
|
548
|
-
4. **Media
|
|
570
|
+
4. **Media MUST be uploaded to Postiz first** - ⚠️ **CRITICAL:** TikTok, Instagram, YouTube, and many platforms only accept verified URLs. Upload files via `postiz upload` first, then use the returned URL in `-m`. External URLs will be rejected!
|
|
549
571
|
5. **JSON escaping in shell** - Use single quotes for JSON: `--settings '{...}'`
|
|
550
|
-
6. **Date format** - Must be ISO 8601: `"2024-12-31T12:00:00Z"`
|
|
572
|
+
6. **Date format** - Must be ISO 8601: `"2024-12-31T12:00:00Z"` and is REQUIRED
|
|
551
573
|
7. **Tool not found** - Check available tools in `integrations:settings` output
|
|
552
574
|
8. **Character limits** - Each platform has different limits, check `maxLength` in settings
|
|
553
575
|
9. **Required settings** - Some platforms require specific settings (Reddit needs title, YouTube needs title)
|