{"_id":"@dustinober/glm-monitor","_rev":"2-569961d996ff48c9816fe54e7859f069","name":"@dustinober/glm-monitor","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@dustinober/glm-monitor","version":"1.0.0","keywords":["glm","usage","monitoring","dashboard","cli"],"license":"MIT","_id":"@dustinober/glm-monitor@1.0.0","maintainers":[{"name":"dustinober","email":"dustin@aiober.com"}],"homepage":"https://github.com/dustinober1/glm-monitor#readme","bugs":{"url":"https://github.com/dustinober1/glm-monitor/issues"},"bin":{"glm-monitor":"bin/glm-monitor.js"},"dist":{"shasum":"8517a13920a75467b15c4dd24e82ca0ef72b2d8f","tarball":"https://registry.npmjs.org/@dustinober/glm-monitor/-/glm-monitor-1.0.0.tgz","fileCount":11,"integrity":"sha512-jP98AmssxRVr9Eft7PDdNePojhcr21rZ4YvVMyuRsAhidNwavbLY/KqnotbNl0Tg0NkWTvtLeDWK2/wpUeSZEg==","signatures":[{"sig":"MEUCIEVCclVifpGePzo6l3oeJM6MpXiIy4ttL/1JqwzGwu/iAiEAkpiCWOxocZAv7bMf/QHEUh+UTi7YYGFeviD2UCAUo+A=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":258740},"type":"module","engines":{"node":">=18"},"gitHead":"06b6cd94bd5c2e0d6d7f2a04b0c67c555ab07d10","scripts":{"dev":"vite","build":"vite build","start":"node bin/glm-monitor.js start","collect":"node scripts/usage-collector.mjs","monitor":"node bin/glm-monitor.js monitor","prepare":"npm run build","preview":"vite preview"},"_npmUser":{"name":"dustinober","email":"dustin@aiober.com"},"repository":{"url":"git+https://github.com/dustinober1/glm-monitor.git","type":"git"},"_npmVersion":"11.6.2","description":"Professional dashboard for monitoring GLM Coding Plan API usage","directories":{},"_nodeVersion":"24.12.0","dependencies":{"opn":"^5.5.0","conf":"^15.0.2","chart.js":"^4.5.1","commander":"^14.0.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^5.0.0","puppeteer":"^24.34.0"},"_npmOperationalInternal":{"tmp":"tmp/glm-monitor_1.0.0_1767636321494_0.711383813273643","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@dustinober/glm-monitor","version":"1.0.1","description":"Professional dashboard for monitoring GLM Coding Plan API usage","homepage":"https://github.com/dustinober1/glm-monitor#readme","repository":{"type":"git","url":"git+https://github.com/dustinober1/glm-monitor.git"},"bugs":{"url":"https://github.com/dustinober1/glm-monitor/issues"},"type":"module","bin":{"glm-monitor":"bin/glm-monitor.js"},"scripts":{"prepare":"npm run build","collect":"node scripts/usage-collector.mjs","dev":"vite","build":"vite build","preview":"vite preview","start":"node bin/glm-monitor.js start","monitor":"node bin/glm-monitor.js monitor"},"keywords":["glm","usage","monitoring","dashboard","cli"],"dependencies":{"chart.js":"^4.5.1","commander":"^14.0.2","conf":"^15.0.2","opn":"^5.5.0"},"devDependencies":{"puppeteer":"^24.34.0","vite":"^5.0.0"},"engines":{"node":">=18"},"publishConfig":{"access":"public"},"license":"MIT","gitHead":"06b6cd94bd5c2e0d6d7f2a04b0c67c555ab07d10","_id":"@dustinober/glm-monitor@1.0.1","_nodeVersion":"24.12.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-YMQ8koTyLEK2JhzuesxzX2sUa/6lKnaOjwDxW9kmtMvzb/1hlQ9nhhN25PrXR8bdF1mm3vMxN1H7ReWyY2iA2Q==","shasum":"8492c2e8af90bda35d1212482d60add4a8589ba4","tarball":"https://registry.npmjs.org/@dustinober/glm-monitor/-/glm-monitor-1.0.1.tgz","fileCount":11,"unpackedSize":258740,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIF1S7lcL5J6Xk4M7kbB8zwa9vAsvE+sxeMhVFbbZ3oypAiEA8tLxgKRiT+q2iwCK0aANL/h1bGgWOP3B1rv+k/flP1c="}]},"_npmUser":{"name":"dustinober","email":"dustin@aiober.com"},"directories":{},"maintainers":[{"name":"dustinober","email":"dustin@aiober.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/glm-monitor_1.0.1_1767636612988_0.9372381626254114"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-05T18:05:21.408Z","modified":"2026-01-05T18:10:13.361Z","1.0.0":"2026-01-05T18:05:21.622Z","1.0.1":"2026-01-05T18:10:13.171Z"},"bugs":{"url":"https://github.com/dustinober1/glm-monitor/issues"},"license":"MIT","homepage":"https://github.com/dustinober1/glm-monitor#readme","keywords":["glm","usage","monitoring","dashboard","cli"],"repository":{"type":"git","url":"git+https://github.com/dustinober1/glm-monitor.git"},"description":"Professional dashboard for monitoring GLM Coding Plan API usage","maintainers":[{"name":"dustinober","email":"dustin@aiober.com"}],"readme":"# @dustinober/glm-monitor\n\nA professional dashboard for monitoring your GLM Coding Plan API usage and quotas. Track tokens, model calls, MCP tool usage, and quota limits in real-time.\n\n![Dashboard Overview](docs/images/dashboard-overview.png)\n\n## Features\n\n- 📊 **Real-time metrics** - Tokens, model calls, and MCP tool usage\n- 📈 **Historical charts** - 24-hour data retention with auto-refresh\n- ⚠️ **Quota alerts** - Visual warnings when approaching limits\n- 🔄 **Auto-refresh** - Dashboard updates every 30 seconds\n- 💾 **Persistent storage** - Data survives restarts\n- 📤 **Export** - Download data as CSV\n\n## Installation\n\n### Option 1: Global Install (Recommended)\n\n```bash\nnpm install -g @dustinober/glm-monitor\n```\n\nThis installs the `glm-monitor` CLI tool globally, available from anywhere.\n\n### Option 2: Project Install\n\n```bash\ngit clone <repo-url>\ncd glm-monitor\nnpm install\n```\n\n## Quick Start\n\n### 1. Initialize Configuration\n\n```bash\n# If globally installed\nglm-monitor init\n\n# Or if using project directly\nnpx @dustinober/glm-monitor init\n```\n\nYou can also set your token explicitly:\n\n```bash\nglm-monitor init -t \"YOUR_AUTH_TOKEN_HERE\"\n```\n\n### 2. Open Dashboard\n\n```bash\n# Automatically collects data, then opens dashboard\nnpm start\n\n# Or using the CLI:\nglm-monitor start\n```\n\nThe dashboard opens at `http://localhost:8080` (or `http://localhost:5173` in dev mode).\n\n**Data Collection:**\n- `npm start` / `glm-monitor start`: Collects fresh data before opening.\n- `npm run monitor`: Collects data and opens dashboard.\n- Use `--no-collect` to skip collection: `glm-monitor start --no-collect`\n\n## Dashboard Interface Guide\n\nThe dashboard provides a comprehensive view of your usage:\n\n### 1. Usage Overview Cards\nLocated at the top, these cards show your aggregate usage:\n- **Compute Tokens**: Total tokens consumed with trend indicator.\n- **API Manifestations**: Total number of model calls.\n- **MCP Tool Navigations**: Count of tool invocations (e.g., search, web-reader).\n\n### 2. Quota Status\nColor-coded indicators show your current standing against limits:\n- **Neural Token Capacity** (5-hour rolling):\n    - 🟢 **Green (<50%)**: Healthy usage.\n    - 🟡 **Yellow (50-80%)**: Approaching limit.\n    - 🔴 **Red (>80%)**: Critical usage.\n- **Temporal Access Quota** (monthly): Monitor your long-term consumption.\n\n### 3. Usage Trend Chart\nThe central chart visualizes usage over the last 24 hours:\n- **Left Axis (Bars)**: Token usage in millions.\n- **Right Axis (Line)**: Model calls.\n- **Data Points**: Hover over any bar to see precise timestamped data.\n- **Auto-Update**: The chart refreshes automatically every 30 seconds.\n\n## Automation\n\nSet up automatic data collection to keep your history complete without manual intervention.\n\n### macOS (launchd)\n\nCreate `~/Library/LaunchAgents/com.user.usage-monitor.plist`:\n\n```xml\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n  <key>Label</key>\n  <string>com.user.usage-monitor</string>\n  <key>ProgramArguments</key>\n  <array>\n    <string>/usr/local/bin/npm</string>\n    <string>run</string>\n    <string>collect</string>\n  </array>\n  <key>WorkingDirectory</key>\n  <string>/path/to/GLM_Dashboard</string>\n  <key>StartInterval</key>\n  <integer>300</integer>\n</dict>\n</plist>\n```\n\nLoad with:\n```bash\nlaunchctl load ~/Library/LaunchAgents/com.user.usage-monitor.plist\n```\n\n### Linux (cron)\n\nOpen crontab:\n```bash\ncrontab -e\n```\n\nAdd the following line to run every 5 minutes:\n```bash\n*/5 * * * * cd /path/to/GLM_Dashboard && npm run collect\n```\n\n## Data Storage & Configuration\n\n### Data Locations\n| Location | Purpose |\n|----------|---------|\n| `~/.glm-monitor/usage-history.json` | Persistent data storage (24h retention) |\n| `~/.glm-monitor/config.json` | Auth token and API settings |\n\n### Environment Variables\nYou can override configuration using environment variables:\n\n```bash\nexport ANTHROPIC_BASE_URL=\"https://api.z.ai/api/anthropic\"\nexport ANTHROPIC_AUTH_TOKEN=\"your-token-here\"\n```\n\n## API Endpoints\n\nThe collector queries these GLM Monitoring API endpoints:\n\n| Endpoint | Purpose |\n|----------|---------|\n| `/api/monitor/usage/model-usage` | Token and call statistics |\n| `/api/monitor/usage/tool-usage` | MCP tool invocation counts |\n| `/api/monitor/usage/quota/limit` | Current quota limits and usage |\n\n## Troubleshooting\n\n### \"token expired or incorrect\"\nYour auth token has expired. Re-initialize:\n```bash\nglm-monitor init -t \"YOUR_NEW_TOKEN\"\n```\n\n### No data showing in dashboard\n1. Run `npm run collect` to fetch initial data.\n2. Verify `~/.glm-monitor/usage-history.json` exists.\n3. Check browser console for errors.\n\n### Charts not updating\n1. Click the **\"Sync Now\"** button to manually refresh.\n2. Dashboard auto-refreshes every 30 seconds.\n3. Verify data file is being updated: `ls -la ~/.glm-monitor/`\n\n## License\n\nMIT\n","readmeFilename":"README.md"}