@pollinations/cli
v0.1.7
Published
The Pollinations CLI — for humans, AI agents, and everything in between
Readme
@pollinations/cli
The Pollinations CLI — for humans, AI agents, and everything in between.
Generate text, images, audio, video from the terminal. Backed by the Pollinations API.
https://github.com/user-attachments/assets/6b200d95-d734-469c-9fe5-3e63549778fe
npx @pollinations/cli gen image "a cat in space" --output cat.pngFor AI agents
Point your coding agent (Claude Code, Cursor, Windsurf, Codex) at the skill file and it gets the full usage map — flags, stdin conventions, --json output shape, error codes, the lot:
Read https://raw.githubusercontent.com/pollinations/pollinations/main/packages/polli-cli/SKILL.md and follow the instructions to generate media with the
polliCLI.
The skill also ships inside the package: node_modules/@pollinations/cli/SKILL.md.
Every command is agent-friendly:
--json— structured stdout, human messages to stderr. Safe to parse.- Exit code
0on success, non-zero on error. - When a call runs out of pollen, the first line of the error is the top-up link.
polli auth status --jsonexposes everything about the current session.
Get started
npm install -g @pollinations/cli # installs the `polli` binary
polli auth login # device-flow via enter.pollinations.ai
printf '%s' "$POLLINATIONS_API_KEY" | polli auth login --with-tokenCredentials land at ~/.pollinations/credentials.json. For one-off runs pass --key sk_... or set POLLINATIONS_API_KEY. Get keys at enter.pollinations.ai.
Generate
polli gen text "Explain quantum tunneling in one sentence"
polli gen text "Summarize this" < notes.md # stdin becomes context
echo "context" | polli gen text "question"
polli gen image "cyberpunk city at night" --model flux --output city.png
polli gen image "enhance this" --image https://media.pollinations.ai/abc --model gptimage
polli gen audio "Hello world" --voice nova --output speech.mp3
polli gen audio "read it to me" --play # plays back after saving (blocks until done)
polli gen video "a waterfall in slow motion" --duration 5 --output clip.mp4
polli gen transcribe speech.mp3
polli gen chat --model openai # interactive multi-turngen text streams by default. File-output commands pick a sensible default path if --output is omitted.
Discover
polli models # all models
polli models --type image # filter
polli models --stats # health + perf (last 60m)
polli docs # full API reference in the terminal
polli docs /image # one endpoint
polli docs --open # open in browser
polli quests # public quest catalog
polli quests mine # your completed and earned quest statusAccount
Two kinds of keys:
- Secret (
sk_) — backend use, full access. Default. - Publishable (
pk_) — safe to ship in frontend code.
polli keys list
polli keys create --name mybot --budget 100 # secret (default)
polli keys create --name myapp --type publishable # API publishable
polli keys create --name myapp --type publishable \ # 3rd-party app key
--redirect-uri https://myapp.com/callback --earnings
polli keys revoke <id>Keys can't be edited — to change a name, budget, or model list, revoke and recreate. Publishable app keys default developer earnings off; pass --earnings to enable them.
polli usage # pollen balance
polli usage --history # recent requests
polli usage --daily # daily spend
polli quests mine --completed # completed and earned quests
polli my-models list # invite-only community text modelspolli auth login creates a key with all account permissions Polli needs: profile, usage, and keys. Use account:usage for narrow read-only account state like usage and quests. Use account:keys to manage keys and, where invite-only My Models access is enabled, my-models. Quest claiming remains in the dashboard.
Links
- gen.pollinations.ai — API
- enter.pollinations.ai — dashboard, keys, billing
- API docs
- Source
- Discord
License
MIT
