moula-cli
v0.7.1
Published
Standalone Claude Code CLI sponsored-line client for moula — a small sponsored line on your terminal status bar; you keep 50% of gross. No VS Code required.
Maintainers
Readme
moula-cli
Get paid for your Claude Code CLI status line. moula-cli installs a small
sponsored line that renders on the CLI's bottom row (clickable) and in the
spinner — you keep 50% of gross. No VS Code required; this is a standalone
terminal tool.
It uses only two documented Claude Code settings (statusLine + spinnerVerbs)
in ~/.claude/settings.json — it never patches any bundle, and everything is
reversible.
Install & set up
# with npx (no install):
npx moula-cli setup
# or install globally, then run:
npm i -g moula-cli
moula setupBy default, setup opens your browser to authorize this device (no
copy-paste): it shows a short code, you confirm it while logged in to moula, and
the CLI receives its key automatically. Then it installs the integration and
fetches your first line.
Prefer to paste the key yourself (from your dashboard → Developer → API key)?
moula setup --paste # prompts, hidden input
moula setup --key moula_dev_xxx # inline (scriptable)
MOULA_API_KEY=moula_dev_xxx moula setup # env var (CI)
moula login # (re)authorize later — browser by defaultThen restart any running claude session to pick up the spinner verb (the
bottom status line updates live).
Commands
| Command | What it does |
| --- | --- |
| moula setup | Install the sponsored line (prompts for your key) |
| moula update | Pick up a newer client. Refreshes the scripts only — your key, settings and cadence are untouched, and it never re-opens the browser flow |
| moula status | Show install state, current ad, and settings |
| moula login | Update the stored API key |
| moula pause | Stop showing ads and stop earning, keeping the install and your key |
| moula resume | Start showing ads again |
| moula uninstall | Remove it and restore your previous statusLine/spinner |
| moula help / moula version | Help / version |
Options: --key <moula_dev_…>, --base-url <url> (default https://www.moula.io),
--poll <minutes> (default 10), --buffer <n> (ads in rotation, default 4),
--rotate <seconds> (status-line cycle speed, default 15), --smooth (cycle the
status line on a timer even while idle).
Rotation (multiple ads, no extra billing)
Each fetch serves one ad (one impression) and appends it to a rolling buffer
of the last --buffer ads. The spinner then rotates through all of them
(Claude cycles the spinnerVerbs array), and the status line cycles through
them over time (--rotate seconds each) — clickable, opening whichever ad is
currently shown. Because the buffer only holds ads that were already served,
re-displaying them costs nothing: billing stays at ~one impression per --poll
interval. When no sponsor is available and the buffer drains, the spinner returns
to Claude's defaults automatically.
How it works
Installed under ~/.claude/:
| File | Role |
| --- | --- |
| moula-config.json | { apiBaseUrl, apiKey, pollMinutes, paused } — locked to your user (chmod 600 + icacls on Windows) |
| moula-statusline.js | Renderer Claude runs each status tick. Instant — prints the cached ad (clickable OSC 8), and only when stale spawns a detached refresh. Never blocks on the network. |
| moula-refresh.js | Background fetcher — POSTs to /api/v1/ad-serve with your key, writes the cache + spinner verb. This is the only place an impression bills — at most once per pollMinutes, lock-guarded. |
| moula-ads.json | Rolling buffer of the last N served ads (for rotation). |
| moula-attest.json | Display-time ledger. The renderer adds the real gap between consecutive status ticks that showed an ad (each gap capped at 60 s, so an idle terminal isn't counted); the fetcher flushes it to /api/v1/attention. An impression earns nothing until this is reported — the server prices it only for dwell it can verify against its own clock. |
| moula-ad.lock | Single-flight guard. |
| moula-cli.json | Sidecar snapshotting your prior statusLine + spinnerVerbs for exact restore. |
- Clickable link lives on the
statusLinebottom row (OSC 8 — Ctrl/Cmd+Click in most terminals). The spinner verb is plain text (no link hook exists for it). - Between ads the status line falls back to a compact
model + dirline. - The developer API key is stored in
moula-config.json(locked to your user) — the standard way CLIs store tokens; it's revocable.moula uninstalldeletes it.
Requirements
- Node.js ≥ 18 (for global
fetch) — the same runtime Claude Code uses. - Claude Code with
statusLinesupport (any recent build).
Privacy / safety
No files belonging to Claude Code or any other tool are modified — only your own
~/.claude/settings.json (merged, other keys preserved) and the moula-* files
above. Removing them (or moula uninstall) fully reverts the integration.
