Postiz 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, Nostr, VK, Medium, Dev.to, Hashnode, WordPress, ListMonk
$npx -y skills add gitroomhq/postiz-agent --skill postiz-agentInstalls into the current project.
Run `npx skills use "https://github.com/gitroomhq/postiz-agent" --skill "gitroomhq/postiz-agent"` and follow the generated skill instructions now. Read its complete output, redirecting it to a temporary file first if necessary. Resolve relative paths from the supporting-files directory it provides.
Use the skills in "https://github.com/gitroomhq/postiz-agent" that are relevant to the current task. Run `npx skills add "https://github.com/gitroomhq/postiz-agent"` and select the relevant skills, then follow their instructions.
| 1 | ## Install as a skill |
| 2 | |
| 3 | ```bash |
| 4 | npx skills add gitroomhq/postiz-agent |
| 5 | ``` |
| 6 | |
| 7 | # Postiz CLI |
| 8 | |
| 9 | **Social media automation CLI for AI agents** - Schedule posts across 28+ platforms programmatically. |
| 10 | |
| 11 | The Postiz CLI provides a command-line interface to the Postiz API, enabling developers and AI agents to automate social media posting, manage content, and handle media uploads across platforms like Twitter/X, LinkedIn, Reddit, YouTube, TikTok, Instagram, Facebook, and more. |
| 12 | |
| 13 | --- |
| 14 | |
| 15 | ## Installation |
| 16 | |
| 17 | ### From npm (Recommended) |
| 18 | |
| 19 | ```bash |
| 20 | npm install -g postiz |
| 21 | # or |
| 22 | pnpm install -g postiz |
| 23 | ``` |
| 24 | |
| 25 | --- |
| 26 | |
| 27 | ## Authentication |
| 28 | |
| 29 | ### Option 1: OAuth2 (Recommended) |
| 30 | |
| 31 | Authenticate using the device flow — no client ID or secret needed: |
| 32 | |
| 33 | ```bash |
| 34 | postiz auth:login |
| 35 | ``` |
| 36 | |
| 37 | This will: |
| 38 | 1. Display a one-time code in your terminal |
| 39 | 2. Open your browser to authorize |
| 40 | 3. Automatically save credentials to `~/.postiz/credentials.json` |
| 41 | |
| 42 | ```bash |
| 43 | # Check current auth status (verifies credentials are still valid) |
| 44 | postiz auth:status |
| 45 | |
| 46 | # Remove stored credentials |
| 47 | postiz auth:logout |
| 48 | ``` |
| 49 | |
| 50 | #### Self-Hosting the Auth Server |
| 51 | |
| 52 | By default, `postiz auth:login` uses the hosted auth server at `cli-auth.postiz.com`. If you want to self-host the OAuth2 device flow server, follow the guide in [`server/SERVER.md`](./server/SERVER.md). |
| 53 | |
| 54 | ### Option 2: API Key |
| 55 | |
| 56 | ```bash |
| 57 | export POSTIZ_API_KEY=your_api_key_here |
| 58 | ``` |
| 59 | |
| 60 | **Optional:** Custom API endpoint |
| 61 | |
| 62 | ```bash |
| 63 | export POSTIZ_API_URL=https://your-custom-api.com |
| 64 | ``` |
| 65 | |
| 66 | > **Note:** OAuth2 credentials take priority over the API key when both are present. |
| 67 | |
| 68 | --- |
| 69 | |
| 70 | ## Commands |
| 71 | |
| 72 | ### Discovery & Settings |
| 73 | |
| 74 | **List all connected integrations** |
| 75 | ```bash |
| 76 | postiz integrations:list |
| 77 | postiz integrations:list --group "customer-id" |
| 78 | ``` |
| 79 | |
| 80 | Returns integration IDs, provider names, and metadata. Use `--group` to return only the channels assigned to a specific group (customer). |
| 81 | |
| 82 | **List all groups (customers)** |
| 83 | ```bash |
| 84 | postiz integrations:groups |
| 85 | ``` |
| 86 | |
| 87 | Returns all groups (customers) for your organization as `{id, name}`. Use a group's `id` with `integrations:list --group` to filter channels. |
| 88 | |
| 89 | **Get integration settings schema** |
| 90 | ```bash |
| 91 | postiz integrations:settings <integration-id> |
| 92 | ``` |
| 93 | |
| 94 | Returns character limits, required settings, and available tools for fetching dynamic data. |
| 95 | |
| 96 | **Trigger integration tools** |
| 97 | ```bash |
| 98 | postiz integrations:trigger <integration-id> <method-name> |
| 99 | postiz integrations:trigger <integration-id> <method-name> -d '{"key":"value"}' |
| 100 | ``` |
| 101 | |
| 102 | Fetch dynamic data like Reddit flairs, YouTube playlists, LinkedIn companies, etc. |
| 103 | |
| 104 | **Examples:** |
| 105 | ```bash |
| 106 | # Get Reddit flairs |
| 107 | postiz integrations:trigger reddit-123 getFlairs -d '{"subreddit":"programming"}' |
| 108 | |
| 109 | # Get YouTube playlists |
| 110 | postiz integrations:trigger youtube-456 getPlaylists |
| 111 | |
| 112 | # Get LinkedIn companies |
| 113 | postiz integrations:trigger linkedin-789 getCompanies |
| 114 | ``` |
| 115 | |
| 116 | --- |
| 117 | |
| 118 | ### Creating Posts |
| 119 | |
| 120 | **Simple scheduled post** |
| 121 | ```bash |
| 122 | postiz posts:create -c "Content" -s "2024-12-31T12:00:00Z" -i "integration-id" |
| 123 | ``` |
| 124 | |
| 125 | **Draft post** |
| 126 | ```bash |
| 127 | postiz posts:create -c "Content" -s "2024-12-31T12:00:00Z" -t draft -i "integration-id" |
| 128 | ``` |
| 129 | |
| 130 | **Post with media** |
| 131 | ```bash |
| 132 | postiz posts:create -c "Content" -m "img1.jpg,img2.jpg" -s "2024-12-31T12:00:00Z" -i "integration-id" |
| 133 | ``` |
| 134 | |
| 135 | **Post with comments** (each comment can have its own media) |
| 136 | ```bash |
| 137 | postiz posts:create \ |
| 138 | -c "Main post" -m "main.jpg" \ |
| 139 | -c "First comment" -m "comment1.jpg" \ |
| 140 | -c "Second comment" -m "comment2.jpg,comment3.jpg" \ |
| 141 | -s "2024-12-31T12:00:00Z" \ |
| 142 | -i "integration-id" |
| 143 | ``` |
| 144 | |
| 145 | **Multi-platform post** |
| 146 | ```bash |
| 147 | postiz posts:create -c "Content" -s "2024-12-31T12:00:00Z" -i "twitter-id,linkedin-id,facebook-id" |
| 148 | ``` |
| 149 | |
| 150 | **Platform-specific settings** |
| 151 | ```bash |
| 152 | postiz posts:create \ |
| 153 | -c "Content" \ |
| 154 | -s "2024-12-31T12:00:00Z" \ |
| 155 | --settings '{"subreddit":[{"value":{"subreddit":"programming","title":"Post Title","type":"text"}}]}' \ |
| 156 | -i "reddit-id" |
| 157 | ``` |
| 158 | |
| 159 | **Complex post from JSON file** |
| 160 | ```bash |
| 161 | postiz posts:create --json post.json |
| 162 | ``` |
| 163 | |
| 164 | **Options:** |
| 165 | - `-c, --content` - Post/comment content (use multiple times for posts with comments) |
| 166 | - `-s, --date` - Schedule date in ISO 8601 format (REQUIRED) |
| 167 | - `-t, --type` - Post type: "schedule" or "draft" (default: "schedule") |
| 168 | - `-m, --media` - Comma-separated media URLs for corresponding `-c` |
| 169 | - `-i, --integrations` - Comma-separated integration IDs (required) |
| 170 | - `-d, --delay` - Delay between comments in minutes (default: 0) |
| 171 | - `--settings` - Platform-specific settings as JSON string |
| 172 | - `-j, --json` - Path to JSON file with full post structure |
| 173 | - `--shortLink` - Use short links (default: true) |
| 174 | |
| 175 | --- |
| 176 | |
| 177 | ### Managing Posts |
| 178 | |
| 179 | **List posts** |
| 180 | ```bash |
| 181 | postiz posts:list |
| 182 | postiz posts:list --startDate "2024-01-01T00:00:00Z" --endDate "2024-12-31T23:59:59Z" |
| 183 | postiz posts:list --customer "customer-id" |
| 184 | ``` |
| 185 | |
| 186 | Defaults to last 30 days to next 30 days if dates not specified. |
| 187 | |
| 188 | **Delete post** |
| 189 | ```bash |
| 190 | postiz posts:delete <post-id> |
| 191 | ``` |
| 192 | |
| 193 | **Change post status (draft ↔ schedule)** |
| 194 | ```bash |
| 195 | postiz posts:status <post-id> --status draft |
| 196 | postiz posts:status <post-id> --status schedule |