CLI
Publish local files and check your posts from a terminal.
On this page
Install from the checkout
The CLI requires Node 22.18 or newer. With the Posthoop checkout's dependencies installed, package the CLI and install the local tarball. Run these from the repository root.
pnpm --dir packages/cli pack --out "$PWD/posthoop.tgz"
npm install --global ./posthoop.tgzYou can also run node packages/cli/src/index.ts --help directly from the checkout.
Log in with an API key
posthoop login --url https://posthoop.comPaste a workspace key when prompted. Login checks the key against the accounts endpoint and saves the connection in ~/.config/posthoop/config.json, or $XDG_CONFIG_HOME/posthoop/config.json. Use a Publishing key to post. For noninteractive login, set POSTHOOP_API_KEY and supply --url or POSTHOOP_URL. Later commands use the saved connection.
Check a post before uploading
posthoop post photo.jpg detail.jpg --caption "From the studio" \
--to instagram:@myhandle --dry-runUse platform:@handle if several accounts share a platform. A dry run sends metadata for validation. It exits with status 1 when validation fails. Remove --dry-run to upload and publish, or add --at followed by a future ISO timestamp to schedule.
The CLI uses ffprobe when available for video metadata. If it is unavailable, pass --duration in seconds for TikTok and YouTube videos, and --width and --height for YouTube. These options apply to every file in the command.
Command reference
login
Check an API key and save your connection.
posthoop login [--url <origin>]| Option | Meaning |
|---|---|
--url <origin> | Posthoop server origin. Uses POSTHOOP_URL or prompts if omitted. |
accounts
List social accounts in the workspace.
posthoop accountspost
Publish, schedule, or validate a post with 1 to 35 files.
posthoop post <file...> --to <destinations> [--caption <text>] [--at <ISO time>] [--dry-run] [--privacy <option>] [--board <id>] [--duration <seconds>] [--width <pixels>] [--height <pixels>]| Option | Meaning |
|---|---|
--to <destinations> | Comma-separated platforms or platform:@handle selectors. |
--caption <text> | Caption for all selected accounts. Defaults to an empty string. |
--at <ISO time> | Schedule a future time with an offset. Omit to publish now. |
--dry-run | Validate file metadata and targets without uploading or publishing. |
--privacy <option> | TikTok or YouTube privacy setting. TikTok defaults to SELF_ONLY. |
--board <id> | Pinterest board ID. |
--duration <seconds> | Override the detected video duration for all files. |
--width <pixels> | Override the detected width for all files. |
--height <pixels> | Override the detected height for all files. |
posts
List recent posts with their target statuses.
posthoop postsstatus
Read a post and its target outcomes.
posthoop status <id>help
Print CLI usage. Also available as --help or -h.
posthoop help