Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CLI

rustiz is the server, the scheduler, the MCP server and a CLI for agents, all in one binary. Run rustiz --help or rustiz <command> --help for the complete, current reference.

Two modes

  • Local (default). Without --url, API commands run the same router in-process against DATABASE_URL. No server is needed. Posts are still only published while rustiz serve, rustiz worker or rustiz mcp is running somewhere against that database.
  • Remote. With --url (or RUSTIZ_URL) and RUSTIZ_API_KEY, the CLI talks to a server over HTTP, either your own or a hosted one.

API commands print exactly one JSON document on stdout. Diagnostics go to stderr.

Exit codeMeaning
0Success
1Server or runtime failure
2Bad usage or HTTP 400
3Authentication
4Not found
5Conflict: the post is being published

Global options

OptionEnvDefault
--config <path>RUSTIZ_CONFIG~/.rustiz/config.env
--database-url <url>DATABASE_URLsqlite://rustiz.db (init writes the real path)
--url <url>RUSTIZ_URLunset (local mode)
--api-key <key>RUSTIZ_API_KEYfrom the config file; never printed

Real environment variables override the config file.

Running

CommandPurpose
rustiz init [--dir <path>] [--name <org>]First-time setup: config file, database, first API key. Safe to rerun
rustiz serve [--port 5000] [--host 0.0.0.0] [--no-worker]HTTP API, MCP and the scheduler
rustiz workerThe scheduler only
rustiz mcp [--api-key <key>]MCP over stdio, with the scheduler and the local OAuth callback in-process
rustiz migrateApply database migrations and exit
rustiz providers [--status]List platforms; --status adds readiness as JSON
rustiz org create <name> · org list · org rotate-key <id>Organizations and keys (plain-text output). Rotating a key revokes MCP OAuth tokens

Channels

rustiz channels list
rustiz channels connect <provider> [--open] [--fields <file|->] [--external-url <url>] \
                                   [--name <n>] [--description <d>] [--timeout 300]
rustiz channels connect-status <connectionId>
rustiz channels delete <id>
  • OAuth providers print a login URL. In local mode the CLI also serves the platform callback on 127.0.0.1:<port of FRONTEND_URL> and waits until the account appears. --open launches the browser.
  • Credential providers take --fields (a JSON file, or - for stdin).
  • Telegram, Moltbook and Farcaster print what the human must do. Finish with connect-status.

Posts

rustiz posts list [--start <iso>] [--end <iso>] [--customer <id>]
rustiz posts get <id>
rustiz posts create --channel <id> [--channel <id> ...] --content "<p>Hi</p>" \
                    [--date <iso>] [--type draft|schedule|now] [--media <path|url> ...]
rustiz posts create --json post.json       # a full CreatePostDto, same as POST /public/v1/posts
rustiz posts update <id> [--content ...] [--date ...] [--publish] [--republish] [--json <file|->]
rustiz posts reschedule <id> --date <iso> [--publish] [--republish]
rustiz posts delete <id>                    # also deletes the other posts in its group

--type defaults to schedule, which needs --date. posts list defaults to the window from 7 days ago to 30 days ahead.

Media, analytics and slots

rustiz media list
rustiz media upload ./shot.png             # png/jpg/gif/webp/mp4/mov/webm/pdf
rustiz media upload-url https://cdn.example.com/clip.mp4
rustiz media delete <id>

rustiz analytics <channel-id> [--days 7]
rustiz notifications
rustiz find-slot <channel-id>

Using it from an agent without MCP

Any agent that can run shell commands can drive Rustiz through the CLI. The JSON output and exit codes are stable to parse:

id=$(rustiz channels list | jq -r '.[] | select(.identifier=="bluesky") | .id')
rustiz posts create --channel "$id" --content "<p>Shipped.</p>" --type now