logo
Schedulin Developers

CLI

@schedulin/cli is the official command-line interface for the Schedulin API. It wraps the same /v0 REST endpoints as the SDKs, so anything you can script with an API key you can do from a shell — list channels, draft and publish posts, upload media, pull analytics.

Install

Run it on demand with npx (no install):

npx @schedulin/cli accounts list

Or install it globally for a shorter schedulin command:

npm i -g @schedulin/cli
schedulin --help

Requires Node.js 18+.

Authentication

The CLI needs a workspace API key (see Authentication). It resolves the key in this order — highest wins:

  1. --api-key <key> flag
  2. SCHEDULIN_API_KEY environment variable
  3. Stored config file

Store it once and forget it:

schedulin config set api-key sk_live_...
schedulin config whoami   # verify the key resolves to your workspace

The key is written to ~/.config/schedulin/config.json (or $XDG_CONFIG_HOME/schedulin/) with 0600 permissions and is masked in all output. Run schedulin config show to see the resolved config (key masked).

Global flags

FlagDescription
--api-key <key>API key (else SCHEDULIN_API_KEY or stored config)
--base-url <url>API base URL (else SCHEDULIN_API_BASE or production)
--jsonOutput raw JSON instead of a table — for piping into jq
--dry-runFor writes: print the request that would be sent, then stop
-y, --yesSkip confirmation prompts (required to publish/delete non-interactively)
-v, --verboseLog requests to stderr (API key masked)

Common commands

# Channels (social accounts)
schedulin accounts list

# Posts
schedulin posts list --status scheduled --limit 20
schedulin posts get <postId>
schedulin posts create \
  --social-account-id <id> \
  --caption "Hello from the CLI 👋" \
  --media https://cdn.example.com/launch.jpg \
  --action schedule \
  --scheduled-at 2026-07-01T15:00:00Z
schedulin posts publish <postId>
schedulin posts delete <postId>

# Tags
schedulin tags list
schedulin tags create --name launch --color "#a855f7"

# Media
schedulin media upload ./image.jpg
schedulin media list

schedulin posts create defaults to --action draft, so nothing publishes unless you ask it to. Run schedulin <command> --help for the full flag list of any command.

Safety

The CLI is built so a script can never publish or delete by accident:

  • --dry-run prints the resolved request body and exits before any write.
  • Publishing actions (--action now/queue, posts publish) and deletes prompt for confirmation. In a non-interactive context (no TTY, or --json) they abort unless you pass --yes.

Scripting

Use --json to get machine-readable output and pipe it into jq:

# IDs of every connected account
schedulin accounts list --json | jq -r '.data[].id'

# Number of scheduled posts
schedulin posts list --status scheduled --json | jq '.total'

List endpoints return their array under a data key ({ "data": [...] }); posts list returns { posts, page, total, totalPages }. See Pagination.