CLI quickstart
Install the Zanfia CLI, sign in, and run your first commands against your workspace.
The Zanfia CLI brings your whole workspace to the terminal: create products and offers, write course lessons, upload videos, post in communities, manage clients, and pull sales stats — interactively or from scripts.
Beta naming
During the beta the CLI is published as @zanfia-dev/cli and installs the command
as zanfia-dev. The examples below use zanfia — substitute
zanfia-dev until general availability.
Install and sign in
Install globally
npm install -g @zanfia-dev/cliRequires Node.js 20 or newer.
Log in
zanfia loginThis opens your browser for a one-click authorization and stores a token in
~/.config/zanfia/credentials.json (valid 90 days, refreshed on each login). No account yet?
zanfia register creates one from the terminal via an emailed code.
Verify
zanfia auth status
zanfia products listauth status shows who you're signed in as and which environment you're talking to;
products list is the classic first read.
Alternative: API keys
Instead of login, you can authenticate with an API key — useful for CI and servers:
export ZANFIA_API_KEY=YOUR_API_KEY # or pass --api-key per invocation
zanfia products list
Resolution order: --api-key flag → ZANFIA_API_KEY → stored login credentials.
Global flags
Global flags go before the subcommand:
| Flag | Effect |
|---|---|
--json | Machine-readable output — the right mode for scripts and AI agents |
--verbose | Log the underlying HTTP requests |
--api-key <key> | Authenticate this invocation with a specific key |
zanfia --json products list
A taste of what it can do
# Create a product and publish a first lesson
zanfia products create --name "Negotiation for Engineers"
zanfia courses module add <productId> --name "Week 1"
zanfia courses lesson add <productId> --module <moduleId> --title "Anchoring" --type article
zanfia courses lesson update <productId> <lessonId> --content-file ./anchoring.md --status public
# Upload a video and bind it to a lesson
zanfia media upload-video --file ./intro.mp4 --wait
zanfia courses lesson set-video <productId> <lessonId> --video-media <mediaId>
# Check this week's numbers
zanfia stats overview --period 7d
The full surface is in the command reference.
Was this article helpful?

