$npx -y skills add gitroomhq/postiz-agent --skill postiz-agentPostiz is a tool to schedule social media and chat posts to 28+ channels X, LinkedIn, LinkedIn Page, Reddit, Instagram, Facebook Page, Threads, YouTube, Google My Business, TikTok, Pinterest, Dribbble, Discord, Slack, Kick, Twitch, Mastodon, Bluesky, Lemmy, Farcaster, Telegram, N
| 1 | ## Install Postiz if it doesn't exist |
| 2 | |
| 3 | ```bash |
| 4 | npm install -g postiz |
| 5 | # or |
| 6 | pnpm install -g postiz |
| 7 | ``` |
| 8 | |
| 9 | npm release: https://www.npmjs.com/package/postiz |
| 10 | postiz github: https://github.com/gitroomhq/postiz-app |
| 11 | postiz cli github: https://github.com/gitroomhq/postiz-app |
| 12 | official website: https://postiz.com |
| 13 | --- |
| 14 | |
| 15 | |
| 16 | | Property | Value | |
| 17 | |----------|-------| |
| 18 | | **name** | postiz | |
| 19 | | **description** | Social media automation CLI for scheduling posts across 28+ platforms | |
| 20 | | **allowed-tools** | Bash(postiz:*) | |
| 21 | |
| 22 | --- |
| 23 | |
| 24 | ## ⚠️ Two Hard Rules (Read First) |
| 25 | |
| 26 | **Rule 1 — Authenticate before anything.** All commands fail without valid credentials. |
| 27 | |
| 28 | **Rule 2 — Every file passed to `-m` (or to `image`/media fields in JSON mode) MUST first go through `postiz upload`.** Raw filesystem paths (`image.jpg`, `video.mp4`) and external URLs (`https://example.com/...`) are **NOT** accepted by the publishing pipeline. TikTok, Instagram, YouTube, and most other providers reject anything that isn't a Postiz-verified URL. Always: |
| 29 | |
| 30 | ```bash |
| 31 | RESULT=$(postiz upload <file>) |
| 32 | URL=$(echo "$RESULT" | jq -r '.path') |
| 33 | postiz posts:create ... -m "$URL" ... |
| 34 | ``` |
| 35 | |
| 36 | If you see `-m "something.jpg"` anywhere below, treat it as shorthand for "the `.path` you got back from `postiz upload something.jpg`" — never a raw local file. |
| 37 | |
| 38 | --- |
| 39 | |
| 40 | ## ⚠️ Authentication Required |
| 41 | |
| 42 | **You MUST authenticate before running any Postiz CLI command.** All commands will fail without valid credentials. |
| 43 | |
| 44 | Before doing anything else, check auth status: |
| 45 | ```bash |
| 46 | postiz auth:status |
| 47 | ``` |
| 48 | |
| 49 | If not authenticated, either: |
| 50 | 1. **OAuth2:** `postiz auth:login` |
| 51 | 2. **API Key:** `export POSTIZ_API_KEY=your_api_key` |
| 52 | |
| 53 | **Do NOT proceed with any other commands until authentication is confirmed.** |
| 54 | |
| 55 | --- |
| 56 | |
| 57 | ## Core Workflow |
| 58 | |
| 59 | The fundamental pattern for using Postiz CLI: |
| 60 | |
| 61 | 1. **Authenticate** - Verify or set up authentication (see above) |
| 62 | 2. **Discover** - List integrations and get their settings |
| 63 | 3. **Fetch** - Use integration tools to retrieve dynamic data (flairs, playlists, companies) |
| 64 | 4. **Prepare** - Upload media files if needed |
| 65 | 5. **Post** - Create posts with content, media, and platform-specific settings |
| 66 | 6. **Analyze** - Track performance with platform and post-level analytics |
| 67 | 7. **Resolve** - If analytics returns `{"missing": true}`, run `posts:missing` to list provider content, then `posts:connect` to link it |
| 68 | |
| 69 | ```bash |
| 70 | # 1. Authenticate |
| 71 | postiz auth:status |
| 72 | # If not authenticated: postiz auth:login --client-id <id> --client-secret <secret> |
| 73 | |
| 74 | # 2. Discover |
| 75 | postiz integrations:list |
| 76 | postiz integrations:settings <integration-id> |
| 77 | |
| 78 | # 3. Fetch (if needed) |
| 79 | postiz integrations:trigger <integration-id> <method> -d '{"key":"value"}' |
| 80 | |
| 81 | # 4. Prepare |
| 82 | postiz upload image.jpg |
| 83 | |
| 84 | # 5. Post |
| 85 | postiz posts:create -c "Content" -m "image.jpg" -i "<integration-id>" |
| 86 | |
| 87 | # 6. Analyze |
| 88 | postiz analytics:platform <integration-id> -d 30 |
| 89 | postiz analytics:post <post-id> -d 7 |
| 90 | |
| 91 | # 7. Resolve (if analytics returns {"missing": true}) |
| 92 | postiz posts:missing <post-id> |
| 93 | postiz posts:connect <post-id> --release-id "<content-id>" |
| 94 | ``` |
| 95 | |
| 96 | --- |
| 97 | |
| 98 | ## Essential Commands |
| 99 | |
| 100 | ### Authentication |
| 101 | |
| 102 | **Option 1: OAuth2 (Recommended)** |
| 103 | ```bash |
| 104 | # Login via device flow (opens browser, no client ID/secret needed) |
| 105 | postiz auth:login |
| 106 | |
| 107 | # Check auth status (verifies credentials are still valid) |
| 108 | postiz auth:status |
| 109 | |
| 110 | # Logout (remove stored credentials) |
| 111 | postiz auth:logout |
| 112 | ``` |
| 113 | |
| 114 | Credentials are stored in `~/.postiz/credentials.json`. OAuth2 credentials take priority over API key. |
| 115 | |
| 116 | **Option 2: API Key** |
| 117 | ```bash |
| 118 | export POSTIZ_API_KEY=your_api_key_here |
| 119 | ``` |
| 120 | |
| 121 | **Optional custom API URL:** |
| 122 | ```bash |
| 123 | export POSTIZ_API_URL=https://custom-api-url.com |
| 124 | ``` |
| 125 | |
| 126 | ### Integration Discovery |
| 127 | |
| 128 | ```bash |
| 129 | # List all connected integrations |
| 130 | postiz integrations:list |
| 131 | |
| 132 | # List integrations belonging to a specific group (customer) |
| 133 | postiz integrations:list --group <group-id> |
| 134 | |
| 135 | # List all groups (customers) as {id, name} |
| 136 | postiz integrations:groups |
| 137 | |
| 138 | # Get settings schema for specific integration |
| 139 | postiz integrations:settings <integration-id> |
| 140 | |
| 141 | # Trigger integration tool to fetch dynamic data |
| 142 | postiz integrations:trigger <integration-id> <method-name> |
| 143 | postiz integrations:trigger <integration-id> <method-name> -d '{"param":"value"}' |
| 144 | ``` |
| 145 | |
| 146 | ### Creating Posts |
| 147 | |
| 148 | ```bash |
| 149 | # Simple post (date is REQUIRED) |
| 150 | postiz posts:create -c "Content" -s "2024-12-31T12:00:00Z" -i "integration-id" |
| 151 | |
| 152 | # Draft post |
| 153 | postiz posts:create -c "Content" -s "2024-12-31T12:00:00Z" -t draft -i "integration-id" |
| 154 | |
| 155 | # Post with media (upload each file FIRST — see Rule 2) |
| 156 | IMG1=$( |