CLI

Command reference

Every Zanfia CLI command, grouped by resource: products, offers, bumps, courses, media, communities, pages, clients, orders, stats, and discounts.

10 min readLast updated Jul 9, 2026

All commands support --json for machine-readable output (place global flags before the subcommand). Money amounts are minor units (1999 = 19.99). Every command maps onto a Workspace API route, so anything here also works as raw HTTP.

Auth

CommandPurpose
zanfia loginBrowser sign-in; stores a 90-day token
zanfia logoutClear stored credentials
zanfia registerCreate a new creator account from the terminal (emailed code)
zanfia auth statusShow identity, credential source, expiry, and target environment
zanfia auth set-key <key>Store an API key as the credential
zanfia auth whoamiThe workspace and identity behind the current credential

Products

CommandPurpose
products list / products get <id>Browse products
products create / products update <id>Create / edit
products publish <id> / products draft <id> / products archive <id>Lifecycle
products prices list <id> / products prices create <id>Price management (server-side gateway sync included)
products appointment get|set <id>Appointment settings
products after-purchase get|set <id>After-purchase settings
products images set <id>Replace product images

Offers (checkouts) and order bumps

An offer is a checkout of a product; <cid> comes from offers list.

CommandPurpose
offers list [--product <pid>] / offers get <cid>Browse offers with prices and attached bumps
offers create --product <pid> [--free] [--name <n>]New offer (free offers carry no prices)
offers update <cid> [--name] [--slug] [--title] [--description] [--success-url]Edit display fields
offers publish <cid> / offers unpublish <cid>Activate / pause (paid offers need a connected payment gateway)
offers duplicate <cid> [--with-prices] / offers set-default <cid>Copy; make default checkout
offers price add <cid> --type one_time|recurring|installments --amount <minor> --currency pln|usd|eur|gbp [--interval] [--trial-days] [--label] [--hidden] [--sale-ends-at] [--quantity-limit] [--compare-at] …Add a price variant
offers price update <cid> <priceId> --operation activate|deactivate|hide|unhide|change-amount [--amount]Mutate a price
offers price delete <cid> <priceId> [--remove]Archive (default) or remove entirely
offers price reorder <cid> --order id1,id2,…Display order — pass all price ids
bumps list / bumps create --product <pid> --price <priceId> --name <n>Order bumps (the price must be on the product's default offer)
bumps update <bumpId> / bumps delete <bumpId>Edit / delete
bumps attach <cid> <bumpId> [--prices id,id] / bumps detach <cid> <bumpId>Show a bump on an offer (omit --prices = all prices)

Courses

Address everything by product id (from products list). Statuses: draft, public, hidden, locked; new modules and lessons start as draft. Lesson content is Markdown, and an update replaces the whole body — prefer --content-file for anything long.

CommandPurpose
courses get <pid>Full module/lesson structure with statuses
courses lesson get <pid> <lid> [--content]Lesson detail; --content prints just the Markdown
courses lesson add <pid> --module <mid> --title <t> [--type article|video|externalVideo|task|quiz] [--video-media <mediaId>]New draft lesson
courses lesson update <pid> <lid> [--title] [--description] [--status] [--content | --content-file]Edit a lesson
courses lesson set-video <pid> <lid> --video-media <mediaId>Bind an uploaded video
courses lesson delete <pid> <lid>Permanent — to hide instead, set --status hidden
courses module add <pid> --name <n> / courses module update <pid> <mid>Modules
courses module delete <pid> <mid>Permanent, cascades to all its lessons
courses quiz list <pid> <lid>Questions and settings of a quiz lesson
courses quiz add <pid> <lid> [--type single|multi|truefalse] [--question] [--options] [--correct] [--points] | [--json <file>]Add a question
courses quiz update <pid> <lid> <qid> … / courses quiz delete <pid> <lid> <qid>Replace / delete a question
courses quiz reorder <pid> <lid> --order id,id,…Pass every question id
courses quiz settings <pid> <lid> [--passing-score] [--max-attempts] [--time-limit] [--shuffle-questions on|off] [--require-pass on|off] …Grading, attempts, shuffling, gating
courses publish <pid> --lessons id,id [--status public]Bulk lesson status change
courses publish <pid> --module <mid>Publish a module and all its lessons
courses reorder modules <pid> --order id1,id2,…Strict permutation — every module id
courses reorder lessons <pid> --module <mid> --order id1,id2,…Strict permutation — every lesson id in the module

Media library

CommandPurpose
media upload --file <path> [--name] [--folder]Upload a file; prints the media id and public URL
media upload-video --file <path> [--title] [--wait]Upload a video for lessons; transcoding runs after upload
media list [--folder <name>] / media get <id>Browse; get shows uploadStatus
media delete <id> [--force]Delete (--force if still referenced elsewhere)
media folder list|create|delete <name>Folders — deleting a folder unfiles items, never deletes them

Videos need transcoding

media upload-video without --wait returns while the video is still processing. Poll media get <id> until uploadStatus is ready, then bind it with courses lesson set-video.

Communities

Address by community id (from communities list). You act as yourself — channel access and moderation rights are resolved per request. Posts and comments live in feed channels; content is Markdown. Writing requires a member profile in the community, even for workspace staff.

CommandPurpose
communities listYour communities (with the backing product id)
communities channels <cid>Channels you can see, with your access level
communities posts <cid> <chid> [--limit] [--cursor]Posts, newest first
communities post get|create|update|delete …Post CRUD (--content / --content-file)
communities post pin|unpin <cid> <postId>Pin management
communities comments <cid> <postId>Comments, oldest first; replies reference a parent
communities comment create <cid> <postId> --content <md> [--reply-to <commentId>]Comment or threaded reply
communities comment update|delete <cid> <commentId>Edit / remove
communities chat messages|send|edit|delete …Chat channels and threads
communities support queue|mine|show|create|reply|status …Support tickets
communities channel create <cid> --name <n> [--type feed|chat|link] [--group] [--readonly]New channel (--readonly = announcement mode)
communities channel update|delete <cid> <chid>Edit / delete a channel
communities group create|update|delete <cid> …Sidebar sections
communities move <cid> (--channel <chid> | --group <gid>) (--into-group <gid> | --to-root | --before <id> | --after <id>)Reorder / re-parent the sidebar

Pages

Custom hosted HTML pages, served on your storefront domain. Statuses: draft, published.

CommandPurpose
pages list / pages get <id>Browse (detail includes the HTML body)
pages create --slug <s> --title <t> (--file <path> | --html <h>) [--publish]New page, draft unless --publish
pages update <id> [--slug] [--title] [--file | --html]Edit
pages publish <id> / pages unpublish <id>Toggle live ↔ draft
pages delete <id>Delete the page and its HTML
pages set-main <id> / pages unset-mainUse a published page as the storefront homepage / revert to the product grid

Clients

CommandPurpose
clients list / clients get <id>Browse clients
clients addCreate a contact only — product access is granted separately
clients update <id> / clients change-email <id> --email <e>Edit
clients grant <productId> --email <e> [--price <priceId>] [--until <date>] [--welcome-email]Grant product access (free enrollment under an existing price, optionally time-limited)
clients revoke <productId> --email <e>Revoke access — never refunds, and refuses active paid subscriptions
clients change-period <productId> …Adjust an access period

Orders, stats, discounts

CommandPurpose
orders list [--product] [--status] [--from/--to] [--search] [--limit/--cursor] / orders get <id>Order history
stats overview|sales|recurring|mrr-history|funnel|traffic|sessionsWorkspace analytics — range via --period 7d or --from/--to, plus --currency
stats product <id>Per-product stats
discounts list|create|update|archive|deleteDiscount management

Was this article helpful?

Related articles

Spotted something off? Tell us at support@zanfia.com.