glm-quota-line

skill
Guvenlik Denetimi
Basarisiz
Health Uyari
  • License — License: MIT
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Low visibility — Only 8 GitHub stars
Code Basarisiz
  • os.homedir — User home directory access in src/claude/settings.js
  • process.env — Environment variable access in src/cli/index.js
Permissions Gecti
  • Permissions — No dangerous permissions requested

Bu listing icin henuz AI raporu yok.

SUMMARY

A lightweight CLI for showing GLM Coding Plan quota in the Claude Code status line.

README.md

glm-quota-line

Zero-dependency CLI for showing GLM Coding Plan quota in the Claude Code status line.

npm version node version license dependencies

简体中文

Overview

glm-quota-line reads the GLM quota endpoint, caches successful responses, and prints a single short line for statusLine.command.

It is intentionally scoped to one host only: Claude Code.

Why

  • Built for a single purpose: show GLM quota clearly in Claude Code
  • Small and predictable: no runtime dependencies, no unnecessary abstraction
  • Practical for real usage: cache-aware, session-aware, and easy to install

Features

  • Built for Claude Code statusLine.command
  • No runtime dependencies
  • Optional text, compact, and bar layouts
  • Optional ANSI color themes for dark and light terminals
  • Manual auth-token and base-url overrides for proxy or gateway setups
  • Automatic install and uninstall for Claude Code status line integration

Installation

Recommended:

npm install -g glm-quota-line

From a local clone:

npm install -g .

npx is fine for one-off previews, but global install is the better default for Claude Code integration because install writes a stable executable path into statusLine.command.

Quick Start

glm-quota-line install
glm-quota-line config set style bar
glm-quota-line config set theme ansi
glm-quota-line config set palette dark

For a one-off preview:

glm-quota-line --style compact

Output

GLM Lite | 5h left 91% | reset 14:47
GLM 91% | 14:47
GLM Lite ■□□□□□□□□□ 91% | 14:47

Recommended Setups

Use case Config
Dark terminal style=bar, theme=ansi, palette=dark
Light terminal style=compact, theme=ansi, palette=mono
Plain fallback any style, theme=plain

Color Presets

style controls layout. theme enables or disables ANSI color. palette only applies when theme=ansi.

  • Dark terminal: theme=ansi + palette=dark
  • Light terminal: theme=ansi + palette=mono
  • Maximum compatibility: theme=plain

Examples:

glm-quota-line config set style text
glm-quota-line config set theme ansi
glm-quota-line config set palette dark

glm-quota-line config set style compact
glm-quota-line config set theme ansi
glm-quota-line config set palette mono

glm-quota-line config set theme plain

Set NO_COLOR=1 to force plain output.

Manual Credential Overrides

If Claude Code is running behind a gateway or proxy and the injected ANTHROPIC_AUTH_TOKEN / ANTHROPIC_BASE_URL are not the real values, store explicit overrides:

glm-quota-line config set auth-token <your-real-token>
glm-quota-line config set base-url https://open.bigmodel.cn/api/anthropic

Clear them later with:

glm-quota-line config unset auth-token
glm-quota-line config unset base-url

Stored overrides take precedence over Claude-injected environment variables. config show redacts the token, but the local config file still stores the real value in plain text.

Commands

glm-quota-line [--style text|compact|bar] [--display left|used|both]
               [--theme plain|ansi] [--palette dark|mono]

glm-quota-line install [--force]
glm-quota-line uninstall
glm-quota-line config show
glm-quota-line config set style <text|compact|bar>
glm-quota-line config set display <left|used|both>
glm-quota-line config set theme <plain|ansi>
glm-quota-line config set palette <dark|mono>
glm-quota-line config set auth-token <token>
glm-quota-line config set base-url <url>
glm-quota-line config unset <style|display|theme|palette|auth-token|base-url>

Run glm-quota-line --help for the full command descriptions and examples.

Notes

  • Default output is plain text
  • Missing or expired auth returns GLM | auth expired
  • API or parsing failures return GLM | quota unavailable
  • install does not replace an unmanaged Claude status line unless --force is used
  • install --force backs up the previous entry and uninstall restores it when possible

License

MIT

Yorumlar (0)

Sonuc bulunamadi