Introduction
Automate social media posting from the command line with the Infipost CLI
The Infipost CLI is a command-line tool for automating social media posting across 28+ platforms. It wraps the Public API so you can schedule posts, manage integrations, and upload media directly from your terminal or shell scripts.
Installation
npm install -g postiz
pnpm install -g postiz
Verify the installation:
postiz --help
Authentication
Option 1: OAuth2 (Recommended)
Authenticate using the device flow, no client ID or secret needed:
postiz auth:login
This will:
- Display a one-time code in your terminal
- Open your browser to authorize
- Automatically save credentials to
~/.postiz/credentials.json
# Check current auth status
postiz auth:status
# Remove stored credentials
postiz auth:logout
Option 2: API Key
Set your Infipost API key as an environment variable. You can get your API key from the Infipost Settings page.
export POSTIZ_API_KEY=your_api_key_here
Custom API URL (self-hosted)
If you're running a self-hosted Infipost instance, point the CLI to your server:
export POSTIZ_API_URL=https://your-postiz-server.com
Self-Hosting the Auth Server
By default, postiz auth:login uses the hosted auth server at cli-auth.infipost.com. If you want to self-host the OAuth2 device flow server, see the Authentication page for the full setup guide.
Quick Start
# 1. List your connected social media accounts
postiz integrations:list
# 2. Create a scheduled post
postiz posts:create \
-c "Hello from the Infipost CLI!" \
-s "2025-01-15T10:00:00Z" \
-i "your-integration-id"
# 3. List your scheduled posts
postiz posts:list
Commands Overview
| Command | Description |
|---|---|
auth:login | Authenticate via OAuth2 device flow |
auth:status | Check current authentication status |
auth:logout | Remove stored credentials |
integrations:list | List all connected social media accounts |
integrations:settings | Get the settings schema for an integration |
integrations:trigger | Trigger a dynamic tool on an integration |
posts:create | Create a new post |
posts:list | List posts with optional date filtering |
posts:delete | Delete a post by ID |
posts:missing | List available content from provider for a post with missing release ID |
posts:connect | Connect a post to its published content by release ID |
analytics:platform | Get analytics for an integration/channel |
analytics:post | Get analytics for a specific post |
upload | Upload a media file |
clipping:create | Turn a long YouTube video into short vertical clips |
clipping:status | Get the status of a clipping and its clips |
clipping:list | List previous clippings |