Skip to content
Merged

v3 #10

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## 0.3.0

### Features

- Added **Since last commit** usage window: plan % burned while the working tree is dirty, re-anchored on every HEAD move (automatic; no manual reset). Hidden when the tree is clean or the workspace is not a git repo
- Added **This branch** usage window: plan % while a feature branch is checked out, with active-time pause/resume so spend on other branches does not inflate the counter (hidden on the default branch)
- Optional status bar modes `sinceLastCommit` and `thisBranch`
- **Last hour** usage now persists across IDE reloads when sampling continued in the prior hour

### UI

- Timestamps use 24-hour format
- Git-aware windows wait for the built-in git API before rendering (no flicker / stale placeholders on startup)

### Docs

- Landing page and README updated for the git-aware windows

## 0.2.0

### Features
Expand Down
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

**See your Cursor plan usage without leaving the editor.**

[Website](https://codykoinabox.github.io/cursor-plan-usage/) · Live **Cursor Models** and **Other Models** percentages in a dockable sidebar and status bar chip — so you always know where you stand in the billing cycle.
[Website](https://codykoinabox.github.io/cursor-plan-usage/) · Live **Cursor Models** and **Other Models** percentages in a dockable sidebar and status bar — plus git-aware windows for spend since your last commit or while you’re on a feature branch.

#### You can easily install the extension through the Extensions tab inside Cursor:
<img width="268" height="228" alt="image" src="https://github.com/user-attachments/assets/2e36d629-3784-4ecd-b4be-677fd1a1ce41" />
<img width="268" height="228" alt="Installing Cursor Plan Usage from the Extensions tab" src="https://github.com/user-attachments/assets/2e36d629-3784-4ecd-b4be-677fd1a1ce41" />


[Install on Open VSX](https://open-vsx.org/extension/CodyKoInABox/cursor-plan-usage) · [Report an issue](https://github.com/CodyKoInABox/cursor-plan-usage/issues)
Expand All @@ -15,15 +15,17 @@
## Features

- **Sidebar panel** — CM / OM usage at a glance in the activity bar
- **Status bar chip** — `CM n% · OM n%` always visible while you work, or your **Usage so far** deltas instead
- **Status bar chip** — `CM n% · OM n%` cycle totals, or deltas for **Usage so far** / **Since last commit** / **This branch**
- **Billing cycle** — progress through the period, end time, and a simple projection
- **Session deltas** — last-hour and IDE-session usage while the extension is sampling
- **Usage so far** — custom resettable window that persists across reloads; track any period you care about. Auto-resets when a new billing cycle starts
- **Session deltas** — last-hour usage persists across reloads; IDE-session usage is since this Cursor window opened
- **Usage so far** — resettable window that persists across reloads; auto-resets on a new billing cycle
- **Since last commit** — plan % burned while the working tree is dirty; resets on each commit. Hidden when the tree is clean
- **This branch** — plan % while a feature branch is checked out; pauses on `main` / other branches and restores when you return. Hidden on the default branch
- **Smart refresh** — updates on focus and AI activity; pauses when Cursor is unfocused


## UI Example
<img width="374" height="808" alt="Screenshot_1509" src="https://github.com/user-attachments/assets/42b61e48-6113-4b0e-b246-ec3a56f383bf" />
<img width="281" height="1024" alt="Plan Usage sidebar showing Cursor Models, Other Models, and git-aware usage windows" src="docs/assets/sidebar.png" />


## Cursor only
Expand Down Expand Up @@ -66,7 +68,7 @@ After install, open the **Plan Usage** icon in the activity bar, or run **Plan U
| --- | --- | --- |
| `cursorPlanUsage.pollIntervalSeconds` | `0` | Idle poll interval (seconds) while focused. `0` = adaptive (30s burst for 2 min after AI activity, then 3 min). Polling pauses while unfocused. |
| `cursorPlanUsage.refreshOnAiActivity` | `true` | Refresh when Cursor’s local AI tracking DB updates |
| `cursorPlanUsage.statusBarMode` | `absolute` | `absolute` shows cycle totals (`CM 45% · OM 20%`); `usageSoFar` shows deltas since your last Reset (`CM +4% · OM +2%`) |
| `cursorPlanUsage.statusBarMode` | `absolute` | `absolute` shows cycle totals (`CM 45% · OM 20%`); `usageSoFar` shows deltas since your last Reset (`CM +4% · OM +2%`); `sinceLastCommit` shows deltas since HEAD while dirty; `thisBranch` shows deltas while the current feature branch is checked out |
| `cursorPlanUsage.apiBaseUrl` | `https://api2.cursor.sh` | Dashboard API base URL |

There is no `sessionToken` setting — use the Set / Clear Session Token commands instead.
Expand All @@ -77,7 +79,7 @@ There is no `sessionToken` setting — use the Set / Clear Session Token command
| --- | --- |
| **No token found** | Sign in to Cursor, or run **Plan Usage: Set Session Token** with a valid session token / JWT. |
| **401 / unauthorized** | Re-sign into Cursor, or set a fresh token via **Plan Usage: Set Session Token**. |
| **Remote-SSH / WSL** | The extension runs in the **local** Cursor UI and uses the local session DB. If usage looks wrong in a remote window, use a local window or set a session token override. |
| **Remote-SSH / WSL** | The extension runs in the **local** Cursor UI and uses the local session DB. If usage looks wrong in a remote window, use a local window or set a session token override. **Since last commit** / **This branch** need the built-in git API and stay hidden when it is unavailable in remote UI hosts. |

## Notes

Expand Down
Binary file modified docs/assets/sidebar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
94 changes: 75 additions & 19 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<title>Cursor Plan Usage</title>
<meta
name="description"
content="See your Cursor plan usage without leaving the editor. Live CM and OM percentages in a sidebar and status bar."
content="See your Cursor plan usage without leaving the editor. Live CM and OM percentages, plus since-last-commit and this-branch deltas in a sidebar and status bar."
/>
<link rel="icon" href="assets/icon.png" type="image/png" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
Expand Down Expand Up @@ -37,50 +37,72 @@
<a href="#features">Features</a>
<a href="#install">Install</a>
<a
class="gh-link"
href="https://github.com/CodyKoInABox/cursor-plan-usage"
target="_blank"
rel="noopener noreferrer"
>GitHub</a
><svg class="gh-icon" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/></svg>GitHub</a
>
</nav>
</header>

<main id="top">
<section class="hero">
<div class="hero-copy reveal">
<p class="brand-hero">Cursor Plan Usage</p>
<img
class="brand-hero-icon"
src="assets/icon.png"
alt=""
width="128"
height="128"
/>
<h1 class="brand-hero">Cursor Plan Usage</h1>
<p class="tagline">
See your Cursor plan usage without leaving the editor.
</p>
<p class="lede">
Live Cursor Models and Other Models percentages in a dockable
sidebar and status bar chip — so you always know where you stand in
the billing cycle.
sidebar and status bar — plus git-aware windows for spend since your
last commit or while you’re on a feature branch.
</p>
<div class="cta-row">
<a class="btn btn-primary" href="#install">Install in Cursor</a>
<a
class="btn btn-ghost"
class="btn btn-ghost gh-link"
href="https://github.com/CodyKoInABox/cursor-plan-usage"
target="_blank"
rel="noopener noreferrer"
>View on GitHub</a
><svg class="gh-icon" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/></svg>View on GitHub</a
>
</div>
</div>
<div class="hero-visual reveal reveal-delay">
<img
src="assets/sidebar.png"
alt="Plan Usage sidebar showing Cursor Models and Other Models percentages"
width="374"
height="808"
alt="Plan Usage sidebar showing Cursor Models, Other Models, and git-aware usage windows"
width="281"
height="1024"
fetchpriority="high"
/>
<p class="shot-credit">
Captured with
<a
href="https://github.com/CodyKoInABox/rustshot"
target="_blank"
rel="noopener noreferrer"
>Rustshot</a
>
</p>
</div>
</section>

<section class="section features" id="features">
<div class="section-intro reveal">
<h2>What you get</h2>
<p>Everything you need to track plan burn without leaving Cursor.</p>
<p>
Cycle totals, custom windows, and git-aware deltas — without leaving
Cursor.
</p>
</div>
<ul class="feature-list">
<li class="reveal">
Expand All @@ -90,8 +112,8 @@ <h2>What you get</h2>
<li class="reveal">
<strong>Status bar chip</strong>
<span
>Always-visible <code>CM n% · OM n%</code> or Usage so far
deltas</span
><code>CM n% · OM n%</code> cycle totals, or deltas for Usage so
far / Since last commit / This branch</span
>
</li>
<li class="reveal">
Expand All @@ -100,7 +122,10 @@ <h2>What you get</h2>
</li>
<li class="reveal">
<strong>Session deltas</strong>
<span>Last-hour and IDE-session usage while the extension is sampling</span>
<span
>Last-hour usage persists across reloads; IDE-session usage is
since this Cursor window opened</span
>
</li>
<li class="reveal">
<strong>Usage so far</strong>
Expand All @@ -109,6 +134,21 @@ <h2>What you get</h2>
new billing cycle</span
>
</li>
<li class="reveal">
<strong>Since last commit</strong>
<span
>Plan % burned while the working tree is dirty; resets on each
commit. Hidden when the tree is clean</span
>
</li>
<li class="reveal">
<strong>This branch</strong>
<span
>Plan % while a feature branch is checked out; pauses on
<code>main</code> / other branches and restores when you return.
Hidden on the default branch</span
>
</li>
<li class="reveal">
<strong>Smart refresh</strong>
<span>Updates on focus and AI activity; pauses when Cursor is unfocused</span>
Expand All @@ -132,13 +172,14 @@ <h2>Install in Cursor</h2>
<div class="install-copy">
<ol>
<li>Open Extensions</li>
<li>Search <strong>Cursor Plan Usage</strong></li>
<li>Search <strong>Cursor Plan Usage by CodyKoInABox</strong></li>
<li>Install</li>
</ol>
<p>
Also on
<a
href="https://open-vsx.org/extension/CodyKoInABox/cursor-plan-usage"
target="_blank"
rel="noopener noreferrer"
>Open VSX</a
>.
Expand All @@ -150,17 +191,24 @@ <h2>Install in Cursor</h2>
<section class="section feedback" id="feedback">
<div class="feedback-inner reveal">
<h2>Feedback</h2>
<p>Found a bug or have an idea? Open an issue on GitHub.</p>
<p>
Found a bug or have an idea? Open an issue on
<span class="gh-inline"
><svg class="gh-icon" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/></svg>GitHub</span
>.
</p>
<div class="cta-row">
<a
class="btn btn-primary"
href="https://github.com/CodyKoInABox/cursor-plan-usage/issues/new?labels=bug&title=Bug%3A%20"
target="_blank"
rel="noopener noreferrer"
>Report a bug</a
>
<a
class="btn btn-ghost"
href="https://github.com/CodyKoInABox/cursor-plan-usage/issues/new?labels=enhancement&title=Feature%3A%20"
target="_blank"
rel="noopener noreferrer"
>Suggest a feature</a
>
Expand All @@ -174,9 +222,11 @@ <h2>Open source</h2>
<p>
MIT licensed and fully readable on
<a
class="gh-link"
href="https://github.com/CodyKoInABox/cursor-plan-usage"
target="_blank"
rel="noopener noreferrer"
>GitHub</a
><svg class="gh-icon" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/></svg>GitHub</a
>. Audit it, fork it, or send a pull request.
</p>
</div>
Expand Down Expand Up @@ -206,11 +256,17 @@ <h2>Native to Cursor</h2>

<footer class="site-footer">
<p>
<a href="https://github.com/CodyKoInABox/cursor-plan-usage" rel="noopener noreferrer"
<a
href="https://github.com/CodyKoInABox/cursor-plan-usage"
target="_blank"
rel="noopener noreferrer"
>MIT</a
>
· Created by
<a href="https://github.com/CodyKoInABox" rel="noopener noreferrer"
<a
href="https://github.com/CodyKoInABox"
target="_blank"
rel="noopener noreferrer"
>CodyKoInABox</a
>
</p>
Expand Down
7 changes: 7 additions & 0 deletions docs/script.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
(() => {
document.querySelectorAll("a[href]").forEach((a) => {
const href = a.getAttribute("href");
if (!href || href.startsWith("#")) return;
a.setAttribute("target", "_blank");
a.setAttribute("rel", "noopener noreferrer");
});

const reduceMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
const nodes = document.querySelectorAll(".reveal");

Expand Down
Loading
Loading