New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@posthero/cli

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@posthero/cli

PostHero CLI — create, schedule, and publish social media posts from the terminal

Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

PostHero CLI

Create, schedule, and publish social media posts from the terminal.

Installation

npm install -g @posthero/cli

Authentication

Get your API key from posthero.ai/app/settings/api, then:

posthero login

Or pass it inline with any command using --key <your-api-key>.

Commands

Accounts

posthero accounts list

Lists all your connected social media accounts with their IDs. You'll need account IDs when creating posts.

Posts

List posts

posthero posts list
posthero posts list --status draft
posthero posts list --platform linkedin
posthero posts list --limit 50 --page 2

Get a post

posthero posts get <id>

Create a post (interactive)

posthero posts create

Create a post (flags)

# Save as draft
posthero posts create \
  --text "Your post content here" \
  --platforms "linkedin:<accountId>"

# Multiple platforms
posthero posts create \
  --text "Your post content here" \
  --platforms "linkedin:<accountId>,twitter:<accountId>"

# Schedule for later
posthero posts create \
  --text "Your post content here" \
  --platforms "linkedin:<accountId>" \
  --schedule "2025-04-01T09:00:00Z"

# Publish immediately
posthero posts create \
  --text "Your post content here" \
  --platforms "linkedin:<accountId>" \
  --now

# Read content from a file
posthero posts create \
  --file post.txt \
  --platforms "linkedin:<accountId>"

# With an image
posthero posts create \
  --text "Your post content here" \
  --platforms "linkedin:<accountId>" \
  --image ./photo.jpg

# Platform-specific text
posthero posts create \
  --text "Default text" \
  --platforms "linkedin:<accountId>,twitter:<accountId>" \
  --linkedin-text "Longer version for LinkedIn" \
  --twitter-text "Short version for Twitter"

Update a post

posthero posts update <id> --text "Updated text"
posthero posts update <id> --schedule "2025-04-01T10:00:00Z"

Delete a post

posthero posts delete <id>
posthero posts delete <id> --force   # skip confirmation

Publish a draft immediately

posthero posts publish <id>

Media

posthero media upload ./image.jpg

Uploads a file and returns the URL to use in posts.

Global Options

OptionDescription
--key <key>API key (overrides stored key)
--jsonOutput raw JSON (useful for scripting)

Environment Variables

VariableDescription
POSTHERO_API_KEYYour API key
POSTHERO_BASE_URLAPI base URL (default: https://server.posthero.ai/api/v1)

Scripting

Use --json to get machine-readable output:

# Get all account IDs
posthero accounts list --json | jq '.[].id'

# Create a post from a script
posthero posts create \
  --text "$(cat post.txt)" \
  --platforms "linkedin:<accountId>" \
  --json

Requirements

  • Node.js 18+
  • A PostHero account with API access (posthero.ai)

FAQs

Package last updated on 17 Mar 2026

Related posts