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 🙏

© 2025 – Pkg Stats / Ryan Hefner

cli-cursor-usage-tracker

v1.3.2

Published

A CLI tool to track and visualize your Cursor AI usage and cost in dollars

Readme

Cursor Usage Tracker (Deprecated)

A command-line tool to track and visualize your Cursor AI premium request usage, with color-coded indicators.

npm version License: MIT

image

Features

  • 🤖 Tracks usage of Cursor AI premium requests usage
  • 💰 Displays usage-based premium requests cost (if enabled)
  • 🎨 Color-coded usage indicators (changes from blue → yellow → red as limits approach)
  • 📊 Display shows percentage of quota and dollar limit used
  • 📅 Shows billing cycle information with locale-aware date formatting
  • 🔄 Always fetches fresh data for accurate reporting
  • 💾 Stores your credentials locally for easy access

Installation

Option 1: Global Installation (Recommended)

Install the package globally from npm:

npm install -g cli-cursor-usage-tracker

That's it! Now you can run:

$ cursor-usage

Anywhere in your terminal to check your Cursor AI usage! 🎉

Option 2: Local Development

  1. Clone this repository:

    git clone [email protected]:g-guerzoni/cli-cursor-usage-tracker.git
    cd cli-cursor-usage-tracker
  2. Install dependencies:

    npm install
  3. Build the project:

    npm run build

Usage

Using the Global Command

If you installed the package globally, simply run:

cursor-usage

Available Options

  • --clean: Remove all local configuration files and cached data
    cursor-usage --clean
    Use this if you want to reset the tool's configuration or start fresh.

Running Locally

If you're working with the local development version:

npm start

To clean local configuration files:

npm run clean

On first run, you'll be prompted to choose an authentication method:

  1. Import from curl command (recommended) - Just paste the curl from your browser and the script will extract your credentials and browser headers for maximum compatibility
  2. Enter token manually - Provide your Cursor session token (the user ID will be extracted automatically)

Finding Your Cursor Session Token

Here's a detailed guide to finding your Cursor session token:

Step 1: Access Cursor Settings

  1. Log in to Cursor
  2. Go to Settings by visiting: https://www.cursor.com/settings

screenshot (1)

Step 2: Open Browser Developer Tools

  1. Right-click anywhere on the page and select "Inspect" or press:
    • Chrome/Edge: F12 or Ctrl+Shift+I (Windows/Linux) or Cmd+Option+I (Mac)
    • Firefox: F12 or Ctrl+Shift+I (Windows/Linux) or Cmd+Option+I (Mac)
    • Safari: First enable Developer menu in Preferences > Advanced, then press Cmd+Option+I

screenshot (2)

Step 3: Navigate to Network Tab

  1. Click the "Network" tab in the developer tools
  2. You may need to refresh the page (F5 or Ctrl+R) to see network requests

screenshot (3)

Step 4: Find the Usage API Request

  1. In the network requests list, look for a request to: https://www.cursor.com/api/usage?user=...
  2. This request contains all the information you need

screenshot (4)

Method 1: Using the Full CURL Command (Recommended)

This is the easiest method as it automatically extracts everything needed:

  1. Right-click on the usage API request in the Network tab
  2. Select "Copy" > "Copy as cURL" (or similar, depending on your browser)

screenshot (5)

  1. When running the script, select option 1 when prompted
  2. Paste the entire curl command (Ctrl+V on Windows, Cmd+V on Mac)
  3. Press Enter twice to complete the input
  4. The script will automatically extract your session token and user ID from the curl command

Step 1: screenshot (6)

Step 2: screenshot (8)

Method 2: Finding Your Session Token

  1. Click on the usage API request to see details
  2. Go to the "Headers" tab
  3. Scroll down to "Request Headers" and find "Cookie"
  4. Look for WorkosCursorSessionToken= followed by a long string of characters
  5. The whole string after WorkosCursorSessionToken= and before any semicolon is your token Example: WorkosCursorSessionToken=user_01JKEMPWF0E597XXQEPMBJ391%3A%3AeyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

Note: The token already contains your user ID, so you don't need to extract it separately.

Step 1: screenshot (7)

Step 2: screenshot (10)

Demo Mode

The demo mode now showcases different usage levels with their corresponding color indicators:

npm run demo

This interactive demo shows:

  • Low Usage (30%) - Blue color
  • Medium Usage (65%) - Blue color
  • High Usage (75%) - Yellow warning color
  • Critical Usage (92%) - Red alert color
  • Maximum Usage (100%) - Red alert color

Press Enter to cycle through each scenario and see how the display changes.

Running Tests

npm test

Data Storage

Your credentials and cached responses are stored locally in your home directory:

  • ~/.cursor-usage-tracker/config.json - Contains your User ID and session token
  • ~/.cursor-usage-tracker/last-response.json - Contains the most recent usage data

Color Coding System

The script uses color coding to help you visualize your usage status:

| Usage Level | Color | Meaning | |-------------|-------|---------| | 0% - 69% | Blue | Normal usage - You have plenty of requests available | | 70% - 89% | Yellow | Warning - You're using a significant portion of your allocation | | 90% - 100% | Red | Critical - You're close to or at your limit |

This makes it easy to quickly see your usage status at a glance.

Project Structure

cursor-request-count-script/
├── data/                 # Stored credentials and cached data
├── src/
│   └── index.ts          # Main application code
├── tests/
│   ├── cli-demo.ts       # Interactive demo script
│   ├── display.test.ts   # Tests for display formatting
│   ├── index.test.ts     # Core functionality tests
│   └── run-tests.ts      # Test runner
├── package.json
└── tsconfig.json

License

ISC

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Submit a pull request