token-quota
v1.0.0
Published
One compact table of remaining token-plan / package quota for Cursor, Doubao (Volcengine Ark) and Alibaba Bailian — read-only, no daemon
Maintainers
Readme
token-quota
One compact table of the remaining token-plan / purchased-package quota for three platforms: Doubao (Volcengine Ark), Alibaba Bailian and Cursor.
$ token-quota
PLATFORM PLAN/PACKAGE TOTAL USED REMAINING RESET
-------- -------------------------------------- ----- ------ --------- ----------------
doubao agent-plan personal (medium) — 5h 100% 2.08% 97.92% 2026-09-19 16:29
doubao agent-plan personal (medium) — weekly 100% 57.53% 42.47% 2026-09-21 00:00
doubao agent-plan personal (medium) — monthly 100% 55.99% 44.01% 2026-09-28 23:59
bailian Alibaba Coding Plan — week 100% 64.4% 35.6% 2026-09-24 06:00
cursor Pro — included usage 100% 17% 83% 2026-09-30 19:39
cursor Pro — auto usage 100% 15% 85% 2026-09-30 19:39
cursor Pro — API usage 100% 42% 58% 2026-09-30 19:39
cursor Pro — spend limit $1.00 $0.00 $1.00 2026-09-30 19:39Read-only by design: it queries, prints, exits. No daemon, no background refresh, no cache, no purchase or top-up action. It never prints, writes or commits a credential value — credentials are only ever read by the vendor CLIs' own credential stores. One platform failing never affects the others, and a missing sign-in is a reported state, not a crash.
Install
Requires Node.js >= 20.
npm install -g token-quota # then: token-quota
npx token-quota # one-off, no installThe three data-source CLIs (quota-axi, bailian-cli, @volcengine/ark-cli)
are declared dependencies of this package, so they arrive with it — there is
nothing to install by hand.
Quick start
token-quota # the table
token-quota --json # machine-readable { rows, notes }
token-quota --only cursor,doubao
token-quota setup # sign in to the platforms that are not configured
token-quota doctor # read-only check of what is missing
token-quota --help
token-quota --versionFirst run on a fresh machine: token-quota setup walks platform by platform and
runs each platform's own login command. If everything is already signed in, just
run token-quota.
Commands
| Command | What it does |
| ------- | ------------ |
| (none) | Prints the quota table (or --json) and exits. |
| setup | Interactive sign-in wizard. Checks each selected platform, explains what is missing, runs that platform's own login command (arkcli auth login volc-sso, bl auth login --console) or asks you to sign in inside the Cursor editor, then re-checks and prints the final panel. Writes no file and stores no credential — every session stays owned by the tool that created it. Non-interactive runs (token-quota setup | cat) only print the manual steps and exit 0. |
| doctor | Read-only health check: Node version, the three data-source CLIs (--version), the sqlite3 the Cursor row needs, then one real read-only query per platform, each classified as working / not logged in / CLI missing / query failed, with the exact fix command for anything red. It never starts a login. Exits 0 only when everything is green. |
Both subcommands accept --only <list>, like the panel.
$ token-quota doctor
token-quota doctor — read-only checks; nothing is signed in, written or refreshed
Environment
[ok] node v24.20.0 (requires >= 20)
[ok] sqlite3 (vendored for Windows) — .../vendor/sqlite3-shim/sqlite3.exe
Data-source CLIs
[ok] quota-axi 0.1.47 — package dependency: node .../quota-axi/dist/bin/quota-axi.js
[ok] bailian CLI (bl) 1.24.0 — package dependency: node .../bailian-cli/dist/bailian.mjs
[ok] arkcli (Volcengine Ark) 1.0.33 — package dependency: .../ark-cli/bin/arkcli-windows-amd64.exe
Platforms (real read-only queries)
[ok] doubao — 3 row(s) read
[ok] bailian — 1 row(s) read
[ok] cursor — 5 row(s) read
3 of 3 platform(s) usable — everything checks out; `token-quota` is ready.Output
| Column | Meaning |
| ----------- | ------------------------------------------------------------------------- |
| PLATFORM | doubao, bailian or cursor |
| PLAN | The purchased plan/package, plus the usage window the row describes |
| TOTAL | The window's size (100% for percentage meters, USD for credit meters) |
| USED | How much of that window has been consumed |
| REMAINING | What is left (TOTAL - USED) |
| RESET | When the window resets/expires, in local time (n/a when not reported) |
A platform that cannot be queried still gets its row, with an explicit
credential missing or query failed state and a note naming the exact
credential or cause.
Data sources and credentials
| Platform | Source | Credentials |
| -------- | ------ | ----------- |
| Doubao (Volcengine Ark) | ark-cli (arkcli usage plan) | an Ark CLI SSO session from arkcli auth login volc-sso (one browser SSO sign-in). AK/SK pairs and DOUBAO_* model keys are not used and never printed. |
| Alibaba Bailian | quota-axi (--provider alibaba), which reads the local official Bailian CLI (bl) | a Bailian console session from bl auth login --console (one browser sign-in). BAILIAN_PLAN_API_KEY is a model inference key and is rejected by the usage API. |
| Cursor | quota-axi (--provider cursor) | the Cursor editor's own local sign-in store (sign in to the app once). On Windows quota-axi needs the sqlite3 CLI to read it — see below. |
Credentials are only ever read from the config stores quota-axi and the
platform CLIs already own. token-quota never prints, logs or writes secret
values, and quota-axi is always run with --no-credential-refresh, so no read
can trigger an interactive re-login flow.
QUOTA_AXI_BIN and ARKCLI_BIN override how the two data-source CLIs are
launched (absolute path to the entry script or binary); they are meant for
development against a checkout, not for normal use.
Doubao quota granularity
Doubao quota is whatever arkcli usage plan reports: one row per usage period
(5h, weekly, monthly) of each subscribed plan item (product edition
(tier)). Items marked subscribed:false are hidden by default (the row count
is noted). If the SSO session is absent or expired, the doubao row reports
credential missing and names arkcli auth login volc-sso.
Why vendor/sqlite3-shim exists
quota-axi's Cursor provider reads the signed-in editor's state.vscdb by
spawning the sqlite3 CLI. On Windows, a spawned process can only execute a
real sqlite3.exe (.cmd wrappers are invisible to it), and many machines do
not have sqlite3 installed. This package therefore vendors the official
public-domain sqlite3.exe (from sqlite.org, sqlite-tools-win-x64) in
vendor/sqlite3-shim/ and prepends that directory to PATH only for the
quota-axi subprocess. Nothing is installed globally and the user's own
environment is untouched. token-quota doctor reports whether it is present;
if the vendored binary is missing or unusable, the cursor row says so explicitly.
On macOS/Linux quota-axi uses the system sqlite3 (doctor checks that too).
Exit codes
0— at least one platform returned usable data (missing credentials are a reported state, not a crash); fordoctor, every check is green1— every selected platform failed (fordoctor, at least one check failed)2— bad usage (unknown argument or command, empty/unmatched--onlylist)
Development
No build step, no bundler: plain ESM, node:test, and the three runtime
dependencies the panel actually shells out to.
npm run quota -- --json # run from a checkout (== node bin/token-quota.js)
npm run doctor
npm test # node --testLicense
MIT — see LICENSE.
