Repository avatar
Version Control
v1.4.0
active

promptbill

io.github.danielneuron/promptbill

Local-first AI coding cost attribution per Git repo & client PDF/Xero/QuickBooks invoice MCP server.

Documentation

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

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/*).

Related Open-Source Tools by DanielNeuron

  • 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.

OCI
ghcr.io/danielneuron/promptbill:1.4.0
Install Command
docker pull ghcr.io/danielneuron/promptbill:1.4.0:undefined