{
  "markdown": "<p align=\"center\">\n  <img src=\"assets/logo.svg\" alt=\"Postiz\" width=\"96\" />\n</p>\n\n## Install as a skill\n\n```bash\nnpx skills add gitroomhq/postiz-agent\n```\n\n### Claude Code plugin\n\n```bash\n/plugin marketplace add gitroomhq/postiz-agent\n/plugin install postiz@postiz-agent\n```\n\n### Grok Build plugin\n\nPostiz is listed in the [xAI plugin marketplace](https://github.com/xai-org/plugin-marketplace) — install it from the marketplace inside Grok Build. This repo also carries its own `.grok-plugin/plugin.json` manifest and `.grok-plugin/marketplace.json` catalog, so it can be added as a marketplace source directly.\n\nThe Grok plugin also bundles the hosted Postiz MCP server (`https://mcp.postiz.com/mcp-oauth-dynamic`) via the `mcpServers` field in `.grok-plugin/plugin.json` — you'll be asked to sign in to Postiz on first connection; no token or local install needed. The Claude Code and Cursor plugins are skill/CLI-only and do not register an MCP server.\n\n### Cursor plugin\n\nThis repo ships a [Cursor plugin](https://cursor.com/docs/reference/plugins) manifest at `.cursor-plugin/plugin.json`.\n\n- **From the marketplace / Customize panel:** open **Customize** in the Cursor sidebar, find **postiz**, and select **Install** (project or user scope).\n- **Local install (development):**\n\n  ```bash\n  git clone https://github.com/gitroomhq/postiz-agent.git\n  ln -s \"$(pwd)/postiz-agent\" ~/.cursor/plugins/local/postiz\n  ```\n\n  then restart Cursor or run **Developer: Reload Window**.\n\nThe plugin exposes the `postiz` skill, which drives the `postiz` CLI (the CLI handles media uploads, which is required for image/video posts). Make sure the CLI is installed (`npm install -g postiz`) and authenticated (`postiz auth:login` or `export POSTIZ_API_KEY=...`) before asking the agent to post.\n\n# Postiz CLI\n\n**Social media automation CLI for AI agents** - Schedule posts across 28+ platforms programmatically.\n\nThe 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.\n\n---\n\n## Installation\n\n### From npm (Recommended)\n\n```bash\nnpm install -g postiz\n# or\npnpm install -g postiz\n```\n\n---\n\n## Authentication\n\n### Option 1: OAuth2 (Recommended)\n\nAuthenticate using the device flow — no client ID or secret needed:\n\n```bash\npostiz auth:login\n```\n\nThis will:\n1. Display a one-time code in your terminal\n2. Open your browser to authorize\n3. Automatically save credentials to `~/.postiz/credentials.json`\n\n```bash\n# Check current auth status (verifies credentials are still valid)\npostiz auth:status\n\n# Remove stored credentials\npostiz auth:logout\n```\n\n#### Self-Hosting the Auth Server\n\nBy 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).\n\n### Option 2: API Key\n\n```bash\nexport POSTIZ_API_KEY=your_api_key_here\n```\n\n**Optional:** Custom API endpoint\n\n```bash\nexport POSTIZ_API_URL=https://your-custom-api.com\n```\n\n> **Note:** OAuth2 credentials take priority over the API key when both are present.\n\n---\n\n## Commands\n\n### Discovery & Settings\n\n**List all connected integrations**\n```bash\npostiz integrations:list\npostiz integrations:list --group \"customer-id\"\n```\n\nReturns integration IDs, provider names, and metadata. Use `--group` to return only the channels assigned to a specific group (customer).\n\n**List all groups (customers)**\n```bash\npostiz integrations:groups\n```\n\nReturns all groups (customers) for your organization as `{id, name}`. Use a group's `id` with `integrations:list --group` to filter channels.\n\n**Get integration settings schema**\n```bash\npostiz integrations:settings <integration-id>\n```\n\nReturns character limits, required settings, and available tools for fetching dynamic data.\n\n**Trigger integration tools**\n```bash\npostiz integrations:trigger <integration-id> <method-name>\npostiz integrations:trigger <integration-id> <method-name> -d '{\"key\":\"value\"}'\n```\n\nFetch dynamic data like Reddit flairs, YouTube playlists, LinkedIn companies, etc.\n\n**Examples:**\n```bash\n# Get Reddit flairs\npostiz integrations:trigger reddit-123 getFlairs -d '{\"subreddit\":\"programming\"}'\n\n# Get YouTube playlists\npostiz integrations:trigger youtube-456 getPlaylists\n\n# Get LinkedIn companies\npostiz integrations:trigger linkedin-789 getCompanies\n```\n\n---\n\n### Creating Posts\n\n**Simple scheduled post**\n```bash\npostiz posts:create -c \"Content\" -s \"2024-12-31T12:00:00Z\" -i \"integration-id\"\n```\n\n**Draft post**\n```bash\npostiz posts:create -c \"Content\" -s \"2024-12-31T12:00:00Z\" -t draft -i \"integration-id\"\n```\n\n**Post with media**\n```bash\npostiz posts:create -c \"Content\" -m \"img1.jpg,img2.jpg\" -s \"2024-12-31T12:00:00Z\" -i \"integration-id\"\n```\n\n**Post with comments** (each comment can have its own media)\n```bash\npostiz posts:create \\\n  -c \"Main post\" -m \"main.jpg\" \\\n  -c \"First comment\" -m \"comment1.jpg\" \\\n  -c \"Second comment\" -m \"comment2.jpg,comment3.jpg\" \\\n  -s \"2024-12-31T12:00:00Z\" \\\n  -i \"integration-id\"\n```\n\n**Multi-platform post**\n```bash\npostiz posts:create -c \"Content\" -s \"2024-12-31T12:00:00Z\" -i \"twitter-id,linkedin-id,facebook-id\"\n```\n\n**Platform-specific settings**\n```bash\npostiz posts:create \\\n  -c \"Content\" \\\n  -s \"2024-12-31T12:00:00Z\" \\\n  --settings '{\"subreddit\":[{\"value\":{\"subreddit\":\"programming\",\"title\":\"Post Title\",\"type\":\"text\"}}]}' \\\n  -i \"reddit-id\"\n```\n\n**Complex post from JSON file**\n```bash\npostiz posts:create --json post.json\n```\n\n**Options:**\n- `-c, --content` - Post/comment content (use multiple times for posts with comments)\n- `-s, --date` - Schedule date in ISO 8601 format (REQUIRED)\n- `-t, --type` - Post type: \"schedule\" or \"draft\" (default: \"schedule\")\n- `-m, --media` - Comma-separated media URLs for corresponding `-c`\n- `-i, --integrations` - Comma-separated integration IDs (required)\n- `-d, --delay` - Delay between comments in minutes (default: 0)\n- `--settings` - Platform-specific settings as JSON string\n- `-j, --json` - Path to JSON file with full post structure\n- `--shortLink` - Use short links (default: true)\n\n---\n\n### Managing Posts\n\n**List posts**\n```bash\npostiz posts:list\npostiz posts:list --startDate \"2024-01-01T00:00:00Z\" --endDate \"2024-12-31T23:59:59Z\"\npostiz posts:list --customer \"customer-id\"\n```\n\nDefaults to last 30 days to next 30 days if dates not specified. Each returned post includes its current `settings` (returned as a JSON string — `JSON.parse` it). The intended workflow is `posts:list` (read current settings) → `posts:settings` (patch them).\n\n**Delete post**\n```bash\npostiz posts:delete <post-id>\n```\n\n**Change post status (draft ↔ schedule)**\n```bash\npostiz posts:status <post-id> --status draft\npostiz posts:status <post-id> --status schedule\n```\n\nMove a scheduled post back to a draft, or promote a draft into the publishing queue. Switching to `draft` also terminates any workflow that's already running for the post, so it won't publish. Switching to `schedule` queues the post for publishing at its stored date.\n\n**Update a post's provider-specific settings**\n```bash\npostiz posts:settings <post-id> --settings '{\"content_posting_method\":\"DIRECT_POST\"}'\npostiz posts:settings <post-id> --settings '{\"subreddit\":[{\"value\":{\"subreddit\":\"/r/selfhosted\",\"title\":\"My title\",\"type\":\"self\",\"is_flair_required\":true}}]}'\n```\n\nPatches a post's settings server-side. The backend **merges** the object — only the keys you pass change, everything else is preserved — so pass a partial object, not the full settings blob. Only **DRAFT/QUEUE** (unpublished) posts can be updated; published posts are rejected. Pass the **main post id**, not a comment id. Do **not** include `__type` — the backend adds it automatically from the integration.\n\n---\n\n### Analytics\n\n**Get platform analytics**\n```bash\npostiz analytics:platform <integration-id>\npostiz analytics:platform <integration-id> -d 30\n```\n\nReturns metrics like followers, impressions, and engagement over time for a specific integration/channel. The `-d` flag specifies the number of days to look back (default: 7).\n\n**Get post analytics**\n```bash\npostiz analytics:post <post-id>\npostiz analytics:post <post-id> -d 30\n```\n\nReturns metrics like likes, comments, shares, and impressions for a specific published post.\n\n**⚠️ If `analytics:post` returns `{\"missing\": true}`**, the post was published but the platform didn't return a usable post ID. You must resolve this before analytics will work:\n\n```bash\n# 1. List available content from the provider\npostiz posts:missing <post-id>\n\n# 2. Connect the correct content to the post\npostiz posts:connect <post-id> --release-id \"7321456789012345678\"\n\n# 3. Analytics will now work\npostiz analytics:post <post-id>\n```\n\n---\n\n### Connecting Missing Posts\n\nSome platforms (e.g. TikTok) don't return a post ID immediately after publishing. The post's `releaseId` is set to `\"missing\"` and analytics won't work until resolved.\n\n**List available content from the provider**\n```bash\npostiz posts:missing <post-id>\n```\n\nReturns an array of `{id, url}` items representing recent content from the provider. Returns an empty array if the provider doesn't support this feature.\n\n**Connect a post to its published content**\n```bash\npostiz posts:connect <post-id> --release-id \"<content-id>\"\n```\n\n---\n\n### Media Upload\n\n**Upload file and get URL**\n```bash\npostiz upload <file-path>\n```\n\n**⚠️ IMPORTANT: Upload Files Before Posting**\n\nYou **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.\n\n**Workflow:**\n1. Upload your file using `postiz upload`\n2. Extract the returned URL\n3. Use that URL in your post's `-m` parameter\n\n**Supported formats:**\n- **Images:** PNG, JPG, JPEG, GIF\n- **Videos:** MP4\n\n**Example:**\n```bash\n# 1. Upload the file first\nRESULT=$(postiz upload video.mp4)\nPATH=$(echo \"$RESULT\" | jq -r '.path')\n\n# 2. Use the Postiz URL in your post\npostiz posts:create -c \"Check out my video!\" -s \"2024-12-31T12:00:00Z\" -m \"$PATH\" -i \"tiktok-id\"\n```\n\n**Why this is required:**\n- **TikTok, Instagram, YouTube** only accept URLs from trusted domains\n- **Security:** Platforms verify media sources to prevent abuse\n- **Reliability:** Postiz ensures your media is always accessible\n\n---\n\n## Platform-Specific Features\n\n### Reddit\n```bash\n# Get available flairs\npostiz integrations:trigger reddit-id getFlairs -d '{\"subreddit\":\"programming\"}'\n\n# Post with subreddit and flair\npostiz posts:create \\\n  -c \"Content\" \\\n  -s \"2024-12-31T12:00:00Z\" \\\n  --settings '{\"subreddit\":[{\"value\":{\"subreddit\":\"programming\",\"title\":\"My Post\",\"type\":\"text\",\"is_flair_required\":true,\"flair\":{\"id\":\"flair-123\",\"name\":\"Discussion\"}}}]}' \\\n  -i \"reddit-id\"\n```\n\n### YouTube\n```bash\n# Get playlists\npostiz integrations:trigger youtube-id getPlaylists\n\n# Upload video FIRST (required!)\nVIDEO=$(postiz upload video.mp4)\nVIDEO_URL=$(echo \"$VIDEO\" | jq -r '.path')\n\n# Post with uploaded video URL\npostiz posts:create \\\n  -c \"Video description\" \\\n  -s \"2024-12-31T12:00:00Z\" \\\n  --settings '{\"title\":\"Video Title\",\"type\":\"public\",\"tags\":[{\"value\":\"tech\",\"label\":\"Tech\"}],\"playlistId\":\"playlist-id\"}' \\\n  -m \"$VIDEO_URL\" \\\n  -i \"youtube-id\"\n```\n\n### TikTok\n```bash\n# Upload video FIRST (TikTok only accepts verified URLs!)\nVIDEO=$(postiz upload video.mp4)\nVIDEO_URL=$(echo \"$VIDEO\" | jq -r '.path')\n\n# Post with uploaded video URL\npostiz posts:create \\\n  -c \"Video caption #fyp\" \\\n  -s \"2024-12-31T12:00:00Z\" \\\n  --settings '{\"privacy_level\":\"PUBLIC_TO_EVERYONE\",\"duet\":true,\"stitch\":true,\"content_posting_method\":\"DIRECT_POST\"}' \\\n  -m \"$VIDEO_URL\" \\\n  -i \"tiktok-id\"\n```\n\n### LinkedIn\n```bash\n# Get companies you can post to\npostiz integrations:trigger linkedin-id getCompanies\n\n# Post as company\npostiz posts:create \\\n  -c \"Company announcement\" \\\n  -s \"2024-12-31T12:00:00Z\" \\\n  --settings '{\"companyId\":\"company-123\"}' \\\n  -i \"linkedin-id\"\n```\n\n### X (Twitter)\n```bash\n# Create thread\npostiz posts:create \\\n  -c \"Thread 1/3 🧵\" \\\n  -c \"Thread 2/3\" \\\n  -c \"Thread 3/3\" \\\n  -s \"2024-12-31T12:00:00Z\" \\\n  -d 2000 \\\n  -i \"twitter-id\"\n\n# With reply settings\npostiz posts:create \\\n  -c \"Tweet content\" \\\n  -s \"2024-12-31T12:00:00Z\" \\\n  --settings '{\"who_can_reply_post\":\"everyone\"}' \\\n  -i \"twitter-id\"\n```\n\n### Instagram\n```bash\n# Upload image FIRST (Instagram requires verified URLs!)\nIMAGE=$(postiz upload image.jpg)\nIMAGE_URL=$(echo \"$IMAGE\" | jq -r '.path')\n\n# Regular post\npostiz posts:create \\\n  -c \"Caption #hashtag\" \\\n  -s \"2024-12-31T12:00:00Z\" \\\n  --settings '{\"post_type\":\"post\"}' \\\n  -m \"$IMAGE_URL\" \\\n  -i \"instagram-id\"\n\n# Story (upload first)\nSTORY=$(postiz upload story.jpg)\nSTORY_URL=$(echo \"$STORY\" | jq -r '.path')\n\npostiz posts:create \\\n  -c \"\" \\\n  -s \"2024-12-31T12:00:00Z\" \\\n  --settings '{\"post_type\":\"story\"}' \\\n  -m \"$STORY_URL\" \\\n  -i \"instagram-id\"\n```\n\n**See [PROVIDER_SETTINGS.md](./PROVIDER_SETTINGS.md) for all 28+ platforms.**\n\n---\n\n## Features for AI Agents\n\n### Discovery Workflow\nThe CLI enables dynamic discovery of integration capabilities:\n\n1. **List integrations** - Get available social media accounts\n2. **Get settings** - Retrieve character limits, required fields, and available tools\n3. **Trigger tools** - Fetch dynamic data (flairs, playlists, boards, etc.)\n4. **Create posts** - Use discovered data in posts\n5. **Analyze** - Get post analytics; if `{\"missing\": true}` is returned, resolve with `posts:missing` + `posts:connect`\n\nThis allows AI agents to adapt to different platforms without hardcoded knowledge.\n\n### JSON Mode\nFor complex posts with multiple platforms and settings:\n\n```bash\npostiz posts:create --json complex-post.json\n```\n\nJSON structure:\n```json\n{\n  \"integrations\": [\"twitter-123\", \"linkedin-456\"],\n  \"posts\": [\n    {\n      \"provider\": \"twitter\",\n      \"post\": [\n        {\n          \"content\": \"Tweet version\",\n          \"image\": [\"twitter-image.jpg\"]\n        }\n      ]\n    },\n    {\n      \"provider\": \"linkedin\",\n      \"post\": [\n        {\n          \"content\": \"LinkedIn version with more context...\",\n          \"image\": [\"linkedin-image.jpg\"]\n        }\n      ],\n      \"settings\": {\n        \"__type\": \"linkedin\",\n        \"companyId\": \"company-123\"\n      }\n    }\n  ]\n}\n```\n\n### All Output is JSON\nEvery command outputs JSON for easy parsing:\n\n```bash\nINTEGRATIONS=$(postiz integrations:list | jq -r '.')\nREDDIT_ID=$(echo \"$INTEGRATIONS\" | jq -r '.[] | select(.identifier==\"reddit\") | .id')\n```\n\n### Threading Support\nComments are automatically converted to threads/replies based on platform:\n- **Twitter/X**: Thread of tweets\n- **Reddit**: Comment replies\n- **LinkedIn**: Comment on post\n- **Instagram**: First comment\n\n```bash\npostiz posts:create \\\n  -c \"Main post\" \\\n  -c \"Comment 1\" \\\n  -c \"Comment 2\" \\\n  -i \"integration-id\"\n```\n\n---\n\n## Common Workflows\n\n### Reddit Post with Flair\n```bash\n#!/bin/bash\nREDDIT_ID=$(postiz integrations:list | jq -r '.[] | select(.identifier==\"reddit\") | .id')\nFLAIRS=$(postiz integrations:trigger \"$REDDIT_ID\" getFlairs -d '{\"subreddit\":\"programming\"}')\nFLAIR_ID=$(echo \"$FLAIRS\" | jq -r '.output[0].id')\n\npostiz posts:create \\\n  -c \"My post content\" \\\n  -s \"2024-12-31T12:00:00Z\" \\\n  --settings \"{\\\"subreddit\\\":[{\\\"value\\\":{\\\"subreddit\\\":\\\"programming\\\",\\\"title\\\":\\\"Post Title\\\",\\\"type\\\":\\\"text\\\",\\\"is_flair_required\\\":true,\\\"flair\\\":{\\\"id\\\":\\\"$FLAIR_ID\\\",\\\"name\\\":\\\"Discussion\\\"}}}]}\" \\\n  -i \"$REDDIT_ID\"\n```\n\n### YouTube Video Upload\n```bash\n#!/bin/bash\nVIDEO=$(postiz upload video.mp4)\nVIDEO_PATH=$(echo \"$VIDEO\" | jq -r '.path')\n\npostiz posts:create \\\n  -c \"Video description...\" \\\n  -s \"2024-12-31T12:00:00Z\" \\\n  --settings '{\"title\":\"My Video\",\"type\":\"public\",\"tags\":[{\"value\":\"tech\",\"label\":\"Tech\"}]}' \\\n  -m \"$VIDEO_PATH\" \\\n  -i \"youtube-id\"\n```\n\n### Multi-Platform Campaign\n```bash\n#!/bin/bash\npostiz posts:create \\\n  -c \"Same content everywhere\" \\\n  -s \"2024-12-31T12:00:00Z\" \\\n  -m \"image.jpg\" \\\n  -i \"twitter-id,linkedin-id,facebook-id\"\n```\n\n### Batch Scheduling\n```bash\n#!/bin/bash\nDATES=(\"2024-02-14T09:00:00Z\" \"2024-02-15T09:00:00Z\" \"2024-02-16T09:00:00Z\")\nCONTENT=(\"Monday motivation 💪\" \"Tuesday tips 💡\" \"Wednesday wisdom 🧠\")\n\nfor i in \"${!DATES[@]}\"; do\n  postiz posts:create \\\n    -c \"${CONTENT[$i]}\" \\\n    -s \"${DATES[$i]}\" \\\n    -i \"twitter-id\"\ndone\n```\n\n---\n\n## Documentation\n\n**For AI Agents:**\n- **[SKILL.md](./SKILL.md)** - Complete skill reference with patterns and examples\n\n**Deep-Dive Guides:**\n- **[HOW_TO_RUN.md](./HOW_TO_RUN.md)** - Installation and setup methods\n- **[COMMAND_LINE_GUIDE.md](./COMMAND_LINE_GUIDE.md)** - Complete command syntax reference\n- **[PROVIDER_SETTINGS.md](./PROVIDER_SETTINGS.md)** - All platform settings schemas\n- **[INTEGRATION_TOOLS_WORKFLOW.md](./INTEGRATION_TOOLS_WORKFLOW.md)** - Tools workflow guide\n- **[INTEGRATION_SETTINGS_DISCOVERY.md](./INTEGRATION_SETTINGS_DISCOVERY.md)** - Settings discovery\n- **[SUPPORTED_FILE_TYPES.md](./SUPPORTED_FILE_TYPES.md)** - Media format reference\n- **[PROJECT_STRUCTURE.md](./PROJECT_STRUCTURE.md)** - Code architecture\n- **[PUBLISHING.md](./PUBLISHING.md)** - npm publishing guide\n\n**Examples:**\n- **[examples/EXAMPLES.md](./examples/EXAMPLES.md)** - Comprehensive examples\n- **[examples/](./examples/)** - Ready-to-use scripts and JSON files\n\n---\n\n## API Endpoints\n\nThe CLI interacts with these Postiz API endpoints:\n\n| Endpoint | Method | Purpose |\n|----------|--------|---------|\n| `/public/v1/posts` | POST | Create a post |\n| `/public/v1/posts` | GET | List posts |\n| `/public/v1/posts/:id` | DELETE | Delete a post |\n| `/public/v1/posts/:id/settings` | PUT | Update a post's provider settings (merged; unpublished only) |\n| `/public/v1/posts/:id/missing` | GET | Get missing content from provider |\n| `/public/v1/posts/:id/release-id` | PUT | Update release ID for a post |\n| `/public/v1/integrations` | GET | List integrations (optional `?group=` filter) |\n| `/public/v1/groups` | GET | List groups (customers) |\n| `/public/v1/integration-settings/:id` | GET | Get integration settings |\n| `/public/v1/integration-trigger/:id` | POST | Trigger integration tool |\n| `/public/v1/analytics/:integration` | GET | Get platform analytics |\n| `/public/v1/analytics/post/:postId` | GET | Get post analytics |\n| `/public/v1/upload` | POST | Upload media |\n\n---\n\n## Environment Variables\n\n| Variable | Required | Default | Description |\n|----------|----------|---------|-------------|\n| `POSTIZ_API_KEY` | No* | - | Your Postiz API key |\n| `POSTIZ_API_URL` | No | `https://api.postiz.com` | Custom API endpoint |\n| `POSTIZ_AUTH_SERVER` | No | `https://cli-auth.postiz.com` | Custom auth server URL |\n\n*Either OAuth2 (via `postiz auth:login`) or `POSTIZ_API_KEY` is required.\n\n---\n\n## Error Handling\n\nThe CLI provides clear error messages with exit codes:\n\n- **Exit code 0**: Success\n- **Exit code 1**: Error occurred\n\n**Common errors:**\n\n| Error | Solution |\n|-------|----------|\n| `Not authenticated` | Run `postiz auth:login` or set `POSTIZ_API_KEY` |\n| `Integration not found` | Run `integrations:list` to get valid IDs |\n| `startDate/endDate required` | Use ISO 8601 format: `\"2024-12-31T12:00:00Z\"` |\n| `Invalid settings` | Check `integrations:settings` for required fields |\n| `Tool not found` | Check available tools in `integrations:settings` output |\n| `Upload failed` | Verify file exists and format is supported |\n| `analytics:post` returns `{\"missing\": true}` | Run `posts:missing <id>` then `posts:connect <id> --release-id \"<rid>\"` |\n\n---\n\n## Development\n\n### Project Structure\n\n```\nsrc/\n├── index.ts              # CLI entry point with yargs\n├── api.ts                # PostizAPI client class\n├── config.ts             # Configuration (OAuth2 + API key)\n└── commands/\n    ├── auth.ts           # OAuth2 authentication (login/logout/status)\n    ├── posts.ts          # Post management commands\n    ├── integrations.ts   # Integration commands\n    ├── analytics.ts      # Analytics commands\n    └── upload.ts         # Media upload command\nexamples/                 # Example scripts and JSON files\npackage.json\ntsconfig.json\ntsup.config.ts            # Build configuration\nREADME.md                 # This file\nSKILL.md                  # AI agent reference\n```\n\n### Scripts\n\n```bash\npnpm run dev       # Watch mode for development\npnpm run build     # Build the CLI\npnpm run start     # Run the built CLI\n```\n\n### Building\n\nThe CLI uses `tsup` for bundling:\n\n```bash\npnpm run build\n```\n\nOutput in `dist/`:\n- `index.js` - Bundled executable with shebang\n- `index.js.map` - Source map\n\n---\n\n## Quick Reference\n\n```bash\n# Authentication\npostiz auth:login                                              # OAuth2 device flow\npostiz auth:status                                             # Check auth\npostiz auth:logout                                             # Remove credentials\nexport POSTIZ_API_KEY=your_key                                 # Or use API key\n\n# Discovery\npostiz integrations:list                           # List integrations\npostiz integrations:list --group \"<group-id>\"      # List integrations in a group\npostiz integrations:groups                         # List groups (customers)\npostiz integrations:settings <id>                  # Get settings\npostiz integrations:trigger <id> <method> -d '{}'  # Fetch data\n\n# Posting (date is required)\npostiz posts:create -c \"text\" -s \"2024-12-31T12:00:00Z\" -i \"id\"                    # Simple\npostiz posts:create -c \"text\" -s \"2024-12-31T12:00:00Z\" -t draft -i \"id\"          # Draft\npostiz posts:create -c \"text\" -m \"img.jpg\" -s \"2024-12-31T12:00:00Z\" -i \"id\"      # With media\npostiz posts:create -c \"main\" -c \"comment\" -s \"2024-12-31T12:00:00Z\" -i \"id\"      # With comment\npostiz posts:create -c \"text\" -s \"2024-12-31T12:00:00Z\" --settings '{}' -i \"id\"   # Platform-specific\npostiz posts:create --json file.json                                               # Complex\n\n# Management\npostiz posts:list                                  # List posts\npostiz posts:delete <id>                          # Delete post\npostiz posts:status <id> --status draft           # Move to draft (stops workflow)\npostiz posts:status <id> --status schedule        # Queue draft for publishing\npostiz posts:settings <id> --settings '{}'        # Patch a post's settings (merged; DRAFT/QUEUE only)\npostiz upload <file>                              # Upload media\n\n# Analytics\npostiz analytics:platform <id>                    # Platform analytics (7 days)\npostiz analytics:platform <id> -d 30             # Platform analytics (30 days)\npostiz analytics:post <id>                        # Post analytics (7 days)\npostiz analytics:post <id> -d 30                 # Post analytics (30 days)\n# If analytics:post returns {\"missing\": true}, resolve it:\npostiz posts:missing <id>                         # List provider content\npostiz posts:connect <id> --release-id \"<rid>\"    # Connect content to post\n\n# Help\npostiz --help                                     # Show help\npostiz posts:create --help                        # Command help\n```\n\n---\n\n## Contributing\n\nThis CLI is part of the [Postiz monorepo](https://github.com/gitroomhq/postiz-app).\n\nTo contribute:\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes in `apps/cli/`\n4. Run tests: `pnpm run build`\n5. Submit a pull request\n\n---\n\n## License\n\nAGPL-3.0\n\n---\n\n## Links\n\n- **Website:** [postiz.com](https://postiz.com)\n- **API Docs:** [docs.postiz.com](https://docs.postiz.com)\n- **GitHub:** [gitroomhq/postiz-app](https://github.com/gitroomhq/postiz-app)\n- **Issues:** [Report bugs](https://github.com/gitroomhq/postiz-app/issues)\n\n---\n\n## Supported Platforms\n\n28+ platforms including:\n\n| Platform | Integration Tools | Settings |\n|----------|------------------|----------|\n| Twitter/X | getLists, getCommunities | who_can_reply_post |\n| LinkedIn | getCompanies | companyId, carousel |\n| Reddit | getFlairs, searchSubreddits | subreddit, title, flair |\n| YouTube | getPlaylists, getCategories | title, type, tags, playlistId |\n| TikTok | - | content_posting_method, privacy_level, comment, brand toggles, duet/stitch/video_made_with_ai (video only), autoAddMusic (photo only) |\n| Instagram | - | post_type (post/story) |\n| Facebook | getPages | - |\n| Pinterest | getBoards, getBoardSections | - |\n| Discord | getChannels | - |\n| Slack | getChannels | - |\n| And 18+ more... | | |\n\n**See [PROVIDER_SETTINGS.md](./PROVIDER_SETTINGS.md) for complete documentation.**\n",
  "bytes": 24541,
  "sha": "7f1f83c3a3e7ded7d5016998790d961896d77b8465f65c5eb24fc5e5aaf32dcb",
  "repo_slug": "gitroomhq/postiz-agent",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_gitroomhq_postiz_agent_postiz_c5feb76c/readme"
}