Skip to main content
Glama

PromptBill

CI License: MIT Live Preview PromptBill MCP server on Glama

Stop eating your AI coding bill on client projects.

PromptBill is a 100% local-first, zero-dependency, open-core CLI & web studio that scans your local Claude Code, OpenAI Codex CLI, Gemini CLI, Cline, Roo Code, and Anthropic / OpenAI / OpenRouter / Cursor CSV usage logs, attributes every token to its Git repository, and turns it into client-ready PDF & Xero/QuickBooks invoices in 10 seconds.

PromptBill CLI & Client PDF Invoice Preview

  • Zero telemetry. Zero cloud uploads. Your prompts, code, and usage logs never leave your machine.

  • Zero runtime dependencies. No Puppeteer, no Chromium download — installs & runs instantly on Linux, macOS, and Windows (Node.js >= 18).


Try It in 5 Seconds (Demo Mode)

npx github:danielneuron/promptbill scan --demo
npx github:danielneuron/promptbill ui --demo

Or scan your real local Claude Code (~/.claude/projects), Codex CLI (~/.codex/sessions), Gemini CLI (~/.gemini/tmp), and Cline / Roo Code (globalStorage/*/tasks) logs right away:

npx github:danielneuron/promptbill scan --days 30
npx github:danielneuron/promptbill ui

Related MCP server: nikhilnt

Key Features

Free Open-Source Core (MIT)

  • Local Multi-Tool Parsers: Reads Claude Code JSONL (with streaming requestId deduplication so tokens are never double-counted), OpenAI Codex CLI JSONL (with delta tracking), Gemini CLI JSON (~/.gemini/tmp), and Cline / Roo Code task logs (ui_messages.json + workspace CWD extraction across VS Code, Cursor, Windsurf, and VSCodium).

  • API CSV Importer: Import usage exports from Anthropic Console, OpenAI, OpenRouter, or Cursor (promptbill import usage.csv --project my-client-repo).

  • Automatic Git Repo Attribution: Maps working directories to enclosing Git repository names via .git/config.

  • Up-to-Date Pricing + Custom Overrides: Built-in 2026 pricing for Claude 4.x/3.x, GPT-5/Codex/o-series, Gemini 2.5/3, and DeepSeek — override anytime via ~/.promptbill/pricing.json.

  • Interactive Local Studio UI: Inspect repo spend, toggle billable repos, configure labor hours + pass-through markup + GST/VAT, and preview/download PDF invoices.

  • Standard Repo Summary CSV & JSON Export.

PromptBill Pro ($19 One-Time) & Agency Team ($49 One-Time) via Polar.sh

Pays for itself on your very first client invoice. No subscriptions, lifetime v1.x updates, 14-day refund guarantee.

  • Unwatermarked, Branded Client-Ready PDF Invoices (native PDF 1.4 generator).

  • Page 2 Sanitized AI Compute Audit Appendix: Date, repo, model, token totals, USD cost & optional sanitized git commit titles — proving AI spend to clients without leaking raw code or prompts.

  • One-Click Xero & QuickBooks Online Invoice CSV Exports.

  • Unlimited Multi-Client & Multi-Repo Profiles.

  • Agency Multi-Developer Rollup (promptbill merge): Merge multiple engineers' promptbill scan --json exports into one deduplicated client invoice (up to 25 machines with PromptBill Agency).

Unlock Pro, Agency, or the Best-Value Bundle (preview a real 2-page Sample Pro PDF):

promptbill activate PBILL-XXXX-XXXX-XXXX   # or PBAGY-XXXX-XXXX-XXXX for Agency

VS Code / Cursor / Windsurf / VSCodium Extension

Download the prebuilt zero-dependency .vsix (47 KB) from GitHub Releases to see live 30-day AI spend per workspace repo in your status bar & sidebar:

code --install-extension promptbill-1.4.0.vsix   # or cursor --install-extension ...

MCP Server (Claude Code, Cursor, Windsurf, Cline & Claude Desktop)

Run PromptBill as a zero-dependency local stdio MCP server so you can ask your coding agent directly:

"How much AI compute did we spend on acme-payments-api this month? Export a client PDF invoice with 15% markup and 10% GST."

Add to your MCP client config (~/.claude.json, .mcp.json, Cursor MCP settings, or claude_desktop_config.json):

{
  "mcpServers": {
    "promptbill": {
      "command": "npx",
      "args": ["-y", "github:danielneuron/promptbill", "mcp"]
    }
  }
}

Exposed MCP Tools:

  • promptbill_scan_usage — Scan local Claude Code, Codex CLI, Gemini CLI, Cline, Roo Code & imported CSVs grouped by Git repo.

  • promptbill_repo_spend — Detailed spend, models & pass-through billing estimate for a specific Git repository.

  • promptbill_generate_invoice_pdf — Generate a native PDF 1.4 client invoice on disk (with optional labor, markup %, GST/VAT & Pro audit appendix).

  • promptbill_export_csv — Export Repo Summary CSV (Free) or Xero / QuickBooks Online invoice CSV (Pro/Agency).


CLI Reference

# Scan local AI coding usage for the last 30 days
promptbill scan --days 30

# Launch interactive local studio UI (default http://127.0.0.1:4319)
promptbill ui

# Generate a client PDF invoice (AI pass-through + optional hourly engineering)
promptbill invoice \
  --client "Acme FinTech Pty Ltd" \
  --repos "acme-payments-api,acme-web-portal" \
  --hours 12 --rate 135 --markup 15 --tax 10 --currency USD \
  --audit --out acme-nov-2026.pdf

# Import OpenRouter / Anthropic / OpenAI / Cursor CSV
promptbill import openrouter-nov.csv --project acme-payments-api

# Export repo summary (Free) or Xero / QuickBooks invoice CSV (Pro)
promptbill export --format csv --out repos.csv
promptbill export --format xero --client "Acme FinTech" --repos "acme-payments-api" --out xero.csv

Privacy & Security

PromptBill reads local JSONL/CSV files strictly on your machine. The only outbound network request PromptBill ever makes is when you explicitly run promptbill activate, promptbill status, or promptbill deactivate, which communicates solely with Polar.sh's public Customer Portal License Key API (/v1/customer-portal/license-keys/*).

  • AuditDeck — Local-first CLI & MCP server that audits any Git repository (secrets, lockfiles, CI/tests, bus-factor, docs) and generates boardroom-ready Client Codebase Audit & Project Handover PDFs.

License

MIT — see LICENSE.

Available Tools

4 tools
promptbill_export_csvB

Export local AI coding usage as a standard Repo Summary CSV (Free) or as a ready-to-import Xero or QuickBooks Online invoice CSV (Pro/Agency).

Inputs: days, demo, repos, format, +4 more.

promptbill_generate_invoice_pdfA

Generate a native PDF 1.4 client pass-through invoice combining local AI coding spend per Git repo with optional engineering labor, markup %, and GST/VAT. Writes the PDF locally on disk.

Inputs: clientName (required), days, demo, repos, +9 more.

promptbill_repo_spendB

Get detailed AI coding spend, token usage, providers, models, and estimated pass-through billing total for a specific Git repository.

Inputs: repo (required), days, demo, taxPercent, +1 more.

promptbill_scan_usageB

Scan local AI coding logs (Claude Code, OpenAI Codex CLI, Gemini CLI, Cline, Roo Code, and imported CSVs) and return per-Git-repository token counts, sessions, models, and USD cost breakdown. 100% local-first.

Inputs: days, demo, repos, toDate, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 4 tools

    Disambiguation4/5

    Each tool has a distinct output shape: aggregate scan, single-repo detail, PDF invoice generation, and CSV export. The main risk is confusion between promptbill_scan_usage and promptbill_repo_spend, since both report tokens, models, and USD spend; only the descriptions clarify that one is cross-repo and the other repo-scoped.

    Naming Consistency4/5

    All tools use a consistent snake_case pattern with a uniform promptbill_ prefix, which makes the family obvious. promptbill_repo_spend breaks the verb_noun convention (it reads as noun_verb/noun_noun) while the others start with an action verb, a minor deviation.

    Tool Count4/5

    Four tools map cleanly onto a narrow pipeline: scan usage, inspect one repo, produce an invoice, and export data. The set is small but each tool earns its place; a couple more (e.g. time-range filtering or invoice history) could be justified but are not required.

    Completeness4/5

    The surface covers the core lifecycle: discover local usage, drill into a repo, generate a client invoice, and export CSV for accounting systems. Gaps are minor — no tool for managing or re-listing previously generated invoices, and no explicit time-range/reporting configuration tool, though parameters may cover this.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Local-first dashboard + MCP server that parses Claude Code and Codex JSONL files into a SQLite cost / token tracker. Per-MCP and per-tool breakdown, session drill-down, dedup by request_id; never talks to vendor APIs
      5
      95 npm
      1
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      One MCP that turns Claude Code into your whole dev stack by swallowing other MCP servers, delegating to Codex & Gemini on your CLI subscriptions, remembering projects in a searchable knowledge graph, and carrying setup across sessions — secret-free by design.
      23
      4
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables local-first tracking of AI token usage and costs from Claude Code and OpenCode, answering queries about tokens, models, sessions, and cost through MCP tools and a CLI, with no network calls.
      704 npm
      1
      MIT