diff --git a/README.md b/README.md index 602757e..8a817dc 100644 --- a/README.md +++ b/README.md @@ -1,655 +1,176 @@ -

-
-
-
-
Token usage tracker CLI -- table and JSON output
- ---- +# CLI Command-line interface for tokmeter. Scans all local AI agent sessions and displays usage in formatted tables or JSON. ## Install +This is a private workspace package. Install the public `@sriinnu/tokmeter` distribution. + ```bash # Run directly -npx @sriinnu/tokmeter-cli +npx @sriinnu/tokmeter # Or install globally -npm install -g @sriinnu/tokmeter-cli +npm install -g @sriinnu/tokmeter tokmeter ``` @@ -36,7 +30,7 @@ tokmeter restore [--latest|--id] # restore from ~/.cache/tokmeter/backups/ tokmeter alias ... # manage project display names, tags, hidden (see below) ``` -See the top-level README for the full cross-machine backup/restore workflow. +See [backup and restore](../../docs/backup-restore.md) for the cross-machine workflow. ## Aliases @@ -108,4 +102,4 @@ tokmeter --light # skip pricing (faster) ## License -MIT +AGPL-3.0-only — [license text](../../LICENSE). See [licenses and source](../../docs/licensing.md). diff --git a/packages/cli/SKILL.md b/packages/cli/SKILL.md index 72358f7..e7e6313 100644 --- a/packages/cli/SKILL.md +++ b/packages/cli/SKILL.md @@ -1,5 +1,7 @@ # @sriinnu/tokmeter-cli +Private workspace package. Use the public `@sriinnu/tokmeter` distribution. + Command-line interface for token usage tracking. Displays usage in formatted tables or JSON. ## Capabilities @@ -21,3 +23,7 @@ tokmeter pricing sonnet # lookup pricing tokmeter --json # JSON output tokmeter --today # today only ``` + +## License + +AGPL-3.0-only; see [licenses and source](../../docs/licensing.md). diff --git a/packages/core/README.md b/packages/core/README.md index d82de44..64520ca 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -1,25 +1,19 @@ -
-
-
Session parsers, aggregation, and pricing for 16+ AI coding agents
- ---- - -The engine behind tokmeter. Scans local session files, parses token records from 16+ AI agent formats, enriches them with model pricing via [`@sriinnu/kosha-discovery`](https://www.npmjs.com/package/@sriinnu/kosha-discovery), and exposes a clean API for aggregation. +The engine behind tokmeter. Scans local session files, parses token records from 16+ AI agent formats, enriches them with model pricing via [`@sriinnu/kosha-discovery`](https://www.npmjs.com/package/@sriinnu/kosha-discovery), and exposes an API for aggregation. ## Install +This is a private workspace package. Install the public `@sriinnu/tokmeter` distribution. + ```bash -npm install @sriinnu/tokmeter-core +npm install @sriinnu/tokmeter ``` ## Usage ```typescript -import { TokmeterCore, sumUsage } from "@sriinnu/tokmeter-core"; +import { TokmeterCore, sumUsage } from "@sriinnu/tokmeter"; const core = new TokmeterCore(); const records = await core.scan(); @@ -88,4 +82,4 @@ immutability, and daemon model. ## License -MIT +MPL-2.0 — [license text](LICENSE). See [licenses and source](../../docs/licensing.md). diff --git a/packages/core/SKILL.md b/packages/core/SKILL.md index a239394..0af17a7 100644 --- a/packages/core/SKILL.md +++ b/packages/core/SKILL.md @@ -1,22 +1,28 @@ # @sriinnu/tokmeter-core +Private workspace package. Use the public `@sriinnu/tokmeter` distribution. + Core engine for token usage tracking. Provides session parsers for 16+ AI agent formats, token aggregation, and model pricing via kosha-discovery. ## Capabilities - Parse session files from Claude Code, Codex, Cursor, Gemini, OpenCode, and 11 more providers - Aggregate tokens by project, model, provider, and time period -- Enrich records with accurate pricing (input, output, cache, reasoning tokens) +- Enrich records with estimated API pricing (input, output, cache, reasoning tokens) - 4-tier pricing: kosha direct, static table, kosha fuzzy, null - Filter by date range, provider, project ## API ```typescript -import { TokmeterCore } from "@sriinnu/tokmeter-core"; +import { TokmeterCore } from "@sriinnu/tokmeter"; const core = new TokmeterCore(); const records = await core.scan({ today: true }); const stats = core.getStats(); const models = core.getModelCosts(); const daily = core.getDailyBreakdown(); ``` + +## License + +MPL-2.0; see [licenses and source](../../docs/licensing.md). diff --git a/packages/macos-bar/README.md b/packages/macos-bar/README.md index 027a4a5..6316297 100644 --- a/packages/macos-bar/README.md +++ b/packages/macos-bar/README.md @@ -1,102 +1,66 @@ # TokmeterBar — macOS menubar companion -A native menubar app that shows live token usage and cost from the Drishti -daemon. Built with SwiftUI's `MenuBarExtra`. +A native SwiftUI `MenuBarExtra` and companion Hub for local token usage and cost telemetry. Release builds target Apple silicon and macOS 14+. -## Architecture +## Start -``` - ┌─────────────────────┐ - │ TokmeterBar.app │ - │ (SwiftUI menubar) │ - └──────────┬──────────┘ - │ HTTP GET - │ http://127.0.0.1:9877/api/* - ▼ - ┌─────────────────────┐ - │ Drishti Daemon │ - │ (Node.js) │ - └──────────┬──────────┘ - │ scans - ▼ - ~/.claude /.codex / etc. -``` +Install Node.js 18+ with npx, then open TokmeterBar from `/Applications`. +The current source discovers paired Node/npx in common system and managed installations and starts the version-matched `@sriinnu/drishti` daemon when it is unavailable. The first download needs network access. Missing prerequisites and startup failures show an explanation and Retry control. -The app connects to the Drishti daemon's HTTP REST API on `localhost:9877`. -The daemon must be running: +For the published 1.10.0 build, install and start the daemon explicitly: ```sh +npm install -g @sriinnu/drishti drishti daemon start +open /Applications/TokmeterBar.app ``` -## Build - -```sh -cd packages/macos-bar -./bundle.sh # build + create TokmeterBar.app -./bundle.sh --install # also copy to /Applications -``` +The app reads HTTP telemetry from `http://127.0.0.1:9877`. It does not run a separate full-history CLI scan for each refresh. See [first-use validation](../../docs/macos/first-use.md). -This builds with `swift build -c release`, wraps the binary in a proper `.app` -bundle with `Info.plist` (`LSUIElement=true` so it has no Dock icon), and -ad-hoc signs it so macOS Gatekeeper allows local execution. +## Use -## Run +The menubar shows today's tokens. Open it for estimated API cost, tool-reported cost when available, and today's models and projects. The full **Usage details** row expands lifetime totals, trends, and signals. The popup fits its content and scrolls when it reaches the available height. The Hub offers larger breakdowns and settings. -```sh -# Start the daemon if it isn't already -drishti daemon start +Six themes are selectable: Terminal, Paper, Nebula, Aurora, Nocturne, and Glass. Glass uses native light desktop frost, dark ink, and explicit theme-based status colors; Reduce Transparency selects an opaque fallback. The footer separates version and licensing from pricing status. -# Launch the app -open /Applications/TokmeterBar.app -``` +Refresh frequency is configurable. Costs are not a verified subscription bill; missing cost data is shown as unavailable. See [how the numbers work](../../docs/how-the-numbers-work.md) and [popover validation](../../docs/macos/popover-usability.md). -The menubar icon shows today's tokens. Click it to see: -- Today's tokens, estimated API cost, and tool-reported cost separately -- Today's models, with Today/All and Show all controls -- Today's projects -- Usage details: lifetime totals, trends, cache and other signals +## Build and test -Costs are not a verified subscription bill. Missing cost data is shown as unavailable. -See [how the numbers work](../../docs/how-the-numbers-work.md). +Install Xcode, then run from the repository root: -It refreshes every 30 seconds. +```sh +bun run bar:build # build an ad-hoc signed .app without installing +bun run bar # build, install to /Applications, and launch +swift test --package-path packages/macos-bar +``` -## File layout +The bundle script creates `packages/macos-bar/TokmeterBar.app`, includes license texts and source, and signs it. Local ad-hoc signing does not provide Developer ID or notarization. -``` -packages/macos-bar/ -├── Package.swift — SPM manifest -├── bundle.sh — build + bundle script -├── Sources/TokmeterBar/ -│ ├── TokmeterBarApp.swift — @main App entry point -│ ├── TokmeterBarView.swift — SwiftUI popover content -│ ├── TokmeterLoader.swift — observable loader (timer + async fetch) -│ ├── DaemonClient.swift — HTTP client for the daemon REST API -│ └── Models.swift — data shapes -└── README.md — this file -``` +For optional synthetic UI captures, create an output directory and set `TOKMETER_UI_QA_DIR` before running the native tests. These fixtures read no local usage. Live pointer, keyboard, and VoiceOver checks remain separate. -## Daemon API endpoints used +## Architecture -| Method | Path | Purpose | -|--------|------------------|---------------------------------------------| -| GET | `/api/stats` | Total cost, total tokens, projects, streak | -| GET | `/api/daily` | Daily breakdown (used for today + 7-day) | -| GET | `/api/models` | Per-model cost ranking (top 3 displayed) | +- `TokmeterBarView.swift` and `UsageOverview.swift`: popup layout and disclosure. +- `TokmeterLoader.swift`: observable telemetry, refresh, and connection state. +- `NodeToolchain.swift` and `SubprocessRunner.swift`: Node discovery and bounded startup commands. +- `DaemonClient.swift`: version-checked REST client. +- `Theme.swift`, `Theme+Modes.swift`, and `FrostedGlass.swift`: colors and native surfaces. +- `HubView.swift`: full-window companion. -GET endpoints are read-only and require no authentication. POST endpoints -(cleanup, restore) require a bearer token from `/tmp/drishti-daemon.token` -but the menubar app doesn't currently use them. +GET endpoints cover quick/readiness state, stats, daily usage, models, sessions/projects, signals, pricing, and health. User-triggered pricing updates, deep rescans, and live Antigravity fetches use POST requests authenticated by the daemon's local bearer token. See `DaemonClient.swift` for the exact routes. ## Distribution -For local use, the ad-hoc signature in `bundle.sh` is enough. For -distribution outside your machine you'd need: +The existing scripts support Developer ID signing, notarization, stapling, Sparkle update metadata, and ZIP packaging: + +```sh +bun run bar:signed # Developer ID signed bundle +bun run bar:release # signed, notarized, stapled ZIP and appcast entry +``` + +These commands require the configured Apple distribution credentials and Sparkle signing key. See [the release pipeline](RELEASE.md). Publishing is a separate step. The [six-area completion tracker](../../docs/macos-completion.md) records acceptance work still open; a successful build does not close it. -1. An Apple Developer ID certificate -2. Replace `codesign --sign -` with `codesign --sign "Developer ID Application: Your Name"` -3. Run `xcrun notarytool submit` to notarize -4. Build a DMG with `create-dmg` or similar +## License -Not implemented yet — only ad-hoc local builds. +AGPL-3.0-only — [license text](../../LICENSE). Core source retains MPL-2.0. The footer's **Licenses** button opens `Contents/Resources/Licenses/`, containing both texts, Sparkle notices, and the build source snapshot. See [licenses and source](../../docs/licensing.md). diff --git a/packages/macos-bar/Sources/TokmeterBar/AnomalyDetail.swift b/packages/macos-bar/Sources/TokmeterBar/AnomalyDetail.swift index 95b6f18..96484b4 100644 --- a/packages/macos-bar/Sources/TokmeterBar/AnomalyDetail.swift +++ b/packages/macos-bar/Sources/TokmeterBar/AnomalyDetail.swift @@ -7,9 +7,7 @@ import AppKit import SwiftUI -/// Tappable footer pill. Pressed state squashes 0.97 with a quick spring -/// (anticipation), releases on tap, then triggers `onTap`. Pixar: motion -/// confirms the gesture before the sheet starts to rise. +/// A compact native button opens the pricing breakdown on click or keyboard activation. struct AnomalyPill: View { let text: String let detailCount: Int @@ -17,38 +15,28 @@ struct AnomalyPill: View { let theme: AppTheme let onTap: () -> Void - @State private var pressed = false @State private var hovered = false var body: some View { - Text(text + " ›") - .font(.system(size: 10, weight: .medium, design: theme.fonts.bodyDesign)) - .foregroundColor(.red) - .padding(.horizontal, 6) - .padding(.vertical, 2) - .background( - RoundedRectangle(cornerRadius: 5) - .fill(Color.red.opacity(hovered ? 0.12 : 0.06)) - ) - // Squash 0.92 instead of 0.96 — at ~80pt wide / 10pt text, the - // smaller deformation was below the perceptual floor. 90ms dwell - // (was 120ms) keeps the confirm snappy. The press feels like - // touching a real button instead of "did it register?" - .scaleEffect(pressed ? 0.92 : 1.0) - .animation(.spring(response: 0.22, dampingFraction: 0.6), value: pressed) - .animation(.easeInOut(duration: 0.15), value: hovered) - .onHover { hovered = $0 } - .onTapGesture { - pressed = true - DispatchQueue.main.asyncAfter(deadline: .now() + 0.09) { - pressed = false - onTap() - } - } - .help( - "Click for the per-field breakdown — \(detailCount) field " - + "movement(s) across \(modelCount) model(s)." - ) + Button(action: onTap) { + Text(text + " ›") + .font(.system(size: 10, weight: .medium, design: theme.fonts.bodyDesign)) + .foregroundColor(theme.statusDanger) + .padding(.horizontal, 6) + .padding(.vertical, 2) + .background( + RoundedRectangle(cornerRadius: 5) + .fill(theme.statusDanger.opacity(hovered ? 0.12 : 0.06)) + ) + .contentShape(Rectangle()) + } + .buttonStyle(.plain) + .animation(.easeInOut(duration: 0.15), value: hovered) + .onHover { hovered = $0 } + .help( + "Click for the per-field breakdown — \(detailCount) field " + + "movement(s) across \(modelCount) model(s)." + ) } } @@ -247,7 +235,7 @@ private struct AnomalyFieldRow: View { private var bg: BackgroundMode { theme.backgroundMode } private var sign: String { row.deltaPct > 0 ? "↑" : "↓" } private var deltaColor: Color { - row.deltaPct > 0 ? Color.tokDanger : Color.tokSuccess + row.deltaPct > 0 ? theme.statusDanger : theme.statusSuccess } var body: some View { diff --git a/packages/macos-bar/Sources/TokmeterBar/CardBackground.swift b/packages/macos-bar/Sources/TokmeterBar/CardBackground.swift index 563bf4a..41a887c 100644 --- a/packages/macos-bar/Sources/TokmeterBar/CardBackground.swift +++ b/packages/macos-bar/Sources/TokmeterBar/CardBackground.swift @@ -104,16 +104,7 @@ struct CardBackground: View { } case .glassFrost: - ZStack { - RoundedRectangle(cornerRadius: radius).fill(.ultraThinMaterial) - RoundedRectangle(cornerRadius: radius).fill(role.opacity(0.08)) - RoundedRectangle(cornerRadius: radius) - .strokeBorder(LinearGradient( - colors: [Color.white.opacity(0.35), Color.white.opacity(0.05)], - startPoint: .top, endPoint: .bottom - ), lineWidth: 1) - } - .shadow(color: Color.black.opacity(0.15), radius: 8, x: 0, y: 4) + FrostedGlassPanel(cornerRadius: radius, tint: role) case .auroraGlass: // Thin material that lets the drifting bg show through, with a diff --git a/packages/macos-bar/Sources/TokmeterBar/CompositionFill.swift b/packages/macos-bar/Sources/TokmeterBar/CompositionFill.swift index 2223304..1f5e53b 100644 --- a/packages/macos-bar/Sources/TokmeterBar/CompositionFill.swift +++ b/packages/macos-bar/Sources/TokmeterBar/CompositionFill.swift @@ -27,7 +27,7 @@ func tierColor(_ tier: TokenTier, theme: AppTheme) -> Color { let c = theme.colors switch tier { case .output: return c.warm - case .cacheRead: return Color.tokSuccess + case .cacheRead: return theme.statusSuccess case .cacheWrite: return c.accent case .input: return c.secondary case .reasoning: return c.tertiary diff --git a/packages/macos-bar/Sources/TokmeterBar/ConnectionIssueView.swift b/packages/macos-bar/Sources/TokmeterBar/ConnectionIssueView.swift new file mode 100644 index 0000000..f277cff --- /dev/null +++ b/packages/macos-bar/Sources/TokmeterBar/ConnectionIssueView.swift @@ -0,0 +1,36 @@ +import AppKit +import SwiftUI + +struct ConnectionIssueView: View { + let error: String + let needsNodeSetup: Bool + let isRetrying: Bool + let retry: () -> Void + + var body: some View { + VStack(alignment: .leading, spacing: 6) { + HStack(alignment: .top, spacing: 6) { + Image(systemName: "bolt.trianglebadge.exclamationmark.fill") + .foregroundColor(.orange) + .font(.system(size: 12)) + Text(error) + .font(.system(size: 10, weight: .medium, design: .rounded)) + .foregroundColor(.primary.opacity(0.8)) + .fixedSize(horizontal: false, vertical: true) + } + HStack(spacing: 12) { + if needsNodeSetup { + Button("Install Node.js") { + NSWorkspace.shared.open(URL(string: "https://nodejs.org/en/download")!) + } + } + Button("Retry", action: retry).disabled(isRetrying) + } + .font(.system(size: 11, weight: .medium)) + } + .padding(.horizontal, 10) + .padding(.vertical, 6) + .background(RoundedRectangle(cornerRadius: 10).fill(Color.orange.opacity(0.12))) + .accessibilityElement(children: .contain) + } +} diff --git a/packages/macos-bar/Sources/TokmeterBar/ContentSizedScrollView.swift b/packages/macos-bar/Sources/TokmeterBar/ContentSizedScrollView.swift new file mode 100644 index 0000000..01ed2d5 --- /dev/null +++ b/packages/macos-bar/Sources/TokmeterBar/ContentSizedScrollView.swift @@ -0,0 +1,22 @@ +import SwiftUI + +/// Shrinks when disclosure content closes, while keeping long content scrollable. +struct ContentSizedScrollView- दृष्टि — MCP server + live token observatory for AI coding agents -
- - - ---- - -**@sriinnu/drishti** (दृष्टि — "vision") is the observation layer for token usage across AI coding agents. It provides an MCP server that exposes token data as tools, a live TUI dashboard, a statusline for editor hooks, and a cross-provider aggregation daemon. +`@sriinnu/drishti` provides an MCP server for usage queries, a local aggregation daemon, a live terminal UI, and editor statusline hooks. Pairs with [`@sriinnu/tokmeter`](https://www.npmjs.com/package/@sriinnu/tokmeter) for the core parsing engine. Works with Claude Code, Cursor, OpenCode, Codex CLI, Windsurf, Zed, VS Code Copilot, and more. @@ -52,7 +38,7 @@ npx @sriinnu/drishti ### Live Dashboard ```bash -# Launch the real-time TUI observatory +# Launch the live terminal UI drishti live ``` @@ -103,15 +89,17 @@ drishti install-mcp Once connected, drishti exposes these tools to the AI agent: -| Tool | Description | -| ------------------- | ---------------------------------------------- | -| `token_usage` | Token usage summary (today / week / month / all-time) | -| `cost_breakdown` | Cost breakdown by model, provider, or project | -| `daily_trend` | Daily usage trend with sparkline | -| `session_cost` | Current session cost and burn rate | -| `budget_check` | Check remaining budget against a limit | -| `compare_models` | Compare cost-efficiency across models | -| `export_csv` | Export usage data as CSV | +| Tool | Purpose | +| --- | --- | +| `drishti_pulse` | Usage snapshot | +| `drishti_models`, `drishti_providers`, `drishti_projects` | Cost and token breakdowns | +| `drishti_timeline`, `drishti_heatmap` | Usage over time | +| `drishti_search`, `drishti_compare`, `drishti_export` | Search, compare, and export | +| `drishti_budget`, `drishti_budget_alert`, `drishti_forecast` | Budget and forecast estimates | +| `drishti_cache_efficiency`, `drishti_efficiency`, `drishti_anomaly` | Efficiency and anomalies | +| `drishti_model_advisor`, `drishti_cost_optimization_tips` | Cost suggestions | +| `drishti_leaderboard`, `drishti_digest`, `drishti_streaks` | Reports and usage patterns | +| `drishti_cleanup_preview`, `drishti_cleanup_execute`, `drishti_backups`, `drishti_restore` | Preview cleanup, delete with confirmation, and restore backups | ### Statusline @@ -185,4 +173,4 @@ Claude Code, OpenCode, Codex CLI, Cursor, Windsurf, Zed, VS Code Copilot, and mo ## License -[MIT](https://opensource.org/licenses/MIT) +AGPL-3.0-only. Core source retains MPL-2.0. License texts and the build source snapshot are included in `dist/licenses/`; see [licenses and source](https://github.com/sriinnu/tokmeter/blob/main/docs/licensing.md). diff --git a/packages/mcp/SKILL.md b/packages/mcp/SKILL.md index 394f46a..a7aff0d 100644 --- a/packages/mcp/SKILL.md +++ b/packages/mcp/SKILL.md @@ -1,17 +1,22 @@ # @sriinnu/drishti -MCP server + live token observatory for AI coding agents. +MCP server, local daemon, and live usage reporting for AI coding agents. ## Capabilities -### MCP Tools -- `token_usage` -- usage summary (today/week/month/all-time) -- `cost_breakdown` -- cost by model, provider, or project -- `daily_trend` -- daily usage with sparkline -- `session_cost` -- current session cost and burn rate -- `budget_check` -- check against a spending limit -- `compare_models` -- compare cost-efficiency across models -- `export_csv` -- export as CSV +### MCP tools + +| Tool | Purpose | +| --- | --- | +| `drishti_pulse` | Usage snapshot | +| `drishti_models`, `drishti_providers`, `drishti_projects` | Cost and token breakdowns | +| `drishti_timeline`, `drishti_heatmap` | Usage over time | +| `drishti_search`, `drishti_compare`, `drishti_export` | Search, compare, and export | +| `drishti_budget`, `drishti_budget_alert`, `drishti_forecast` | Budget and forecast estimates | +| `drishti_cache_efficiency`, `drishti_efficiency`, `drishti_anomaly` | Efficiency and anomalies | +| `drishti_model_advisor`, `drishti_cost_optimization_tips` | Cost suggestions | +| `drishti_leaderboard`, `drishti_digest`, `drishti_streaks` | Reports and usage patterns | +| `drishti_cleanup_preview`, `drishti_cleanup_execute`, `drishti_backups`, `drishti_restore` | Preview cleanup, delete with confirmation, and restore backups | ### Statusline Shows project name, session cost, model, token flow (input/output/cache), context window %, burn rate, daily total, per-model breakdown. @@ -29,5 +34,8 @@ drishti statusline # statusline hook ## Integration -Claude Code: `~/.claude/.mcp.json` and `~/.claude/settings.json` statusLine -Codex: `~/.codex/config.toml` [mcp_servers.drishti] +Use `drishti install-mcp` for the repository's supported editor setup; inspect the generated configuration for your editor. See the [README](README.md) for stdio configuration and APIs. + +## License + +AGPL-3.0-only; see [licenses and source](../../docs/licensing.md). diff --git a/packages/tokmeter/README.md b/packages/tokmeter/README.md index 90c22a3..59c7a0c 100644 --- a/packages/tokmeter/README.md +++ b/packages/tokmeter/README.md @@ -1,20 +1,6 @@ -- Token usage tracking for AI coding agents — parsers, CLI, and TUI -
- - - ---- - -**@sriinnu/tokmeter** is the unified package for tracking token consumption across 16+ AI coding agents. It bundles the core parsing/aggregation engine, the CLI, and the interactive TUI into a single install with subpath exports. +`@sriinnu/tokmeter` bundles the core parsing/aggregation engine, the CLI, and the interactive TUI into a single install with subpath exports. Scans local session files from Claude Code, Cursor, Codex CLI, Gemini CLI, OpenCode, Amp, Roo Code, Kilo Code, and more. Breaks down usage by project, model, provider, and day. Computes real-time cost estimates powered by [`@sriinnu/kosha-discovery`](https://www.npmjs.com/package/@sriinnu/kosha-discovery). @@ -173,4 +159,4 @@ Claude Code, OpenCode, Codex CLI, Gemini CLI, Cursor, Amp, Droid, OpenClaw, Pi, ## License -[MIT](https://opensource.org/licenses/MIT) +AGPL-3.0-only. Core source retains MPL-2.0. License texts and the build source snapshot are included in `dist/licenses/`; see [licenses and source](https://github.com/sriinnu/tokmeter/blob/main/docs/licensing.md). diff --git a/packages/tui/README.md b/packages/tui/README.md index 4c7cf06..876e557 100644 --- a/packages/tui/README.md +++ b/packages/tui/README.md @@ -1,19 +1,13 @@ -
-
-
Interactive terminal UI with charts, sparklines, and heatmaps
- ---- +# Terminal UI A full-screen terminal dashboard for exploring token usage. Built with [Ink](https://github.com/vadimdemedes/ink) (React for CLIs). ## Install +This is a private workspace package. Install the public `@sriinnu/tokmeter` distribution. + ```bash -npx @sriinnu/tokmeter-tui +npx -p @sriinnu/tokmeter tokmeter-tui ``` ## Views @@ -35,4 +29,4 @@ npx @sriinnu/tokmeter-tui ## License -MIT +AGPL-3.0-only — [license text](../../LICENSE). See [licenses and source](../../docs/licensing.md). diff --git a/packages/tui/SKILL.md b/packages/tui/SKILL.md index 05aa394..329adef 100644 --- a/packages/tui/SKILL.md +++ b/packages/tui/SKILL.md @@ -1,5 +1,7 @@ # @sriinnu/tokmeter-tui +Private workspace package. Use the public `@sriinnu/tokmeter` distribution. + Interactive terminal UI for token usage tracking. Full-screen dashboard with charts, sparklines, and heatmaps. ## Capabilities @@ -13,5 +15,9 @@ Interactive terminal UI for token usage tracking. Full-screen dashboard with cha ## Usage ```bash -npx @sriinnu/tokmeter-tui +npx -p @sriinnu/tokmeter tokmeter-tui ``` + +## License + +AGPL-3.0-only; see [licenses and source](../../docs/licensing.md). diff --git a/packages/web/README.md b/packages/web/README.md index 328ec08..c6dec1f 100644 --- a/packages/web/README.md +++ b/packages/web/README.md @@ -1,21 +1,15 @@ -
-
-
React + Plotly web dashboard for token usage visualization
- ---- - -Rich browser-based dashboard with interactive charts. Built with React and Plotly.js. +Browser dashboard for token and cost data. Built with React and Plotly.js. ## Setup +This is a private workspace app, run from a source checkout. + ```bash -cd packages/web +# From the repository root bun install -bun run dev +bun run dev:web ``` Open http://localhost:3000 @@ -41,4 +35,4 @@ tokmeter --json > packages/web/public/data.json ## License -MIT +AGPL-3.0-only — [license text](../../LICENSE). See [licenses and source](../../docs/licensing.md). diff --git a/packages/web/SKILL.md b/packages/web/SKILL.md index d5383ef..7328240 100644 --- a/packages/web/SKILL.md +++ b/packages/web/SKILL.md @@ -1,5 +1,7 @@ # @sriinnu/tokmeter-web +Private workspace package. Run the web dashboard from this source checkout. + React + Plotly web dashboard for token usage visualization. ## Capabilities @@ -15,3 +17,7 @@ React + Plotly web dashboard for token usage visualization. tokmeter --json > packages/web/public/data.json cd packages/web && bun run dev ``` + +## License + +AGPL-3.0-only; see [licenses and source](../../docs/licensing.md). diff --git a/scripts/prepare-license-materials.py b/scripts/prepare-license-materials.py index 25f25a7..51b8074 100644 --- a/scripts/prepare-license-materials.py +++ b/scripts/prepare-license-materials.py @@ -14,9 +14,9 @@ def source_files(): # Explicit source/build inputs only: never sweep the working directory, # credentials, local usage, personal notes, or generated build trees. files = set() - for name in ("LICENSE", "README.md", "CHANGELOG.md", "package.json", "bun.lock", + for name in ("LICENSE", "README.md", "SKILL.md", "CHANGELOG.md", "package.json", "bun.lock", "tsconfig.base.json", "biome.json", "vitest.config.ts", - "docs/licensing.md"): + "docs/licensing.md", "docs/assets/demo/snapshots.json"): path = ROOT / name if path.is_file(): files.add(path) @@ -35,7 +35,7 @@ def source_files(): ): files.add(path) for pattern in ("package.json", "tsconfig*.json", "vite.config.*", "index.html", - "LICENSE", "README.md", "Package.swift", "Package.resolved", + "LICENSE", "README.md", "SKILL.md", "Package.swift", "Package.resolved", "*.sh", "entitlements.plist", "AppIcon.icns"): files.update(path for path in package.glob(pattern) if path.is_file()) for path in sorted(files):