@pollinations/cli 0.1.15 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -1
- package/SKILL.md +13 -7
- package/dist/index.js +1202 -69
- package/dist/index.js.map +1 -1
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ Every command is agent-friendly:
|
|
|
25
25
|
- `--json` — structured stdout, human messages to stderr. Safe to parse.
|
|
26
26
|
- Exit code `0` on success, non-zero on error.
|
|
27
27
|
- When a call runs out of pollen, the first line of the error is the top-up link.
|
|
28
|
-
- `polli auth status --json` exposes everything about the current session.
|
|
28
|
+
- `polli auth status --json` (or `polli whoami --json`) exposes everything about the current session.
|
|
29
29
|
|
|
30
30
|
## Get started
|
|
31
31
|
|
|
@@ -37,6 +37,14 @@ printf '%s' "$POLLINATIONS_API_KEY" | polli auth login --with-token
|
|
|
37
37
|
|
|
38
38
|
Credentials land at `~/.pollinations/credentials.json`. For one-off runs pass `--key sk_...` or set `POLLINATIONS_API_KEY`. Get keys at [enter.pollinations.ai](https://enter.pollinations.ai/keys).
|
|
39
39
|
|
|
40
|
+
```bash
|
|
41
|
+
polli update # npm install -g @pollinations/cli@latest, if installed globally
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
For npx or a local/project install, `update` prints instructions instead of creating a second global install.
|
|
45
|
+
|
|
46
|
+
Interactive commands show an occasional update notice without waiting for the network. Set `NO_UPDATE_NOTIFIER=1` to disable it. Notices are skipped for scripts, pipes, and `--json`; updates are never installed automatically. Updating leaves credentials and harness settings untouched.
|
|
47
|
+
|
|
40
48
|
## Generate
|
|
41
49
|
|
|
42
50
|
```bash
|
|
@@ -92,6 +100,7 @@ Keys can't be edited — to change a name, budget, or model list, revoke and rec
|
|
|
92
100
|
polli usage # pollen balance
|
|
93
101
|
polli usage --history # recent requests
|
|
94
102
|
polli usage --daily # daily spend
|
|
103
|
+
polli usage --daily --key polli-harness-claude --days 1 # what one harness key cost in the last day
|
|
95
104
|
polli earnings # developer earnings (default 30 days, --days up to 90)
|
|
96
105
|
polli quests --claimable # only rewards ready to claim
|
|
97
106
|
polli agents list # managed prompt agents
|
|
@@ -138,11 +147,13 @@ polli harness opencode on # enables the Pollinations OpenCode plugin + d
|
|
|
138
147
|
polli harness openclaw on # adds the Pollinations provider + Polli skill to OpenClaw
|
|
139
148
|
polli harness pi on # native provider, key, startup model, and Polli skill
|
|
140
149
|
polli harness prime on # native Prime Agent provider support
|
|
150
|
+
polli harness tgpt on # authenticated Pollinations text models in tgpt
|
|
141
151
|
polli harness <harness> status
|
|
142
152
|
polli harness <harness> off
|
|
143
153
|
```
|
|
144
154
|
|
|
145
155
|
Bloom stores its dedicated key in `$BLOOM_HOME/.env` (default `~/.bloom/.env`).
|
|
156
|
+
tgpt stores its provider, dedicated key, and model in `~/.config/tgpt/config.conf`.
|
|
146
157
|
The DSH adapter configures the Pollinations provider, hosted Pollinations MCP,
|
|
147
158
|
and Polli CLI skill globally under `$DSH_HOME` (default `~/.dsh`). OpenCode uses
|
|
148
159
|
its official plugin; OpenClaw uses `openclaw.json`, while Pi and Prime Agent use
|
package/SKILL.md
CHANGED
|
@@ -43,14 +43,15 @@ If `polli` is not installed, run `npm i -g @pollinations/cli@latest` (provides t
|
|
|
43
43
|
| List your quests + claim state | `polli quests` (filters: `--open --claimable --claimed --coming-soon`) |
|
|
44
44
|
| Manage prompt agents | `polli agents list` |
|
|
45
45
|
| Manage invite-only community models | `polli my-models list` |
|
|
46
|
-
|
|
|
46
|
+
| Update the CLI | `polli update` (global installs only; npx/local get instructions) |
|
|
47
|
+
| Connect a coding harness to Pollinations | `polli harness <bloom\|dsh\|opencode\|openclaw\|pi\|prime\|tgpt> on` (available adapters: `polli harness --help`) |
|
|
47
48
|
| Machine-readable output | append `--json` to any command |
|
|
48
49
|
|
|
49
50
|
## Setup
|
|
50
51
|
|
|
51
52
|
One-time: `polli auth login` (device-flow; creates a key with `profile`, `usage`, and `keys`). To store an existing key, run
|
|
52
53
|
`printf '%s' "$POLLINATIONS_API_KEY" | polli auth login --with-token`. Verify
|
|
53
|
-
with `polli auth status
|
|
54
|
+
with `polli auth status` (or `polli whoami`).
|
|
54
55
|
Override the stored key for a single command with `--key <key>`.
|
|
55
56
|
|
|
56
57
|
## Recipes
|
|
@@ -59,7 +60,7 @@ Override the stored key for a single command with `--key <key>`.
|
|
|
59
60
|
```bash
|
|
60
61
|
polli gen image "a fox reading a book, studio ghibli style" --output fox.png
|
|
61
62
|
```
|
|
62
|
-
Defaults: `zimage`, 1024x1024. Pick a different model with `--model flux` (see `polli models --type image`). For edits / img2img, pass one or more `--image <url>` flags — **must be public http(s) URLs**, local paths are rejected client-side. **Only models that list `"image"` in `input_modalities` actually consume the flag** — `flux` and `zimage` are text-only and will silently ignore `--image`. Find i2i-capable models with `polli models --type image --json | jq -r '.[] | select(.input_modalities | contains(["image"])) | .name'` (common choices: `nanobanana`, `kontext`, `p-image-edit`). To use a local file, upload it first with `polli upload` (see next recipe).
|
|
63
|
+
Defaults: `zimage`, 1024x1024. Pick a different model with `--model flux` (see `polli models --type image`). For edits / img2img, pass one or more `--image <url>` flags — **must be public http(s) URLs**, local paths are rejected client-side. **Only models that list `"image"` in `input_modalities` actually consume the flag** — `flux` and `zimage` are text-only and will silently ignore `--image`. Find i2i-capable models with `polli models --type image --json | jq -r '.[] | select(.input_modalities | contains(["image"])) | .name'` (common choices: `nanobanana`, `kontext`, `p-image-edit`). To use a local file, upload it first with `polli upload` (see next recipe). **Img2img models may treat `--width`/`--height` as a hint** and keep the source aspect — check the output with `file`/`ffprobe`; if the aspect matters, pre-crop the source or crop afterwards.
|
|
63
64
|
|
|
64
65
|
### Upload a local file to get a public URL
|
|
65
66
|
```bash
|
|
@@ -149,6 +150,7 @@ Use `--stats` before choosing a model. **Caveat**: the `err%` column counts **5x
|
|
|
149
150
|
polli usage # current pollen balance
|
|
150
151
|
polli usage --history # recent individual requests
|
|
151
152
|
polli usage --daily # daily cost summary
|
|
153
|
+
polli usage --daily --key polli-harness-claude --days 1 # cost of one harness key for the last day (`--model`, `--csv` filter/export both views; `--key` is repeatable)
|
|
152
154
|
polli earnings # developer earnings total + per-entity breakdown (default 30d)
|
|
153
155
|
polli earnings --days 7 # rolling window, max 90
|
|
154
156
|
polli quests # your quests + claim state (open/claimable/claimed/coming)
|
|
@@ -221,10 +223,12 @@ polli harness pi on --model moonshotai/kimi-k2.6 # use the model ID from `polli
|
|
|
221
223
|
polli harness pi off # restore the Pi config backed up before "on"
|
|
222
224
|
polli harness openclaw on # login if needed, mint key "polli-harness-openclaw", add provider + Polli skill
|
|
223
225
|
polli harness openclaw off # remove the Pollinations provider, key, and skill
|
|
226
|
+
polli harness tgpt on # use tgpt's Pollinations provider with a dedicated key
|
|
227
|
+
polli harness tgpt off # restore tgpt's previous configuration
|
|
224
228
|
```
|
|
225
|
-
Each adapter checks that its harness can be launched before login, key creation, or configuration. DSH's official launch uses `npx`, so its adapter checks for `npx`; Bloom, OpenCode, OpenClaw, and
|
|
229
|
+
Each adapter checks that its harness can be launched before login, key creation, or configuration. DSH's official launch uses `npx`, so its adapter checks for `npx`; Bloom, OpenCode, OpenClaw, Pi, and tgpt require their installed commands.
|
|
226
230
|
|
|
227
|
-
Bloom already uses Pollinations and only needs a dedicated key in `$BLOOM_HOME/.env` (default `~/.bloom/.env`). The DSH adapter globally configures the Pollinations provider, hosted Pollinations MCP, and this skill under `$DSH_HOME` (default `~/.dsh`). OpenCode enables the existing Pollinations plugin and stores its dedicated key in the plugin config. OpenClaw adds a `pollinations` provider to `~/.openclaw/openclaw.json`, stores a dedicated key in `env.vars`, and installs this skill under `~/.openclaw/skills/polli/`. Pi writes `~/.pi/agent/models.json`, `auth.json`, and `settings.json`, and installs this skill under `~/.pi/agent/skills/polli/`. Guide: `polli docs` section "Coding Harnesses".
|
|
231
|
+
Bloom already uses Pollinations and only needs a dedicated key in `$BLOOM_HOME/.env` (default `~/.bloom/.env`). tgpt's existing Pollinations provider is selected in `~/.config/tgpt/config.conf` with a dedicated key and model. The DSH adapter globally configures the Pollinations provider, hosted Pollinations MCP, and this skill under `$DSH_HOME` (default `~/.dsh`). OpenCode enables the existing Pollinations plugin and stores its dedicated key in the plugin config. OpenClaw adds a `pollinations` provider to `~/.openclaw/openclaw.json`, stores a dedicated key in `env.vars`, and installs this skill under `~/.openclaw/skills/polli/`. Pi writes `~/.pi/agent/models.json`, `auth.json`, and `settings.json`, and installs this skill under `~/.pi/agent/skills/polli/`. Guide: `polli docs` section "Coding Harnesses".
|
|
228
232
|
|
|
229
233
|
### Read API docs
|
|
230
234
|
```bash
|
|
@@ -241,7 +245,7 @@ polli docs --open # open in browser
|
|
|
241
245
|
|
|
242
246
|
## Agent operating rules
|
|
243
247
|
|
|
244
|
-
1. **Run `polli auth status` first** if you don't know whether the user is logged in. Fail fast with a clear "run `polli auth login`" message if not.
|
|
248
|
+
1. **Run `polli auth status` (or `polli whoami`) first** if you don't know whether the user is logged in. Fail fast with a clear "run `polli auth login`" message if not.
|
|
245
249
|
2. **Prefer `--json`** whenever you'll parse the output. Never grep human-formatted tables.
|
|
246
250
|
3. **Don't hardcode model IDs.** Fetch the live list with `polli models --type <type>`. Model availability changes.
|
|
247
251
|
4. **Before picking a model for production use, check `polli models --stats`.** Rule of thumb for "healthy": `err%` ≤ 5, `avg` latency in a reasonable range for the modality (standard text <5s, image <10s, video <60s), and `requests` high enough to be statistically meaningful (ignore rows with <10 requests — noise). **Filter by capability first, then optimize by health** — e.g. for a reasoning task, narrow to models where `reasoning: true` (via `polli models --type text --json`), *then* cross-reference against `--stats` output. The healthiest model overall may not support the capability you need. **Reasoning models are inherently slower — expect 5–50s, not <5s**; when picking among them, prioritize low `err%` and request count over raw latency, and compare latency only within the reasoning-capable subset.
|
|
@@ -254,6 +258,8 @@ polli docs --open # open in browser
|
|
|
254
258
|
|
|
255
259
|
- Forgetting `--output` on binary generators (image/audio/video) — the file goes to a default path, which may not be what the user wants.
|
|
256
260
|
- Using `polli gen text --json` expecting OpenAI chat-completions shape — the CLI's `--json` wraps its own structure. Use `polli docs /v1/chat/completions` to see the raw API shape if you need it.
|
|
257
|
-
- Running commands without auth — `polli auth status` tells you who you're logged in as and your balance in one call.
|
|
261
|
+
- Running commands without auth — `polli auth status` / `polli whoami` tells you who you're logged in as and your balance in one call.
|
|
258
262
|
- **`gen text` streams to a TTY, buffers when piped.** The default now auto-detects — a human at the terminal sees tokens tick in, a pipe/redirect gets the full response once. Force either mode with `--stream` or `--no-stream`. For scripts and chains like `polli gen text … | polli gen audio …`, you don't need to do anything; buffering happens automatically.
|
|
259
263
|
- **Translating a `polli` workflow into a browser app.** `gen.pollinations.ai` requires a bearer token for generation requests, so a plain client-side `fetch` with no auth returns 401 unless it is served from cache. Mint a scoped key with `polli keys create` and proxy via your own backend.
|
|
264
|
+
- **Backgrounded `polli gen` can fail silently** — no output file, empty log, no error (a safety rejection is an explicit 400). Run in the foreground; if backgrounded, check the `--output` file exists and retry once in the foreground before calling it failed.
|
|
265
|
+
- **Content-safety 400s aren't only about violence.** Body-focused action phrasing can trip a sexual-content category on some edit models. Rephrase the benign intent neutrally (e.g. sport framing) and retry with a new seed.
|