CLI

CLI quickstart

Install the Zanfia CLI, sign in, and run your first commands against your workspace.

3 min readLast updated Jul 9, 2026

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

1

Install globally

npm install -g @zanfia-dev/cli

Requires Node.js 20 or newer.

2

Log in

zanfia login

This 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.

3

Verify

zanfia auth status
zanfia products list

auth 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:

FlagEffect
--jsonMachine-readable output — the right mode for scripts and AI agents
--verboseLog 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?

Related articles

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