quotacap 0.0.19 → 0.0.20

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 CHANGED
@@ -1,69 +1,63 @@
1
1
  # QuotaCap
2
2
 
3
- **Cross-harness AI quota dashboard + harness-callable advice.**
3
+ QuotaCap helps you get more from the AI coding subscriptions you already pay for: Claude Code, Codex, Kimi Code, and Grok. It tracks one current usage window and reset time for each plan, then estimates which plan to use next from remaining usage and recent pace when available.
4
4
 
5
- One place to see how much of each AI subscription you've used. Shows when it resets and what to burn next. Goal is 100% use at reset.
5
+ [![npm](https://img.shields.io/npm/v/quotacap)](https://www.npmjs.com/package/quotacap)
6
+ [![CI](https://github.com/carlosboeing/quotacap/actions/workflows/test.yml/badge.svg)](https://github.com/carlosboeing/quotacap/actions)
7
+ [![license](https://img.shields.io/github/license/carlosboeing/quotacap)](LICENSE)
8
+ [![node](https://img.shields.io/node/v/quotacap)](package.json)
6
9
 
7
- Polls pluggable adapters (Claude, Codex, Gemini, Kimi, Grok, OpenCode). Stores history in SQLite. Serves:
10
+ ## Features
8
11
 
9
- * **Web dashboard** at `http://localhost:8787` banner + 7-day strip + table with burn vs ideal. Includes stale badges and degraded banner.
10
- * **CLI** `quotacap` / `npx quotacap` `status`, `advise --json`, `ingest`, `web`, `init`, `daemon`
11
- * **MCP server** `get_quotas`, `get_recommendation`, `forecast` for any harness
12
+ - **Visibility**: remaining usage and reset time for one current window per connected plan
13
+ - **Pacing**: recent usage when history is available, or an estimated pace while QuotaCap collects it
14
+ - **Advice**: an estimate of which plan to use next so you can use more of each allowance without exhausting one early
15
+ - **Dashboard, CLI, and MCP**: the same data and advice on every surface
12
16
 
13
- Runs local-only by default. No prompts or file contents leave your machine.
17
+ ## Providers
18
+
19
+ | Provider | Source |
20
+ |---|---|
21
+ | Claude Code | Live |
22
+ | Codex | Live |
23
+ | Kimi Code | Live |
24
+ | Grok | Live |
25
+ | Antigravity / Gemini | Manual (`quotacap ingest`) |
26
+
27
+ Live adapters reuse the matching CLI login.
14
28
 
15
29
  ## Install
16
30
 
17
31
  ```bash
18
- # Binary — no Node needed (macOS + Linux, arm64/x64)
32
+ # Binary: macOS and Linux, arm64 and x64. No Node.
19
33
  curl -fsSL https://raw.githubusercontent.com/carlosboeing/quotacap/main/install.sh | sh
20
34
 
21
- # Or via npm (requires Node 22.13+; node:sqlite needs --experimental-sqlite before 22.13)
22
- npm install -g quotacap # global install
23
- npx quotacap # run without install
35
+ # Or install with npm (Node 22.13+)
36
+ npm install -g quotacap
24
37
  ```
25
38
 
26
- The binary is a self-contained Bun-compiled executable from GitHub Releases.
27
- The npm package runs the same CLI on Node. Both put `quotacap` on your PATH.
39
+ The binary is a self-contained executable from GitHub Releases.
40
+ The npm package runs the same CLI on Node. To run without a global install, replace `quotacap` with `npx quotacap` in any command, for example `npx quotacap web`.
28
41
 
29
42
  ## Quick start
30
43
 
31
44
  ```bash
32
- quotacap init
33
- quotacap ingest --provider kimi --text "Current week: 22% used · resets Aug 29 at 11am"
34
- quotacap status --json
35
- quotacap web # http://localhost:8787
36
- quotacap advise --json # tries HTTP, falls back to local DB
37
- quotacap advise --json --task heavy
38
- ```
39
-
40
- ## HTTP API
45
+ # Terminal 1: leave this running
46
+ quotacap init # writes ~/.quotacap/config.json
47
+ quotacap web # dashboard at http://localhost:8787
41
48
 
42
- ```bash
43
- curl http://localhost:8787/health
44
- curl http://localhost:8787/api/quotas
45
- curl "http://localhost:8787/api/recommendation?task=any"
46
- curl -X POST http://localhost:8787/api/refresh
49
+ # Terminal 2: after the dashboard table fills
50
+ quotacap status
51
+ quotacap advise
47
52
  ```
48
53
 
49
- * `GET /health` `{ok, uptime, lastPollAt}`
50
- * `GET /api/quotas` → `Quota[]` with `stale`, `ageMs`
51
- * `GET /api/recommendation?task=any` → `{use, reason, advisories}`
52
- * `POST /api/refresh` → `{fulfilled, rejected, lastPollAt, degraded}` — debounced 60s, always 200
53
- * `GET /` → `web/dist/index.html` if built, else `web/index.html`
54
+ `web` stays in the foreground and starts the daemon.
54
55
 
55
- ## CLI
56
+ For a provider without a live adapter:
56
57
 
58
+ ```bash
59
+ quotacap ingest --provider agy --text "65% used · resets Sep 1"
57
60
  ```
58
- quotacap status [--json]
59
- quotacap advise [--json] [--task any|heavy|light]
60
- quotacap ingest --provider <id> --text "..."
61
- quotacap web [--port 8787]
62
- quotacap daemon [--foreground]
63
- quotacap init
64
- ```
65
-
66
- `advise` fetches `http://localhost:$port/api/recommendation` with 2s timeout. Falls back to local `recommend()` when daemon is down.
67
61
 
68
62
  ## MCP
69
63
 
@@ -76,44 +70,34 @@ quotacap init
76
70
  ```
77
71
 
78
72
  Use `"command": "npx", "args": ["quotacap", "mcp"]` when installed via npm only.
79
- Tools: `get_quotas`, `get_recommendation`, `forecast`. Wrapper over HTTP. Set `QUOTACAP_URL` to override.
80
73
 
81
- ## How it works
74
+ Tools: `get_quotas`, `get_recommendation`, `forecast`.
82
75
 
83
- ```
84
- Adapters (claude-cli ✓, manual ✓, others → manual-paste)
85
- → daemon (poll 15m + jitter, SQLite ~/.quotacap/quotacap.db)
86
- → HTTP :8787
87
- → dashboard + CLI + MCP (same handler)
88
- ```
76
+ ## Privacy
89
77
 
90
- Adapters are isolated. One failure does not block others. Uses `Promise.allSettled` and per-adapter catch. `POST /api/refresh` always 200.
78
+ Bound to `127.0.0.1`, with usage history stored under `~/.quotacap/`. Live adapters contact provider usage endpoints or invoke the provider CLI using your existing login. Codex, Kimi, and Grok adapters may refresh expired OAuth tokens and update the CLI-owned credential file. QuotaCap stores no API keys.
91
79
 
92
- ## Config
80
+ ## Docs
93
81
 
94
- `~/.quotacap/config.json`:
82
+ - [Architecture](docs/architecture.md)
83
+ - [Changelog](docs/CHANGELOG.md)
84
+ - [Roadmap](docs/ROADMAP.md)
95
85
 
96
- ```json
97
- { "port": 8787, "pollMinutes": 15, "enabledProviders": ["claude"] }
98
- ```
86
+ ## License
99
87
 
100
- DB is `~/.quotacap/quotacap.db` (`quotas`, `snapshots`).
88
+ MIT. See [LICENSE](LICENSE).
101
89
 
102
- ## Development
90
+ <details>
91
+ <summary>Development</summary>
103
92
 
104
93
  ```bash
105
- npm test # vitest run (10 files) — builds first via pretest
94
+ npm test # vitest (builds first via pretest)
106
95
  bun test tests/bun/ # bun-runtime tests (sqlite adapter, MCP translation)
107
- npm run build # vite build → embed web assets → tsc → flatten dist → chmod bin
108
- npm run build:bin # bun build --compile (current platform, or pass targets)
109
- npx tsc --noEmit
96
+ npm run build
97
+ npm run build:bin
110
98
  ```
111
99
 
112
- The `store/db.ts` adapter picks `node:sqlite` on Node and `bun:sqlite` on Bun, so
113
- the same code runs as an npm package and as a compiled binary.
114
-
115
- See `.workbench/2-design/2026-08-28-quotacap-design.md` for spec. See `docs/ROADMAP.md` for next steps.
116
-
117
- ## License
100
+ The store uses `node:sqlite` on Node and `bun:sqlite` on Bun.
101
+ The same code is an npm package and a compiled binary.
118
102
 
119
- MIT — see [LICENSE](LICENSE).
103
+ </details>
@@ -1,2 +1,2 @@
1
1
  // generated by scripts/build-embed.mjs — do not edit
2
- export const VERSION = "0.0.19";
2
+ export const VERSION = "0.0.20";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // generated by scripts/build-embed.mjs — do not edit
2
- export const VERSION = "0.0.19";
2
+ export const VERSION = "0.0.20";
package/package.json CHANGED
@@ -1,11 +1,17 @@
1
1
  {
2
2
  "name": "quotacap",
3
- "version": "0.0.19",
3
+ "version": "0.0.20",
4
+ "description": "Local quota tracker for AI coding plans with a dashboard, CLI, MCP server, and next-plan recommendations.",
5
+ "license": "MIT",
6
+ "keywords": ["ai-coding", "cli", "mcp", "quota-tracker", "usage-limits", "usage-tracker", "claude-code", "codex", "kimi-code", "grok"],
4
7
  "type": "module",
5
8
  "repository": {
6
9
  "type": "git",
7
10
  "url": "git+https://github.com/carlosboeing/quotacap.git"
8
11
  },
12
+ "bugs": {
13
+ "url": "https://github.com/carlosboeing/quotacap/issues"
14
+ },
9
15
  "bin": {
10
16
  "quotacap": "dist/cli/index.js"
11
17
  },