Skip to content
Merged
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
75 changes: 68 additions & 7 deletions apps/web/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
# TokenBar website

The official TokenBar website. Today it is a single placeholder page; the real site is
a future milestone.
The official TokenBar website, served at <https://tokenbar.si>. One static page that
explains the product, plus `/llms.txt`, `/llms.md`, `/robots.txt`, `/sitemap.xml` and a 404.

## Stack

- [Astro](https://astro.build) with TypeScript (strict), output as a fully static site.
- No UI framework, no CSS framework, no client-side JavaScript.
- No analytics, tracking, external fonts, or third-party scripts.
- No UI framework and no CSS framework. All content is rendered to HTML at build time.
- A small amount of vanilla TypeScript for motion and interaction (about 7 KB gzipped).
No animation library, no WebGL.
- Two self-hosted fonts from Fontsource (Latin subset, SIL Open Font License):
Instrument Sans (variable, weight and width axes) and Instrument Serif (italic only).
Replicas of the app's UI use the system font, like the app does.
- No analytics, tracking, cookies, external fonts, or third-party scripts. The page
makes no requests to other origins; links to GitHub are plain links.

The site is independent of the macOS app: it does not need Xcode, and the macOS build
and release never touch this folder.
Expand All @@ -31,10 +37,65 @@ npm run preview # serve the built dist/ locally
Astro's CLI collects anonymous usage data by default. To opt out on your machine, run
`npx astro telemetry disable` or set `ASTRO_TELEMETRY_DISABLED=1` (CI does the latter).

## Layout

```text
src/
├── config.ts # canonical links, SEO title and description, requirements
├── data/
│ ├── sample.ts # sample usage shown in every replica (always labeled)
│ └── roadmap.ts # the roadmap section; mirrors docs/roadmap.md
├── components/ # one component per section, plus the app replicas
│ ├── StatusItem.astro # TokenBar's menu bar label
│ ├── Popover.astro # TokenBar's popover
│ └── …
├── scripts/
│ ├── motion.ts # scroll-progress scenes, reveals, magnetic buttons, tilt
│ └── popover.ts # drives the popover replicas
├── layouts/BaseLayout.astro # <head>: metadata, Open Graph, fonts, JSON-LD
└── pages/ # index, 404, sitemap.xml
public/ # robots.txt, llms.txt, llms.md, og.png, icons
```

## Motion and accessibility

Every section is complete without JavaScript. An inline script in `<head>` adds two
classes before the first paint: `js`, and `motion` unless the visitor prefers reduced
motion. Pinned (sticky) scroll scenes, reveals and the roadmap path only exist under
`.motion`; without it the page is a regular static document. Pinned scenes run only at
1024 px and wider; smaller screens get a simpler flow. Animations use `transform` and
`opacity`, and scene scripts only run while their section is near the viewport.

## Keeping the facts in sync

The website, `public/llms.txt`, `public/llms.md`, the structured data in
`src/pages/index.astro`, the Open Graph text in `src/config.ts`, the root README and
`docs/roadmap.md` must say the same things. Review all of them whenever TokenBar
changes any of:

- supported providers or what each one shows,
- supported platforms (today: macOS available, Windows planned),
- major features,
- the privacy architecture,
- download or install behavior (today: unsigned and not notarized),
- the roadmap (`src/data/roadmap.ts` mirrors `docs/roadmap.md`).

`llms.txt` and `llms.md` are maintained by hand on purpose; there is no generator.

The download button always links to the latest GitHub release, so a new release needs
no website change unless the install steps change. The site URL lives in
`astro.config.mjs` (`site`) and is repeated as plain text in `public/robots.txt`,
`public/llms.txt` and `public/llms.md`.

`public/og.png` (1200 × 630) is rendered from an HTML mock-up; regenerate it if the
headline or icon changes. `src/assets/logos/*.svg` are converted from the app's PDF logos
in `apps/macos/TokenBarKit/Sources/TokenBarUI/Resources/Logos` and are only used to
identify each provider.

## Output

`npm run build` writes plain static files (HTML and inlined CSS) to `apps/web/dist/`.
Any static host can serve that folder as-is; no adapter or server runtime is needed.
Hosting is not configured yet.
`npm run build` writes plain static files (HTML, CSS, JS, fonts, images) to
`apps/web/dist/`. Any static host can serve that folder as-is; no adapter or server
runtime is needed. Hosting is not configured yet.

No environment variables or secrets are needed. Never commit `.env` files.
10 changes: 9 additions & 1 deletion apps/web/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
// @ts-check
import { defineConfig } from "astro/config";

// Static output only: `npm run build` writes plain HTML/CSS to dist/, which any static
// Static output only: `npm run build` writes plain HTML/CSS/JS to dist/, which any static
// host (e.g. Cloudflare Pages) can serve. No adapter, no server runtime.
export default defineConfig({
// Production origin. Canonical URLs, Open Graph, the sitemap and structured data are built
// from it. public/robots.txt, public/llms.txt and public/llms.md repeat it as plain text.
site: "https://tokenbar.si",
output: "static",
trailingSlash: "ignore",
build: {
format: "file",
},
devToolbar: { enabled: false },
});
20 changes: 20 additions & 0 deletions apps/web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
"check": "astro check"
},
"dependencies": {
"@fontsource-variable/instrument-sans": "5.3.0",
"@fontsource/instrument-serif": "5.3.0",
"astro": "7.4.2"
},
"devDependencies": {
Expand Down
Binary file added apps/web/public/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/web/public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
107 changes: 107 additions & 0 deletions apps/web/public/llms.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# TokenBar

## What is TokenBar?

TokenBar is a free and open-source app for monitoring AI usage limits from the system menu bar. Instead of opening a provider's dashboard or running a command in a terminal, you see how much of each plan limit you have used, and when it resets, at a glance.

TokenBar is built around AI usage in general, not around one vendor. Today it supports two providers, Claude and Codex, and its architecture lets more providers be added over time.

Website: https://tokenbar.si/

## Key facts

- Free. No subscription, no paid plan, no pricing.
- Open source under the MIT License.
- Native macOS app, built with Swift, SwiftUI and AppKit. No Electron, no web views, no third-party runtime dependencies.
- An AI usage monitor that lives in the menu bar. It has no Dock icon and no window.
- No TokenBar account and no TokenBar backend or server.
- No analytics, telemetry, crash reporting, tracking, update checks or cloud sync.
- Currently supports Claude and Codex. Both integrations are experimental.
- macOS is available now. A Windows version is planned.

## Supported platforms

### macOS

Available now. Requires macOS 14 Sonoma or later, on Apple silicon or Intel.

### Windows

Planned. There is no Windows release, no Windows download, and no release date yet.

## Supported AI providers

Both integrations are experimental. Neither Anthropic nor OpenAI publishes an API for plan limits, so TokenBar uses the same undocumented endpoints that Claude Code and Codex use to show usage. They may change or stop working at any time, and the providers' terms may not cover this use. Every provider starts disabled; TokenBar explains what it reads before the user enables it.

### Claude

Supported now (Claude Pro and Max plans). Shows the current session (5 hours) and weekly limits, plus Opus and Sonnet weekly limits when the plan has them, each with its reset time. Requires Claude Code signed in on the same Mac; TokenBar reads Claude Code's sign-in from the macOS Keychain when it refreshes.

### Codex

Supported now (ChatGPT plans). Shows Codex 5-hour and weekly limits, plus model-specific limits when the plan has them, each with its reset time. These are Codex limits, not ChatGPT chat message limits. Requires Codex (CLI or app) signed in with ChatGPT on the same Mac; TokenBar reads `~/.codex/auth.json`. Codex installations that keep their sign-in in the Keychain are not supported yet.

### More providers

Each provider implements one protocol (`UsageProvider`) and returns a normalized usage snapshot, so a new provider does not require changes to the menu bar, popover or refresh logic. A provider is added only when it has a reliable, documented-enough data source. No other provider is confirmed.

## Features

- Usage in the menu bar: each provider's logo with its current session percentage.
- Three menu bar display modes: Providers (one number per provider, the default), Minimal (only the provider whose session is most used) and Detailed (session and week, like `15/12`).
- Popover with every enabled provider in one line; expand one to see each limit with a bar and its reset time.
- Current session and weekly limits, and model-specific limits where the provider reports them.
- Reset information computed locally in the user's time zone, for example "Resets at 19:10 (in 2h 50m)" or "Resets in 2d 14h (Sat, Oct 25 at 07:00)".
- Usage levels: values are highlighted from 70% and marked as critical from 90%.
- Automatic refresh every 5 minutes by default (2–15 minutes, configurable), after the Mac wakes, and when the popover opens.
- If a refresh fails, the last values stay visible and are marked as outdated.
- Launch at Login (optional).
- English and Portuguese (Brazil).

## Privacy

- No TokenBar account.
- No TokenBar backend. Requests go directly from the user's Mac to the provider endpoints (`api.anthropic.com` for Claude, `chatgpt.com` for Codex), and only for providers the user enabled.
- No telemetry, no analytics, no crash reporting, no tracking and no update checks in the macOS app.
- Usage data is kept in memory and never written to disk. Network responses are not cached and cookies are not stored.
- Credentials are not copied into TokenBar-owned storage. TokenBar reads the existing Claude Code or Codex sign-in at refresh time and never stores, copies, refreshes or logs it.
- Preferences (refresh interval, enabled providers, menu bar mode) are stored in the standard macOS preferences file.
- The website has no analytics and sets no cookies.

## Open Source

- GitHub repository: https://github.com/DerRafDev/tokenbar
- License: MIT (https://github.com/DerRafDev/tokenbar/blob/main/LICENSE)
- Contributions are welcome: https://github.com/DerRafDev/tokenbar/blob/main/CONTRIBUTING.md
- Issue tracker: https://github.com/DerRafDev/tokenbar/issues
- Security reports are handled privately: https://github.com/DerRafDev/tokenbar/security/advisories/new

## Download

**macOS — Available now.** Download the latest release from https://github.com/DerRafDev/tokenbar/releases/latest (a `.dmg` and a `.zip`, with SHA-256 checksums in `SHA256SUMS.txt`).

**Windows — Planned.** No download yet.

The current macOS build is unsigned and not notarized by Apple, so macOS Gatekeeper blocks the first launch. To open it: open TokenBar once, then go to System Settings › Privacy & Security, find the message about TokenBar, click Open Anyway and confirm. This approves TokenBar only; Gatekeeper should not be turned off for the whole Mac. Developer ID signing and notarization are on the roadmap.

## Roadmap

There are no dates. Source: https://github.com/DerRafDev/tokenbar/blob/main/docs/roadmap.md

- **Shipped — v0.1.0:** native macOS menu bar app; experimental Claude and Codex providers; session and weekly limits with reset countdowns; menu bar display modes; automatic refresh; launch at login; English and Portuguese (Brazil).
- **Planned:** a Windows version. No release date.
- **After 0.1.0 (candidates, not commitments; each needs evidence that it works reliably before it is built):** Developer ID signing and notarization; Codex Keychain sign-in; telling a Codex 403 apart from a workspace without Codex; refresh when the network comes back; automatic updates (needs a privacy-preserving design); more providers (only with a reliable, documented-enough source); menu bar customization.

## Canonical links

- Website: https://tokenbar.si/
- GitHub: https://github.com/DerRafDev/tokenbar
- Releases: https://github.com/DerRafDev/tokenbar/releases
- Latest release: https://github.com/DerRafDev/tokenbar/releases/latest
- Issues: https://github.com/DerRafDev/tokenbar/issues
- License: https://github.com/DerRafDev/tokenbar/blob/main/LICENSE
- Roadmap: https://github.com/DerRafDev/tokenbar/blob/main/docs/roadmap.md
- Provider data sources: https://github.com/DerRafDev/tokenbar/blob/main/docs/providers.md
- Architecture: https://github.com/DerRafDev/tokenbar/blob/main/docs/architecture.md

TokenBar is not affiliated with Anthropic or OpenAI. Claude, ChatGPT and Codex are trademarks of their respective owners.
26 changes: 26 additions & 0 deletions apps/web/public/llms.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# TokenBar

> TokenBar is a free, open-source (MIT) app that shows your AI usage limits in the system menu bar: how much of each plan limit you have used, and when it resets. macOS is available now; a Windows version is planned. It currently supports Claude and Codex. There is no TokenBar account, server, or telemetry.

TokenBar is a native macOS menu bar app (Swift, SwiftUI and AppKit, no third-party runtime dependencies). It reads the sign-in that Claude Code or Codex already keeps on the Mac and asks each provider for plan usage directly. Both provider integrations are experimental, because neither provider publishes an API for plan limits.

## Product

- [TokenBar website](https://tokenbar.si/): Overview, features, privacy, roadmap and download
- [Full facts for language models](https://tokenbar.si/llms.md): Platforms, providers, features, privacy, download and roadmap in one Markdown file
- [Download for macOS (latest release)](https://github.com/DerRafDev/tokenbar/releases/latest): DMG and ZIP; the current build is unsigned and not notarized

## Source and docs

- [GitHub repository](https://github.com/DerRafDev/tokenbar): Source code and README
- [Provider data sources](https://github.com/DerRafDev/tokenbar/blob/main/docs/providers.md): Where each provider's usage data comes from, and what is read
- [Architecture](https://github.com/DerRafDev/tokenbar/blob/main/docs/architecture.md): Modules, domain model, refresh and security boundaries
- [Roadmap](https://github.com/DerRafDev/tokenbar/blob/main/docs/roadmap.md): Shipped, planned, and candidate items
- [Security policy](https://github.com/DerRafDev/tokenbar/blob/main/SECURITY.md): What TokenBar promises and how to report a vulnerability

## Optional

- [Adding a provider](https://github.com/DerRafDev/tokenbar/blob/main/docs/adding-a-provider.md): How new AI providers are added
- [Contributing](https://github.com/DerRafDev/tokenbar/blob/main/CONTRIBUTING.md): Workflow and code style
- [Issues](https://github.com/DerRafDev/tokenbar/issues): Bug reports and provider requests
- [License (MIT)](https://github.com/DerRafDev/tokenbar/blob/main/LICENSE)
Binary file added apps/web/public/og.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions apps/web/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# TokenBar's website is public product information. All crawlers, including search and
# AI crawlers, are welcome. There is nothing private here.
User-agent: *
Allow: /

Sitemap: https://tokenbar.si/sitemap.xml
Binary file added apps/web/src/assets/app-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/web/src/assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/web/src/assets/logos/claude.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading