{"_id":"creditgauge","_rev":"18-0b0098b68ff29046a34ffcb70c49d106","name":"creditgauge","dist-tags":{"latest":"1.1.11"},"versions":{"1.0.0":{"name":"creditgauge","version":"1.0.0","keywords":["creditgauge"],"author":{"name":"chen"},"license":"ISC","_id":"creditgauge@1.0.0","maintainers":[{"name":"cwf818","email":"cwf818@gmail.com"}],"dist":{"shasum":"8788655fdb7d8284a9d04615b9a24ba7a4c917cb","tarball":"https://registry.npmjs.org/creditgauge/-/creditgauge-1.0.0.tgz","fileCount":2,"integrity":"sha512-xM5EwslA/lMz+vXLssLkVaBhO00nx6ot/Ju4V/aXgXZdF5j9rylh7XVrXZGdfvWvMUhZlsDUOP1OMwQ8UG3N+Q==","signatures":[{"sig":"MEUCIQCvzCRJfJhRgVLDystgjezC79Lo8oaDWqXcMUwoJViFOwIgG1NBtRG5t8rBCjibiarp3oHO5o0/+apyxIbY+qlVYnE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3118},"main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"cwf818","email":"cwf818@gmail.com"},"_npmVersion":"10.9.2","description":"CreditGauge package","directories":{},"_nodeVersion":"22.16.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/creditgauge_1.0.0_1783775889943_0.49922815575843815","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"creditgauge","version":"1.1.0","license":"MIT","_id":"creditgauge@1.1.0","maintainers":[{"name":"cwf818","email":"cwf818@gmail.com"}],"bin":{"creditgauge":"bin/cli.js"},"dist":{"shasum":"4c01aed911eaa501407e422553093acaee04d6a5","tarball":"https://registry.npmjs.org/creditgauge/-/creditgauge-1.1.0.tgz","fileCount":41,"integrity":"sha512-CfYKFKkqDyUEGZ+sv8OLludS3BHnnIrzWKn2uwBBWQAtWyY1d5WCG9yjujdxP9L8DW/vEC8371iNh/9zO3VCcw==","signatures":[{"sig":"MEYCIQDV8VbRyvqjt3RSNI9Ba0VfG2fGdph78+LpfKFafNgkfwIhALsNX6glbFp1ALD8G/EBIuv2LOzAJkb641Zr/yW+TaO1","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":881256},"type":"module","engines":{"node":">=18"},"gitHead":"bed8364b8a4046c10dfedb0368630c25647fb4ab","scripts":{"dev":"npm run build:entry -- --watch","test":"node --test --import tsx src/**/*.test.ts","build":"npm run build:entry && npm run build:plugins","typecheck":"tsc --noEmit","build:entry":"esbuild src/index.ts --bundle --platform=node --target=node18 --format=esm --outfile=dist/index.js","scripts:test":"bash scripts/test-edit-settings.sh","build:plugins":"node scripts/copy-builtin-plugins.mjs","dev:uninstall":"bash scripts/dev-uninstall.sh","prepublishOnly":"npm run build","settings:clean":"bash scripts/clean.sh","settings:install":"bash scripts/install.sh","settings:restore":"bash scripts/install.sh --restore","dev:uninstall:dry":"bash scripts/dev-uninstall.sh --dry-run","scripts:test:reset":"bash scripts/test-reset.sh","settings:clean:dry":"bash scripts/clean.sh --dry-run","scripts:test:rename":"bash scripts/test-rename-consistency.sh","scripts:test:install":"bash scripts/test-install.sh","settings:clean-cache":"bash scripts/clean-cache.sh","scripts:test:clean-cache":"bash scripts/test-clean-cache.sh","settings:clean-cache:dry":"bash scripts/clean-cache.sh --dry-run","settings:install:project":"bash scripts/install.sh --project"},"_npmUser":{"name":"cwf818","email":"cwf818@gmail.com"},"_npmVersion":"10.9.2","description":"Claude Code statusline plugin (CreditGauge) for MiniMax/DeepSeek token-plan usage and account balance. Ships an `npx creditgauge` TUI for install/uninstall/clean/diagnostics.","directories":{},"_nodeVersion":"22.16.0","dependencies":{"@clack/prompts":"^1.7.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.0","esbuild":"^0.24.0","typescript":"^5.5.0","@types/node":"^20.11.0"},"_npmOperationalInternal":{"tmp":"tmp/creditgauge_1.1.0_1784304457812_0.5933870062808062","host":"s3://npm-registry-packages-npm-production"}},"1.1.6":{"name":"creditgauge","version":"1.1.6","license":"MIT","_id":"creditgauge@1.1.6","maintainers":[{"name":"cwf818","email":"cwf818@gmail.com"}],"bin":{"creditgauge":"bin/cli.js"},"dist":{"shasum":"3d8c9f48ea8cf88f7db9305f90aa90bc7cd1174a","tarball":"https://registry.npmjs.org/creditgauge/-/creditgauge-1.1.6.tgz","fileCount":41,"integrity":"sha512-PtpUwu8YBzOQybcWwh2yi7hCIE+jXEruT34yir181k6S8YJq41BbqH1cr4UaCN6YQ7/RMPLn1D0XGasLmZSB7Q==","signatures":[{"sig":"MEYCIQDW7pKqRjiUNfLaqG0cnz+v+N0eCsVjA5YkXuQlaoGMBQIhAKS8e+Wamm1RVh0L/uX5Pyu7CUSGRjsxz4lmt3qlkOXJ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":884664},"type":"module","engines":{"node":">=18"},"gitHead":"41f8d31de16f87f2198bdd8481890e537840765b","scripts":{"dev":"npm run build:entry -- --watch","test":"node --test --import tsx src/**/*.test.ts","build":"npm run build:entry && npm run build:plugins","typecheck":"tsc --noEmit","build:entry":"esbuild src/index.ts --bundle --platform=node --target=node18 --format=esm --outfile=dist/index.js","scripts:test":"bash scripts/test-edit-settings.sh","build:plugins":"node scripts/copy-builtin-plugins.mjs","dev:uninstall":"bash scripts/dev-uninstall.sh","prepublishOnly":"npm run build","settings:clean":"bash scripts/clean.sh","settings:install":"bash scripts/install.sh","settings:restore":"bash scripts/install.sh --restore","dev:uninstall:dry":"bash scripts/dev-uninstall.sh --dry-run","scripts:test:reset":"bash scripts/test-reset.sh","settings:clean:dry":"bash scripts/clean.sh --dry-run","scripts:test:rename":"bash scripts/test-rename-consistency.sh","scripts:test:install":"bash scripts/test-install.sh","settings:clean-cache":"bash scripts/clean-cache.sh","scripts:test:clean-cache":"bash scripts/test-clean-cache.sh","settings:clean-cache:dry":"bash scripts/clean-cache.sh --dry-run","settings:install:project":"bash scripts/install.sh --project"},"_npmUser":{"name":"cwf818","email":"cwf818@gmail.com"},"_npmVersion":"10.9.2","description":"Claude Code statusline plugin (CreditGauge) for MiniMax/DeepSeek token-plan usage and account balance. Ships an `npx creditgauge` TUI for install/uninstall/clean/diagnostics.","directories":{},"_nodeVersion":"22.16.0","dependencies":{"@clack/prompts":"^1.7.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.0","esbuild":"^0.24.0","typescript":"^5.5.0","@types/node":"^20.11.0"},"_npmOperationalInternal":{"tmp":"tmp/creditgauge_1.1.6_1784335152336_0.061047983914880755","host":"s3://npm-registry-packages-npm-production"}},"1.1.7":{"name":"creditgauge","version":"1.1.7","license":"MIT","_id":"creditgauge@1.1.7","maintainers":[{"name":"cwf818","email":"cwf818@gmail.com"}],"bin":{"creditgauge":"bin/cli.js"},"dist":{"shasum":"28b4304df67dec63c3eb01e8270d99e5d6cee151","tarball":"https://registry.npmjs.org/creditgauge/-/creditgauge-1.1.7.tgz","fileCount":41,"integrity":"sha512-5ZFAgGrzPrVMcOidiG+mUuJdv4JqXOPRt/9fVQscF1MneAZFLmavDszjM3Blqz1MSRv8qaKMs4Lpnx+hLpNf8g==","signatures":[{"sig":"MEYCIQD1gYGyEiy0geuHE2WheBtfN3guWVP1H2i83Ty1h7efWgIhAIt3UhOix+k9kb+2yrCrp+8fFQUiK9ZZo0tz7EimVoIf","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":891808},"type":"module","engines":{"node":">=18"},"gitHead":"60e3318b2a386dd7758421c9219c135fd40ad97b","scripts":{"dev":"npm run build:entry -- --watch","test":"node --test --import tsx src/**/*.test.ts","build":"npm run build:entry && npm run build:plugins","typecheck":"tsc --noEmit","build:entry":"esbuild src/index.ts --bundle --platform=node --target=node18 --format=esm --outfile=dist/index.js","scripts:test":"bash scripts/test-edit-settings.sh","build:plugins":"node scripts/copy-builtin-plugins.mjs","dev:uninstall":"bash scripts/dev-uninstall.sh","prepublishOnly":"npm run build","settings:clean":"bash scripts/clean.sh","settings:install":"bash scripts/install.sh","settings:restore":"bash scripts/install.sh --restore","dev:uninstall:dry":"bash scripts/dev-uninstall.sh --dry-run","scripts:test:reset":"bash scripts/test-reset.sh","settings:clean:dry":"bash scripts/clean.sh --dry-run","scripts:test:rename":"bash scripts/test-rename-consistency.sh","scripts:test:install":"bash scripts/test-install.sh","settings:clean-cache":"bash scripts/clean-cache.sh","scripts:test:clean-cache":"bash scripts/test-clean-cache.sh","settings:clean-cache:dry":"bash scripts/clean-cache.sh --dry-run","settings:install:project":"bash scripts/install.sh --project"},"_npmUser":{"name":"cwf818","email":"cwf818@gmail.com"},"_npmVersion":"10.9.2","description":"Claude Code statusline plugin (CreditGauge) for MiniMax/DeepSeek token-plan usage and account balance. Ships an `npx creditgauge` TUI for install/uninstall/clean/diagnostics.","directories":{},"_nodeVersion":"22.16.0","dependencies":{"@clack/prompts":"^1.7.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.0","esbuild":"^0.24.0","typescript":"^5.5.0","@types/node":"^20.11.0"},"_npmOperationalInternal":{"tmp":"tmp/creditgauge_1.1.7_1784355068478_0.42648384736732914","host":"s3://npm-registry-packages-npm-production"}},"1.1.8":{"name":"creditgauge","version":"1.1.8","license":"MIT","_id":"creditgauge@1.1.8","maintainers":[{"name":"cwf818","email":"cwf818@gmail.com"}],"bin":{"creditgauge":"bin/cli.js"},"dist":{"shasum":"307c35bb487295e6bc901470cc7d3a80529e300c","tarball":"https://registry.npmjs.org/creditgauge/-/creditgauge-1.1.8.tgz","fileCount":57,"integrity":"sha512-Ta8uQ6kKpB9faKs3cCKjHNOdyVFe2eG01qUjBztJHXLasn6v2nGFO4tjZRqTMlhAGGEqxe0LkWTYR+yxHSe2UA==","signatures":[{"sig":"MEUCIQDkB43XCg4Vb5E9BfJXY7DclP2/cJ9xj7sPhBRx10vImQIgObxuu5nZXUUfUT28Hd1BaOUKoqET9DiXx3x9c7kEBsc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1006306},"type":"module","engines":{"node":">=18"},"gitHead":"e943b83d18e835055454a81891532733dbd152ae","scripts":{"dev":"npm run build:entry -- --watch","test":"node --test --import tsx src/**/*.test.ts","build":"npm run build:entry && npm run build:plugins","typecheck":"tsc --noEmit","build:entry":"esbuild src/index.ts --bundle --platform=node --target=node18 --format=esm --outfile=dist/index.js","scripts:test":"bash scripts/test-edit-settings.sh","build:plugins":"node scripts/copy-builtin-plugins.mjs","dev:uninstall":"bash scripts/dev-uninstall.sh","prepublishOnly":"npm run build","settings:clean":"bash scripts/clean.sh","settings:install":"bash scripts/install.sh","settings:restore":"bash scripts/install.sh --restore","dev:uninstall:dry":"bash scripts/dev-uninstall.sh --dry-run","scripts:test:reset":"bash scripts/test-reset.sh","settings:clean:dry":"bash scripts/clean.sh --dry-run","scripts:test:rename":"bash scripts/test-rename-consistency.sh","scripts:test:install":"bash scripts/test-install.sh","settings:clean-cache":"bash scripts/clean-cache.sh","scripts:test:clean-cache":"bash scripts/test-clean-cache.sh","settings:clean-cache:dry":"bash scripts/clean-cache.sh --dry-run","settings:install:project":"bash scripts/install.sh --project"},"_npmUser":{"name":"cwf818","email":"cwf818@gmail.com"},"_npmVersion":"10.9.2","description":"Claude Code statusline plugin (CreditGauge) for MiniMax/DeepSeek token-plan usage and account balance. Ships an `npx creditgauge` TUI for install/uninstall/clean/diagnostics.","directories":{},"_nodeVersion":"22.16.0","dependencies":{"@clack/prompts":"^1.7.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.0","esbuild":"^0.24.0","typescript":"^5.5.0","@types/node":"^20.11.0"},"_npmOperationalInternal":{"tmp":"tmp/creditgauge_1.1.8_1784602593894_0.8846554533474287","host":"s3://npm-registry-packages-npm-production"}},"1.1.9":{"name":"creditgauge","version":"1.1.9","author":{"name":"cwf818"},"license":"MIT","_id":"creditgauge@1.1.9","maintainers":[{"name":"cwf818","email":"cwf818@gmail.com"}],"homepage":"https://github.com/cwf818/creditgauge","bugs":{"url":"https://github.com/cwf818/creditgauge/issues"},"bin":{"creditgauge":"bin/cli.js"},"dist":{"shasum":"b7485fd8450f3777c3c343d30ee5d72c5d6c6139","tarball":"https://registry.npmjs.org/creditgauge/-/creditgauge-1.1.9.tgz","fileCount":59,"integrity":"sha512-Pa0DwcoyWcJiS/2fXSUYdGgjRKbvlSQLKuSkxVXd9MxpHEpfNLckSyECIVvzn/hFBKhDYiLbmQqrure7GIBcVQ==","signatures":[{"sig":"MEQCIHNmxdsjGtuAdc+fRYow3pOIha0XDarg6QQhyLXoyXIgAiApzK9Wy0Us+XHCNt79ag2uAywK8LO6gHL371dSOGkpuw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1060770},"type":"module","engines":{"node":">=18"},"gitHead":"cf398518253de9e5ab24202b913f4f5de3f2c81d","scripts":{"dev":"npm run build:entry -- --watch","test":"node --test --import tsx src/**/*.test.ts","build":"npm run build:entry && npm run build:plugins","typecheck":"tsc --noEmit","build:entry":"esbuild src/index.ts --bundle --platform=node --target=node18 --format=esm --outfile=dist/index.js","scripts:test":"bash scripts/test-edit-settings.sh","build:plugins":"node scripts/copy-builtin-plugins.mjs","dev:uninstall":"bash scripts/dev-uninstall.sh","prepublishOnly":"npm run build","settings:clean":"bash scripts/clean.sh","settings:install":"bash scripts/install.sh","settings:restore":"bash scripts/install.sh --restore","dev:uninstall:dry":"bash scripts/dev-uninstall.sh --dry-run","scripts:test:reset":"bash scripts/test-reset.sh","settings:clean:dry":"bash scripts/clean.sh --dry-run","scripts:test:rename":"bash scripts/test-rename-consistency.sh","scripts:test:install":"bash scripts/test-install.sh","settings:clean-cache":"bash scripts/clean-cache.sh","scripts:test:clean-cache":"bash scripts/test-clean-cache.sh","settings:clean-cache:dry":"bash scripts/clean-cache.sh --dry-run","settings:install:project":"bash scripts/install.sh --project"},"_npmUser":{"name":"cwf818","email":"cwf818@gmail.com"},"repository":{"url":"git+https://github.com/cwf818/creditgauge.git","type":"git"},"_npmVersion":"10.9.2","description":"Claude Code statusline plugin (CreditGauge) for MiniMax/DeepSeek token-plan usage and account balance. Ships an `npx creditgauge` TUI for install/uninstall/clean/diagnostics.","directories":{},"_nodeVersion":"22.16.0","dependencies":{"@clack/prompts":"^1.7.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.0","esbuild":"^0.24.0","typescript":"^5.5.0","@types/node":"^20.11.0"},"_npmOperationalInternal":{"tmp":"tmp/creditgauge_1.1.9_1784647395620_0.6269894953979784","host":"s3://npm-registry-packages-npm-production"}},"1.1.10":{"name":"creditgauge","version":"1.1.10","author":{"name":"cwf818"},"license":"MIT","_id":"creditgauge@1.1.10","maintainers":[{"name":"cwf818","email":"cwf818@gmail.com"}],"homepage":"https://github.com/cwf818/creditgauge#readme","bugs":{"url":"https://github.com/cwf818/creditgauge/issues"},"bin":{"creditgauge":"bin/cli.js"},"dist":{"shasum":"152b5246b38b7209d73e9e0a869401381428f3c1","tarball":"https://registry.npmjs.org/creditgauge/-/creditgauge-1.1.10.tgz","fileCount":53,"integrity":"sha512-9WxiW0Sx2QnBRq6Fu2hz+wOoYzLoIV2l56n0ce3+f9onh5LpuALpDXGpDL8eSj3MJsvrjnKkJuE0NKNHE5tosg==","signatures":[{"sig":"MEUCIBkIThgwEB+NwnGO7HmhCjZrlrCO7DcODUEUycd8w4BEAiEA0/F2VgcZs8dx8SGF0HV8rRHXYkzzG4LrBDi2q88CskM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":924931},"type":"module","engines":{"node":">=18"},"gitHead":"8cf2f7c954592dd0fd4cfb2a1dfb55f67a92963d","scripts":{"dev":"npm run build:entry -- --watch","test":"node --test --import tsx src/**/*.test.ts","build":"npm run build:entry && npm run build:plugins","typecheck":"tsc --noEmit","build:entry":"esbuild src/index.ts --bundle --platform=node --target=node18 --format=esm --outfile=dist/index.js","scripts:test":"bash scripts/test-edit-settings.sh","build:plugins":"node scripts/copy-builtin-plugins.mjs","dev:uninstall":"bash scripts/dev-uninstall.sh","prepublishOnly":"npm run build","settings:clean":"bash scripts/clean.sh","settings:install":"bash scripts/install.sh","settings:restore":"bash scripts/install.sh --restore","dev:uninstall:dry":"bash scripts/dev-uninstall.sh --dry-run","scripts:test:reset":"bash scripts/test-reset.sh","settings:clean:dry":"bash scripts/clean.sh --dry-run","scripts:test:rename":"bash scripts/test-rename-consistency.sh","scripts:test:install":"bash scripts/test-install.sh","settings:clean-cache":"bash scripts/clean-cache.sh","scripts:test:clean-cache":"bash scripts/test-clean-cache.sh","settings:clean-cache:dry":"bash scripts/clean-cache.sh --dry-run","settings:install:project":"bash scripts/install.sh --project"},"_npmUser":{"name":"cwf818","email":"cwf818@gmail.com"},"repository":{"url":"git+https://github.com/cwf818/creditgauge.git","type":"git"},"_npmVersion":"10.9.2","description":"Claude Code statusline plugin (CreditGauge) for MiniMax/DeepSeek token-plan usage and account balance. Ships an `npx creditgauge` TUI for install/uninstall/clean/diagnostics.","directories":{},"_nodeVersion":"22.16.0","dependencies":{"@clack/prompts":"^1.7.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.0","esbuild":"^0.24.0","typescript":"^5.5.0","@types/node":"^20.11.0"},"_npmOperationalInternal":{"tmp":"tmp/creditgauge_1.1.10_1784813408628_0.06931108957553977","host":"s3://npm-registry-packages-npm-production"}},"1.1.11":{"name":"creditgauge","version":"1.1.11","description":"Claude Code statusline plugin (CreditGauge) for MiniMax/DeepSeek token-plan usage and account balance. Ships an `npx creditgauge` TUI for install/uninstall/clean/diagnostics.","type":"module","author":{"name":"cwf818"},"repository":{"type":"git","url":"git+https://github.com/cwf818/creditgauge.git"},"bugs":{"url":"https://github.com/cwf818/creditgauge/issues"},"license":"MIT","bin":{"creditgauge":"bin/cli.js"},"dependencies":{"@clack/prompts":"^1.7.0"},"engines":{"node":">=18"},"scripts":{"prepublishOnly":"npm run build","build":"npm run build:entry && npm run build:plugins","build:entry":"esbuild src/index.ts --bundle --platform=node --target=node18 --format=esm --outfile=dist/index.js","build:plugins":"node scripts/copy-builtin-plugins.mjs","dev":"npm run build:entry -- --watch","typecheck":"tsc --noEmit","test":"node --test --import tsx src/**/*.test.ts","settings:install":"bash scripts/install.sh","settings:install:project":"bash scripts/install.sh --project","settings:restore":"bash scripts/install.sh --restore","settings:clean":"bash scripts/clean.sh","settings:clean:dry":"bash scripts/clean.sh --dry-run","settings:clean-cache":"bash scripts/clean-cache.sh","settings:clean-cache:dry":"bash scripts/clean-cache.sh --dry-run","scripts:test":"bash scripts/test-edit-settings.sh","scripts:test:install":"bash scripts/test-install.sh","scripts:test:clean-cache":"bash scripts/test-clean-cache.sh","scripts:test:reset":"bash scripts/test-reset.sh","scripts:test:rename":"bash scripts/test-rename-consistency.sh","dev:uninstall":"bash scripts/dev-uninstall.sh","dev:uninstall:dry":"bash scripts/dev-uninstall.sh --dry-run"},"devDependencies":{"@types/node":"^20.11.0","esbuild":"^0.24.0","tsx":"^4.7.0","typescript":"^5.5.0"},"_id":"creditgauge@1.1.11","gitHead":"76ac7809adf8ac5eb500f28309f7e2f70e2b1a56","homepage":"https://github.com/cwf818/creditgauge#readme","_nodeVersion":"22.16.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-c0Nsxgp5tS26sLMsFvu9sY6BMxWtNL2Y71rS/O5vgfOuPA7/K6g6nB8P/vgsB/kSoZAxC5586jfh62dbtmHLfg==","shasum":"7e3019476f69f8f62e1c3ff23cc01b5e3f61c8de","tarball":"https://registry.npmjs.org/creditgauge/-/creditgauge-1.1.11.tgz","fileCount":53,"unpackedSize":924931,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGGXJBpJU24ao6SLpOGQwCSnz6O/FROOUusTnDLs+m/EAiEA26+WhFcooo2eQg9aBhMgUti5SiUkt6wgHzL4sVxohkU="}]},"_npmUser":{"name":"cwf818","email":"cwf818@gmail.com"},"directories":{},"maintainers":[{"name":"cwf818","email":"cwf818@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/creditgauge_1.1.11_1785380878086_0.9482832789068298"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-11T13:18:09.888Z","modified":"2026-07-30T03:07:58.443Z","1.0.0":"2026-07-11T13:18:10.081Z","1.1.0":"2026-07-17T16:07:37.988Z","1.1.1":"2026-07-17T16:24:11.735Z","1.1.2":"2026-07-17T16:57:44.233Z","1.1.3":"2026-07-17T17:10:17.097Z","1.1.4":"2026-07-17T17:14:52.465Z","1.1.5":"2026-07-18T00:17:52.755Z","1.1.6":"2026-07-18T00:39:12.548Z","1.1.7":"2026-07-18T06:11:08.681Z","1.1.8":"2026-07-21T02:56:34.252Z","1.1.9":"2026-07-21T15:23:15.819Z","1.1.10":"2026-07-23T13:30:08.850Z","1.1.11":"2026-07-30T03:07:58.305Z"},"bugs":{"url":"https://github.com/cwf818/creditgauge/issues"},"author":{"name":"cwf818"},"license":"MIT","homepage":"https://github.com/cwf818/creditgauge#readme","repository":{"type":"git","url":"git+https://github.com/cwf818/creditgauge.git"},"description":"Claude Code statusline plugin (CreditGauge) for MiniMax/DeepSeek token-plan usage and account balance. Ships an `npx creditgauge` TUI for install/uninstall/clean/diagnostics.","maintainers":[{"name":"cwf818","email":"cwf818@gmail.com"}],"readme":"<pre>\n[upstream statusline lines]\nUsage: ▓▓▓▓░░░░ 40% (1h27m🕗 5h) · ▓▓░░░░░░ 20% (4d3h🕔 7d)    # Quota\nBalance: ¥110.00 · $3.5                                        # Balance\n</pre>\n\n# CreditGauge\n\n[![License](https://img.shields.io/github/license/cwf818/creditgauge)](LICENSE)\n[![Tag](https://img.shields.io/github/tag/cwf818/creditgauge)](https://github.com/cwf818/creditgauge/tags)\n[![Stars](https://img.shields.io/github/stars/cwf818/creditgauge)](https://github.com/cwf818/creditgauge/stargazers)\n\nA provider-agnostic Claude Code statusline plugin for **token-plan usage / remaining quota**. It picks what to render from `ANTHROPIC_BASE_URL`, so the same plugin works against any supported provider's plan endpoint — no per-provider re-install. Currently supported:\n\n- **MiniMax** — `Usage: …` / `Remain: …` (5-hour + weekly windows), from `/v1/token_plan/remains`\n- **DeepSeek** — `Balance: …` (account balance), from `/user/balance`\n\nFor vanilla Anthropic, OpenRouter, or any other provider not on the list above, the plugin **hides itself** and passes any chained upstream statusline through unchanged.\n\nWe deliberately don't reimplement the kitchen-sink statuslines that already exist for vanilla Anthropic — [`claude-hud`](https://github.com/jarrodwatts/claude-hud) and [`ccstatusline`](https://github.com/sirmalloc/ccstatusline) cover that. This plugin focuses on provider-specific **quota / balance** data, plus lightweight usage statistics read from Claude Code's stdin payload.\n\nANSI colors are 5-band (256-color SGR): bright green / dark green / yellow / orange / red. Applied to the displayed value + the colored bar segment; the empty part of the bar stays uncolored so it remains readable.\n\n## Snapshots\n\n**`simple` preset** (default `statuslineTemplate`, working with a pre-installed `claude-hud`) — minimal layout, single Quota line on its own:\n\n![toPGauge simple preset](https://github.com/cwf818/creditgauge/raw/main/screenshots/screenshot-simple.png)\n\n**`standard` preset** — context, memory, git, session / project / 5h-align / 7d-align scanners, m_sumTtlStatus tail, plus the live quota line:\n\n![toPGauge standard preset](https://github.com/cwf818/creditgauge/raw/main/screenshots/screenshot-standard.png)\n\n**`standard-slim` preset** — slim version of `standard`, contains context, memory, git, session / project / 5h-align / 7d-align scanners, m_sumTtlStatus tail, plus the live quota line:\n\n![toPGauge standard-slim preset](https://github.com/cwf818/creditgauge/raw/main/screenshots/screenshot-standard-slim.png)\n\n## Documentation\n\n- [**快速上手指南.md**](./快速上手指南.md) — 5-minute快速上手指南：效果、简介、安装、基本配置、插件、安全与协议。\n- [**MANUAL.md**](./MANUAL.md) — exhaustive configuration reference. Top-level schema, provider entries, presets, fragments, inline-args grammar, full `m_*` module catalog, recipes, plugin ABI.\n- [**HOW_TO_CREATE_A_PLUGIN.md**](./HOW_TO_CREATE_A_PLUGIN.md) — wire up a custom provider (kimi / moonshot / z.ai / etc.) without forking the plugin. User-side plugin ABI, fill contract, override resolution.\n- [**CHANGELOG.md**](./CHANGELOG.md) — per-version change history (breaking changes, new modules, removed aliases, schema upgrades).\n\n## Install\n\nThe plugin is a single-plugin marketplace. Install it in three steps:\n\n```\n/plugin marketplace add cwf818/creditgauge\n/plugin install creditgauge@creditgauge\n```\n\n> After the plugin install, run `/reload-plugins` so the loader picks up the new commands before wiring it into `settings.json`. Forgetting this step is the most common cause of \"command not found\" right after install.\n\nThen wire it into `settings.json`:\n\n```\n/creditgauge:install\n```\n\nThis patches the active `settings.json` (user-level by default; pass `--project` for project-level):\n\n### Install via npx (no marketplace required)\n\n```\nnpx creditgauge\n```\n\nLaunches a TUI (powered by @clack/prompts) with five options: Install,\nUninstall, Clean, View diagnostics, Exit. The TUI shells out to the same\n`scripts/*.sh` that the slash commands use, so behavior is identical.\n\nNon-interactive form (script-friendly):\n\n```\nnpx creditgauge install          # user-level\nnpx creditgauge install --project   # project-level\nnpx creditgauge uninstall\nnpx creditgauge clean --dry-run\nnpx creditgauge reset\nnpx creditgauge diagnostics      # last 20 plugin warning/error entries\nnpx creditgauge plugin add       # install a query plugin (interactive)\nnpx creditgauge plugin remove    # remove a query plugin\nnpx creditgauge plugin auth      # authenticate a query plugin\nnpx creditgauge plugin list      # list available plugins\nnpx creditgauge --version\nnpx creditgauge --help\n```\n\n> The plugin must be in Claude Code's cache first\n> (`~/.claude/plugins/cache/creditgauge/creditgauge/<version>/`).\n> If it isn't, `npx creditgauge install` prints a hint pointing at the\n> marketplace flow. Once installed once via marketplace, all subsequent\n> `npx creditgauge install` calls work.\n\n1. If `statusLine.command` already points to our wrapper (checked via `isOurWrapperCommand` — the command string itself, not the `_creditgauge_managed` marker), the command is a no-op.\n2. Otherwise, the current `settings.json` is backed up to `settings.json.bak.<ISO-timestamp>`.\n3. The original `statusLine.command` is preserved at `<claude-root>/plugins/creditgauge/state/upstream-cmd.sh` and `<claude-root>/plugins/creditgauge/state/upstream-cmd.txt` — sibling of `config.json`, **stable** across `/plugin install` rolls and cache wipes.\n4. The `statusLine` is rewritten to invoke our wrapper, which sets `CREDITGAUGE_UPSTREAM_CMD=<upstream-cmd.sh>` so the original statusline runs above our line.\n5. **`statusLine.refreshInterval` is managed**: if missing, it's created at `10`. If present and `> 10`, it's clamped down to `10` and a notice is printed to stdout (`install.sh: clamped statusLine.refreshInterval from N to 10 — set it back manually if you want to keep N`). Values `≤ 10` are left alone.\n\n`install.sh` auto-builds `dist/index.js` if it's missing (the marketplace install only copies source, not the bundle). Re-running the slash command is always a no-op once installed.\n\n### Install-journal (write-ahead log)\n\nEvery change `install.sh` makes to `settings.json` is recorded as a per-field entry in `<claude-root>/plugins/creditgauge/state/install-journal.json`. Three entry kinds:\n\n| `action`     | Meaning                                                            |\n| ------------ | ------------------------------------------------------------------ |\n| `create`     | The field did not exist before install; `after` is the value we wrote. |\n| `mutate`     | An existing field was changed; `before`/`after` snapshot both sides. |\n| `clamp-down` | An over-threshold value was clamped (e.g. `refreshInterval` 30 → 10). |\n\nEach entry has `{id, ts, action, before, after}`. The journal is the **authoritative record** of what install did — uninstall reads it (see below) to revert only the parts the user hasn't touched since. The journal itself lives in the **preserved** group (sibling of `config.json`), so `:uninstall` keeps it around unless you pass `--completely`. Hand-editing the file is supported; just keep the schema.\n\nIf you want to preview what install will do, run `/creditgauge:install --dry-run` first.\n\nIf your active `settings.json` doesn't exist at the project level, install creates a minimal one (with `permissions.defaultMode: bypassPermissions`). It does **not** copy from the user-level file.\n\n### Restore from backup\n\n```\n/creditgauge:install --restore\n```\n\nReplaces the active `settings.json` with the most recent `settings.json.bak.<ts>`. Useful if you want to roll back an edit that wasn't made by us.\n\n## Commands\n\nFour slash commands ship with the plugin:\n\n| Command                       | What it does                                                              |\n| ----------------------------- | ------------------------------------------------------------------------- |\n| `/creditgauge:install`           | Wire the wrapper into `settings.json` (or `--restore`).                  |\n| `/creditgauge:uninstall`         | Restore `settings.json`, wipe cache + marketplace + loader rows.         |\n| `/creditgauge:clean`             | Trim old `.bak.<ts>` files (keeps the most recent per file).             |\n| `/creditgauge:clean-cache`       | Remove stale version dirs from the plugin cache, keeping only the newest. |\n\nEach is a Pattern B2 slash command — the body is a `!`-fenced shell block that loads `scripts/<name>.sh` directly via `${CLAUDE_PLUGIN_ROOT}`, with `allowed-tools` scoped to that script. See [Project layout](#project-layout) for the file map.\n\n## Uninstall\n\n```\n/creditgauge:uninstall\n```\n\nThis is a self-contained cleanup that works even after the plugin's cache and marketplace have been wiped. It does all of the following:\n\n1. **Restore `statusLine`** — strategy in order:\n   - If `<claude-root>/plugins/creditgauge/state/install-journal.json` has unapplied entries, apply them **field-by-field**: each entry's `after` is compared against the *current* `settings.json`; matching fields are reverted (created → removed, mutated → restored to `before`, clamped → restored to `before`), and fields the user changed after install are left alone. This is the journal-driven path — the **default for any install that ran with the journal writer enabled**.\n   - Else (legacy / pre-journal install), fall back to `${CLAUDE_ROOT}/plugins/creditgauge/state/upstream-cmd.txt` (byte-for-byte restore of the original command).\n   - Else, fall back to the most recent `settings.json.bak.<ts>` whose `statusLine.command` does **not** point to our wrapper (the state before the plugin was installed).\n   - Else, strip the marker but leave the wrapper in place and print a warning.\n2. **Remove `creditgauge@creditgauge` from `settings.json.enabledPlugins`** (other plugins preserved).\n3. **Remove `creditgauge` from `settings.json.extraKnownMarketplaces`** (Claude Code records the marketplace source there too — leaving it would re-add the marketplace on next `/plugin marketplace add` with no visible diff).\n4. **Wipe** `cache/creditgauge/`, `marketplaces/creditgauge/`, and the loader's leftover `marketplaces/cwf818-creditgauge/` alias.\n5. **Strip the plugin's row** from `installed_plugins.json` and `known_marketplaces.json` (with timestamped `.bak.<TS>` backups).\n6. **Trim old `.bak.<ts>` files** — invokes `scripts/clean.sh` as the final step so uninstall leaves a tidy filesystem (one newest backup per file). User-named backups like `settings.json.bak-pre-v0.1.8` are NOT touched.\n\n`settings.json` and the two JSON files are backed up **before** any destructive change. Line endings (CRLF/LF) are preserved. The script is **idempotent** — re-running on a clean system prints `nothing to do` and exits 0. Add `--dry-run` to preview actions without modifying anything.\n\nThe `env` block of `settings.json` (including your `ANTHROPIC_AUTH_TOKEN`) is **not** touched. The script runs locally with no API calls and never reads `ANTHROPIC_AUTH_TOKEN`.\n\nAfter uninstall, re-install with the four-step flow:\n\n```\n/plugin marketplace add cwf818/creditgauge\n/plugin install creditgauge@creditgauge\n/reload-plugins\n/creditgauge:install\n```\n\nFor dev iteration, `npm run dev:uninstall` (or `npm run dev:uninstall:dry`) does the same thing from the command line.\n\n## Clean\n\n```\n/creditgauge:clean\n```\n\nRemoves the old `.bak.YYYYMMDDTHHMMSS` backup files our installer leaves behind, keeping only the most recent one per base file:\n\n- `settings.json.bak.<ts>` → keeps the newest\n- `installed_plugins.json.bak.<ts>` → keeps the newest\n- `known_marketplaces.json.bak.<ts>` → keeps the newest\n\nUser-named backups (e.g. `settings.json.bak-pre-v0.1.8`) are **not** touched — only the script-generated timestamp pattern. Idempotent: if at most one backup exists per file, prints `nothing to clean` and exits 0. Add `--dry-run` to preview.\n\nThe uninstall slash command already runs `clean.sh` as its final step, so explicit cleanup is usually unnecessary after a fresh uninstall. Use the clean command directly if you want to tidy up between installs, or if you've accumulated a lot of `.bak.<ts>` files from earlier dev iteration.\n\nFor dev iteration, `npm run settings:clean` (or `npm run settings:clean:dry`) does the same thing from the command line.\n\n## Clean cache\n\n```\n/creditgauge:clean-cache\n```\n\nEvery `/plugin install` rolls the cache forward — Claude Code creates a new `<version>` directory under `<cache>/creditgauge/` but does **not** remove the previous one. Old version dirs pile up over time (~40-50 MB each: full source tree + node_modules). The `statusLine.command` written by `:install` is already version-independent — it `ls -d`s every version dir, sorts by version, and `exec`s the highest — so old dirs are pure dead weight.\n\n`/creditgauge:clean-cache` walks the cache, finds all `^[0-9]+\\.[0-9]+\\.[0-9]+(\\.[0-9]+)?$` version directories, sorts numerically (so `0.2.10` sorts AFTER `0.2.9`, not lexically), keeps the newest, and removes the rest.\n\n**Safety:** non-version entries (`.in_use`, `.orphaned_at_*`, hidden dirs, files, anything not matching the version regex) are left untouched. Idempotent: re-running is a no-op once only the newest remains. Add `--dry-run` to preview.\n\n## How it composes with other statuslines\n\n- The wrapper script is `scripts/wrapper.sh`. If `CREDITGAUGE_UPSTREAM_CMD` is set, it runs that path as a bash script (`bash \"$CREDITGAUGE_UPSTREAM_CMD\"`), captures stdout, and exposes it to the plugin entry as the `CREDITGAUGE_UPSTREAM` env var. If unset, the wrapper runs the plugin as the sole statusline.\n- `CREDITGAUGE_UPSTREAM_CMD` is an **absolute path** to a bash script — `install.sh` writes one at `${CLAUDE_ROOT}/plugins/creditgauge/state/upstream-cmd.sh` whose body is `exec bash -c '<original-command>'`. This path is **stable** (sibling of `config.json`, NOT inside the per-version cache dir), so `/plugin install` rolls don't move it.\n- The plugin preserves interior newlines in upstream output and injects `\\x1b[0m` before its own line if upstream ends with an unclosed ANSI SGR — so multi-line, ANSI-colored upstream statuslines render correctly.\n\n## Activation\n\nThe plugin picks a **provider** from `ANTHROPIC_BASE_URL` and renders exactly one line:\n\n| `ANTHROPIC_BASE_URL`                    | Line                     | API                                                  |\n| --------------------------------------- | ------------------------ | ---------------------------------------------------- |\n| `https://api.minimaxi.com/anthropic`    | `Usage: …` / `Remain: …` | `GET https://www.minimaxi.com/v1/token_plan/remains` |\n| `https://api.deepseek.com/anthropic`    | `Balance: …`             | `GET https://api.deepseek.com/user/balance`          |\n| anything else (vanilla Anthropic, etc.) | (hidden)                 | —                                                    |\n\nBoth endpoints are called with `Authorization: Bearer $ANTHROPIC_AUTH_TOKEN` — the same token, no new env vars. The provider table lives in the `providers` config block (see [MANUAL.md §3](./MANUAL.md#3-providers)). On vanilla Anthropic, OpenRouter, or any other provider the plugin doesn't recognize, the line is hidden and any upstream output passes through unchanged.\n\n### MiniMax token-plan line\n\n<pre>\n Usage: ▓▓▓░░░░░ 38% (47m🕖 5h) · ▓▓▓░░░░░ 39% (4d47m🕓 7d)\nRemain: ░░░▓▓▓▓▓ 62% (47m🕖 5h) · ░░░▓▓▓▓▓ 61% (4d47m🕓 7d)\n</pre>\n\nTwo windows (5-hour + weekly), split-bar with colored percentage, reset\ncountdown in parentheses, window label after the countdown. The bar\nglyphs flip in remaining mode — both modes read left-to-right as\n\"what's spent → what's left\":\n\n- `used` mode: `▓▓▓▓▓░░░` — `▓` is consumed (colored), `░` is remaining (plain)\n- `remaining` mode: `░░░░░▓▓` — `░` is consumed (plain), `▓` is remaining (colored)\n\nThe reset countdown uses the shared time-formatting template:\n\n| Remaining | Rendered  | Note                                       |\n| --------- | --------- | ------------------------------------------ |\n| `-1ms`    | `0m`      | past-due, explicit \"this window has reset\" |\n| `30s`     | `<1m`     | sub-minUnit floor                          |\n| `5m`      | `5m`      |                                            |\n| `60m`     | `1h0m`    | internal zero preserved                    |\n| `90m`     | `1h30m`   |                                            |\n| `24h`     | `1d0h`    |                                            |\n\n`maxUnitCount` (default `2`) controls how many units are shown. Leading\nzeros are dropped (`0d0h5m` → `5m`); internal and trailing zeros are\nkept (`2h0m` → `2h0m`, NOT `2h`). See `timeFormat.maxUnitCount` in\n[MANUAL.md §2](./MANUAL.md#2-top-level-schema) for the full set of options.\n\n### DeepSeek balance line\n\nWhen `ANTHROPIC_BASE_URL` matches the configured `providers.deepseek` entry (default: exact match against `https://api.deepseek.com/anthropic`), the plugin fetches the user's account balance and renders:\n\n```\nBalance: ¥110.00             # is_available=true, single CNY entry\nBalance: $25.00               # is_available=true, single USD entry\nBalance: ¥110 · $3.5         # multi-currency: ALL entries from balance_infos,\n                             # joined by ' · ', single color band from the\n                             # LOWEST balance (most urgent currency drives hue).\nBalance: not available!       # is_available=false or no parseable entries\n```\n\nPer-currency display prefix: `USD` → `$`, `CNY` / `RMB` → `¥`. Any other\ncurrency code is rendered as itself, uppercased (e.g. `EUR42.50`).\n\n5-band color thresholds on the **lowest** entry's numeric value\n(`thresholds.balanceBands`, default `[5, 10, 20, 50]`) — see [MANUAL.md §2](./MANUAL.md#2-top-level-schema).\n\n## Display mode\n\nDefault mode is **`used`** — the line begins with `Usage:` and the percentage shown is the percentage of the window you've consumed. The colored bar segment represents the consumed portion.\n\nSwitch to `remaining` mode via the config file:\n\n```json\n{ \"display\": \"remaining\" }\n```\n\nSee [MANUAL.md §2](./MANUAL.md#2-top-level-schema) for the full schema.\n\nIn remaining mode the line begins with `Remain:` and the percentage is what's left; the colored bar segment represents the remaining portion.\n\n`display` is MiniMax-only — DeepSeek's `Balance:` line doesn't have a percentage to flip. The window / context-window / mem-usage modules (`m_windowQuota|term:short|mid|long`, `m_windowContext`, `m_windowMemUsage`) also accept an inline `|display:used|remaining` override that takes precedence over the global `display` for that one module.\n\n## Configuration\n\nThe full schema (top-level keys, provider entries, presets, fragments, inline-args grammar, module reference) lives at [MANUAL.md §2 Configuration](./MANUAL.md#2-top-level-schema).\n\nPath:\n\n- **Unix**: `~/.claude/plugins/creditgauge/config.json`\n- **Windows**: `%USERPROFILE%\\.claude\\plugins\\creditgauge\\config.json`\n\nLoaded once at startup. **Missing file** → all defaults. **Malformed JSON** or a **single bad field** → one stderr line (`creditgauge: config <reason>; using defaults`) and the default for _that_ field only — the rest of your config is still honored. The plugin never blanks the statusline on bad config.\n\nA reference with every field is at [config.example.json](./config.example.json). Copy it to the path above and edit.\n\n## Diagnostics log\n\nOpt-in JSONL log of plugin-internal events. Gated by two-level AND-gate:\n\n1. Set the env var: `export CREDITGAUGE_DIAGNOSTICS_ENABLE=1`\n2. Pick slices in `state/config.json`:\n   ```json\n   { \"debug\": { \"stdin\": true, \"cache\": true } }\n   ```\n\nBoth must be truthy — env alone is no longer enough (v0.10.x behavior\nchange). 8 subkeys: `stdin`, `statusStore`, `config`, `cache`,\n`statCache`, `smokeNormalizeTick`, `pluginVersion`, `parse`. See\n[MANUAL.md SS20](./MANUAL.md#20-debug-logging) for the full subkey\ntable, truthy-value rules, and file location.\n\nThe log file lives at:\n```\n~/.claude/plugins/creditgauge/state/<projectHash>/diagnostics.jsonl\n```\n\nCapped at the last 1000 entries. Use it as a postmortem trail —\n`tail -f` while debugging, or `grep` by level and source. Wipe with\n`/creditgauge:reset` (per-project) or `/creditgauge:clean --purge-runtime`\n(all projects).\n\n## Auth\n\nThe plugin reuses `process.env.ANTHROPIC_AUTH_TOKEN` to call the provider's plan endpoint. **No new env vars.** See [SECURITY.md](./SECURITY.md) for how the token is handled.\n\n## Caching\n\nThe Claude Code statusline is updated in response to interaction events by default (every prompt, every tool result). Starting with **Claude Code 2.1.97**, the `statusLine.refreshInterval` field is honored, letting the statusline refresh on a fixed cadence instead. Two scopes of \"refresh interval\" are involved and they're independent:\n\n- **This plugin's 60 s TTL** — how long we cache a successful API response before re-fetching. MiniMax and DeepSeek have different rate-limit policies and refresh cadences; 60 s is a deliberate default that keeps the statusline responsive without hammering the API. Cache entries are shadowed to disk under `state/<projectHash>/cache.json` (sibling of `config.json`, wiped by `:uninstall`), so the TTL is honored **across per-tick child-process spawns** — the second tick within 60 s reuses the first tick's value instead of re-fetching. Per-project isolation: `render.ts` prefixes every cache key with `<projectHash>:` so different projects never collide on the same `cache.json`.\n- **Claude Code's `statusLine.refreshInterval`** — how often the harness invokes the statusline command. Set in `~/.claude/settings.json` independently of this plugin:\n\n  ```json\n  {\n    \"statusLine\": {\n      \"type\": \"command\",\n      \"command\": \"...\",\n      \"refreshInterval\": 60\n    }\n  }\n  ```\n\n  Unit is **seconds** (not milliseconds — that's a frequent footgun; the harness will reject or misbehave on values like `30000`). For this plugin, **30–120 s is a sensible range**: shorter than the 60 s TTL is wasted, much longer and the line lags behind reality. The `refreshInterval` value does **not** affect the API-call TTL — they are independent knobs.\n\n  This plugin **manages `statusLine.refreshInterval`** as part of `:install`: if the field is missing, it's created at `10`; if it exceeds `10`, it's clamped down to `10` (with a stdout notice). See [Install-journal](#install-journal-write-ahead-log) below. Set it back manually if you want a higher cadence — uninstall will respect whatever value you chose.\n\n### Failure handling\n\nThree outcomes when the provider API is called:\n\n| Outcome                    | What you see on the statusline                                                                                                                                                |\n| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Fresh fetch                | The normal `Usage: …` / `Balance: …` line, no suffix on the default template. (Includes within-TTL cache hits — the broken-chain suffix is reserved for stale state. If your template includes `m_age`, you'll see a healthy `🔗 X ago` here instead.) |\n| Fetch failed, cache exists | The last good value, **with a dim `⛓️‍💥 X ago` suffix** at the end (e.g. `Balance: ¥110 ⛓️‍💥 5m ago`). The broken-chain emoji IS the indicator (no leading separator).   |\n| Fetch failed, no cache     | `Usage: not available!` (MiniMax) or `Balance: not available!` (DeepSeek) in red. Plugin is alive but the provider is unreachable.                                            |\n\nThe `X ago` format uses the **same template as the reset countdown**:\nd/h/m units, `maxUnitCount=2` default, drop leading zeros but keep\ninternal/trailing zeros. Sub-minute follows `timeFormat.minUnit`:\n`minUnit=\"m\"` → `<1m ago`; `minUnit=\"s\"` → `${seconds}s ago`. Examples\n(with default `minUnit=\"s\"`):\n\n| Cached age  | Rendered suffix        |\n| ----------- | ---------------------- |\n| 30 s        | `⛓️‍💥 30s ago`          |\n| 5 min       | `⛓️‍💥 5m ago`           |\n| 90 min      | `⛓️‍💥 1h30m ago`         |\n| 24 h        | `⛓️‍💥 1d0h ago`          |\n\nThe hard-fail `not available!` line intentionally has no age suffix\nbecause there is no cached value to be stale-OF.\n\n## Develop\n\n```bash\nnpm install\nnpm run typecheck    # tsc --noEmit\nnpm test             # node --test --import tsx src/**/*.test.ts\nnpm run build        # esbuild → dist/index.js\nnpm run dev          # esbuild --watch\n```\n\n### Per-tick pipeline\n\nThe per-tick pipeline is split between **data-processor (writes)** and **render (reads)** — owned by `src/data-processor.ts` and `src/tick-state.ts`. The render code (`src/render.ts`) is **read-only** against `tickState.pending`; it never calls `tickState.mark` / `setAvg` / `setPrevTick` / `setLastSpeed` / `setLastApiMs` / `setLastTokenHitRate`. Writes are coalesced into a single `commit()` flush per tick — at most one full-file rewrite of `state/<projectHash>/status.json` even on active renders.\n\n### Response shape\n\nThe MiniMax plugin (`src/plugins/minimax/index.js`) projects the raw response into canonical `Quota` directly — there's no host-side parser layer to describe here. See [HOW_TO_CREATE_A_PLUGIN.md](./HOW_TO_CREATE_A_PLUGIN.md) for the plugin ABI and `src/plugins/minimax/index.js` for the worked example.\n\nIf `base_resp.status_code ≠ 0`, the response is treated as failure and the line is omitted.\n\nThe verified real shape (captured against `https://www.minimaxi.com/v1/token_plan/remains`):\n\n```json\n{\n  \"model_remains\": [\n    {\n      \"model_name\": \"...\",\n      \"current_interval_remaining_percent\": 60,\n      \"current_weekly_remaining_percent\": 92,\n      \"end_time\": \"...\",\n      \"weekly_end_time\": \"...\"\n    }\n  ],\n  \"base_resp\": { \"status_code\": 0 }\n}\n```\n\nThe plugin picks the entry with the **lowest interval remaining %** as the source of truth (the most-active model). If you capture a fresh response and the shape diverges, save it as `src/__fixtures__/remains.real.json` and tighten the parser in `src/api.plan.ts`.\n\nThe DeepSeek response shape is simpler — `{ is_available: bool, balance_infos: [{ currency, total_balance, granted_balance, topped_up_balance }, ...] }` — and the parser iterates **all** entries so every currency the account holds is rendered.\n\n### Dev loop: re-installing the plugin from scratch\n\nWhen iterating on the install flow (changes to `scripts/install.sh`, `scripts/uninstall.sh`, the slash commands, the version, etc.) you need to fully wipe the plugin's on-disk state before `/plugin install` will re-fetch a clean copy. The plugin loader caches marketplace state and refuses to bump an already-installed plugin — on Windows this surfaces as `EPERM: operation not permitted, rename ... -> ... .bak`.\n\nUse the bundled dev helper (does **not** touch `settings.json` — your statusLine is preserved):\n\n```bash\n# Preview what will be removed:\nnpm run dev:uninstall:dry\n\n# Wipe creditgauge state:\nnpm run dev:uninstall\n```\n\nIt removes:\n\n- the creditgauge row from `installed_plugins.json` and `known_marketplaces.json` (with timestamped `.bak.<ts>` backups of both files).\n- `cache/creditgauge/`, `marketplaces/creditgauge/`, and the loader's leftover `marketplaces/cwf818-creditgauge/` directory.\n\nThen re-install:\n\n```\n/plugin marketplace add cwf818/creditgauge\n/plugin install creditgauge@creditgauge\n/reload-plugins\n/creditgauge:install\n```\n\nIf the loader still says \"EPERM\" after `dev:uninstall`, the most common cause is a Claude Code process holding a file lock on the marketplace dir. **Quit all running Claude Code sessions** (not just this one) and re-run `npm run dev:uninstall`.\n\n## Project layout\n\n```\nsrc/\n  index.ts            # entry — stdin drain, provider dispatch, cache, render, compose\n  types.ts            # Provider = string | null; ProviderType / CompareMethod / ProviderEntry\n  providers.ts        # URL matching, fetcher / template / fail-label dispatch\n  api.plan.ts         # Quota fetch + tolerant parser for /v1/token_plan/remains\n  api.balance.ts      # BALANCE fetch + parser for /user/balance\n  api.quote.ts        # m_quote remote fetch + dot-path scan\n  quotes.ts           # bundled quotes.json (100+ bilingual entries) — m_quote local fallback\n  render.ts           # read-only against tickState.pending; MODULES + INLINE_RENDERERS + INLINE_SCHEMAS dispatchers\n  data-processor.ts   # processTick + setPrevTick + setAvg + setLastSpeed/ApiMs/TokenHitRate — owns ALL writes to tickState.pending\n  tick-state.ts       # per-tick in-memory Store: beginTick / mark / commit\n  status-store.ts     # three-layer acc (session/project/model) + cold-slot JSONL replay + stat cache\n  cache.ts            # 60s TTL + stale-on-error; per-project cache.json shadowing\n  composition.ts      # reads CREDITGAUGE_UPSTREAM, prepends (preserving ANSI/multi-line) and appends line\n  config.ts           # loads ~/.claude/plugins/creditgauge/config.json; module-level singleton store\n  diagnostics.ts      # JSONL append logger (opt-in via CREDITGAUGE_DIAGNOSTICS_ENABLE); 1000-line cap\n  dispatch.ts         # providerType → module-set dispatch (provider-aware gating)\n  git-info.ts         # m_branch / m_gitStatus read-side helpers (cwd-based)\n  session-parse.ts    # parseTokenSnapshot — stdin JSON → TokenSnapshot; m_tokenTotalIn invariant check\n  token-store.ts      # append-only JSONL state file at state/<projectHash>/<sessionId>.jsonl for m_acc* / m_sum*\n  __fixtures__/       # remains.real.json, balance.real.json, balance.multi.json, …\n  *.test.ts           # node:test unit tests\n.claude-plugin/\n  plugin.json         # plugin manifest (declares commands, version, keywords)\n  marketplace.json    # single-plugin marketplace wiring\ncommands/\n  install.md          # /creditgauge:install slash command\n  uninstall.md        # /creditgauge:uninstall slash command\n  clean.md            # /creditgauge:clean slash command\n  clean-cache.md      # /creditgauge:clean-cache slash command\nscripts/\n  wrapper.sh          # bash wrapper: CREDITGAUGE_UPSTREAM_CMD → CREDITGAUGE_UPSTREAM → us\n  install.sh          # settings.json patcher (install only)\n  uninstall.sh        # self-contained uninstaller (used by :uninstall and dev:uninstall)\n  clean.sh            # trim old .bak.<ts> files; --purge-runtime also wipes state/<projectHash>/{cache.json,diagnostics.jsonl,*.jsonl}\n  clean-cache.sh      # prune old version dirs under cache/creditgauge/, keep newest\n  migrate-state.sh    # legacy state/token-samples/<hash>/<sid>.jsonl → state/<hash>/<sid>.jsonl\n  dev-uninstall.sh    # DEV-ONLY thin shim → exec uninstall.sh\n  lib/edit-settings.mjs  # ESM helper used by install.sh\n  test-edit-settings.sh  # shell regression tests for edit-settings.mjs\n  test-install.sh        # shell regression tests for install.sh (isolated tmpdir)\n  test-clean-cache.sh    # shell regression tests for clean-cache.sh\nsettings.example.json # template (NEVER commit real settings.json)\n```\n\n## What's new\n\n**v1.1.9** — Token cost tracking at processTick time (cost stored in JSONL + accumulator, survives across sessions via replay); dedicated `config.tokenPrices.json` with 5-layer cascade; default provider filter on `m_sum*` modules now defaults to all models instead of active-only; install-journal change report display with tiered command handling; ⏱️ API ms integrated into default statusline preset; unified ¥ (U+00A5) symbol; fix uninstall.sh `set -u` crash.\n\n**v1.1.8** — New `creditgauge-plugin` CLI (`npx creditgauge plugin add/remove/auth/list`) for query plugin lifecycle management; new opencode.ai workspace quota plugin; query plugin metadata registry (`query_plugins/plugins.json`). Supports `opencode`, `bigmodel`, `copilot-api`, `kimi` out of the box.\n\n**v1.1.7** — New `npx creditgauge install` (auto-mirrors into plugin cache on cache miss, no marketplace required); new `/creditgauge:reset` slash command to wipe per-project runtime caches; new `standard-slim` preset with compressed header row and reduced spacing.\n\n**v1.0.0** — Renamed from `topgauge` to `creditgauge` (hard cut, no compat shim). See CHANGELOG for the rename history (`tokenplan-usage-hud` → `topgauge` v0.7.0 → `creditgauge` v1.0.0).\n\n**v0.9.7** — Install-journal: `install.sh` records every per-field change to `settings.json.statusLine` to a write-ahead log; `uninstall.sh` reverts field-by-field, preserving any field the user touched after install.\n\n**v0.9.6** — `m_sumEstQuota|term:short` projects the spent cost up to a full-period spend using the aligned plan window's `used%`. Renders `est:$30.20` (fixed 2dp, per-model currency). Prefix is configurable via `labels.labelEstQuota` (default `\"est:\"`).\n\n> Requires `tokenPrices.<modelId>` to be configured for the target model (see MANUAL §m_tokenCost). Without it, the module renders `est:n/a`.\n\n## License\n\nMIT — see [LICENSE](./LICENSE).","readmeFilename":"README.md"}