npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dustinober/glm-monitor

v1.0.1

Published

Professional dashboard for monitoring GLM Coding Plan API usage

Readme

@dustinober/glm-monitor

A 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.

Dashboard Overview

Features

  • 📊 Real-time metrics - Tokens, model calls, and MCP tool usage
  • 📈 Historical charts - 24-hour data retention with auto-refresh
  • ⚠️ Quota alerts - Visual warnings when approaching limits
  • 🔄 Auto-refresh - Dashboard updates every 30 seconds
  • 💾 Persistent storage - Data survives restarts
  • 📤 Export - Download data as CSV

Installation

Option 1: Global Install (Recommended)

npm install -g @dustinober/glm-monitor

This installs the glm-monitor CLI tool globally, available from anywhere.

Option 2: Project Install

git clone <repo-url>
cd glm-monitor
npm install

Quick Start

1. Initialize Configuration

# If globally installed
glm-monitor init

# Or if using project directly
npx @dustinober/glm-monitor init

You can also set your token explicitly:

glm-monitor init -t "YOUR_AUTH_TOKEN_HERE"

2. Open Dashboard

# Automatically collects data, then opens dashboard
npm start

# Or using the CLI:
glm-monitor start

The dashboard opens at http://localhost:8080 (or http://localhost:5173 in dev mode).

Data Collection:

  • npm start / glm-monitor start: Collects fresh data before opening.
  • npm run monitor: Collects data and opens dashboard.
  • Use --no-collect to skip collection: glm-monitor start --no-collect

Dashboard Interface Guide

The dashboard provides a comprehensive view of your usage:

1. Usage Overview Cards

Located at the top, these cards show your aggregate usage:

  • Compute Tokens: Total tokens consumed with trend indicator.
  • API Manifestations: Total number of model calls.
  • MCP Tool Navigations: Count of tool invocations (e.g., search, web-reader).

2. Quota Status

Color-coded indicators show your current standing against limits:

  • Neural Token Capacity (5-hour rolling):
    • 🟢 Green (<50%): Healthy usage.
    • 🟡 Yellow (50-80%): Approaching limit.
    • 🔴 Red (>80%): Critical usage.
  • Temporal Access Quota (monthly): Monitor your long-term consumption.

3. Usage Trend Chart

The central chart visualizes usage over the last 24 hours:

  • Left Axis (Bars): Token usage in millions.
  • Right Axis (Line): Model calls.
  • Data Points: Hover over any bar to see precise timestamped data.
  • Auto-Update: The chart refreshes automatically every 30 seconds.

Automation

Set up automatic data collection to keep your history complete without manual intervention.

macOS (launchd)

Create ~/Library/LaunchAgents/com.user.usage-monitor.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>com.user.usage-monitor</string>
  <key>ProgramArguments</key>
  <array>
    <string>/usr/local/bin/npm</string>
    <string>run</string>
    <string>collect</string>
  </array>
  <key>WorkingDirectory</key>
  <string>/path/to/GLM_Dashboard</string>
  <key>StartInterval</key>
  <integer>300</integer>
</dict>
</plist>

Load with:

launchctl load ~/Library/LaunchAgents/com.user.usage-monitor.plist

Linux (cron)

Open crontab:

crontab -e

Add the following line to run every 5 minutes:

*/5 * * * * cd /path/to/GLM_Dashboard && npm run collect

Data Storage & Configuration

Data Locations

| Location | Purpose | |----------|---------| | ~/.glm-monitor/usage-history.json | Persistent data storage (24h retention) | | ~/.glm-monitor/config.json | Auth token and API settings |

Environment Variables

You can override configuration using environment variables:

export ANTHROPIC_BASE_URL="https://api.z.ai/api/anthropic"
export ANTHROPIC_AUTH_TOKEN="your-token-here"

API Endpoints

The collector queries these GLM Monitoring API endpoints:

| Endpoint | Purpose | |----------|---------| | /api/monitor/usage/model-usage | Token and call statistics | | /api/monitor/usage/tool-usage | MCP tool invocation counts | | /api/monitor/usage/quota/limit | Current quota limits and usage |

Troubleshooting

"token expired or incorrect"

Your auth token has expired. Re-initialize:

glm-monitor init -t "YOUR_NEW_TOKEN"

No data showing in dashboard

  1. Run npm run collect to fetch initial data.
  2. Verify ~/.glm-monitor/usage-history.json exists.
  3. Check browser console for errors.

Charts not updating

  1. Click the "Sync Now" button to manually refresh.
  2. Dashboard auto-refreshes every 30 seconds.
  3. Verify data file is being updated: ls -la ~/.glm-monitor/

License

MIT