npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@hasna/invoices

v0.1.1

Published

Invoice generation and management for AI agents - CLI + MCP server + REST API + dashboard + SDK

Readme

@hasna/invoices

Invoice generation and management for AI agents.

@hasna/invoices ships four surfaces in one repo:

  • CLI (invoices)
  • MCP server (invoices-mcp)
  • REST API server (invoices-serve)
  • Web dashboard (dashboard/)
  • Typed Web/Node SDK (sdk/ as @hasna/invoices-sdk)

Features

  • Local SQLite storage with WAL mode + migrations
  • PostgreSQL migration support via @hasna/cloud
  • Cloud sync push/pull between local SQLite and PostgreSQL
  • Feedback delivery with remote send + local fallback persistence
  • Invoice + line item CRUD with computed totals
  • FTS5 search over invoice number, parties, and notes
  • Agent registry (register_agent, heartbeat, set_focus, list_agents)
  • MCP tools for invoice workflows
  • Shadcn-based dashboard structure aligned with open-todos

Install

bun add @hasna/invoices

CLI

# initialize local SQLite schema
invoices db:migrate

# initialize PostgreSQL schema translated from local migrations
invoices db:migrate:pg

# cloud sync (all tables by default)
invoices cloud:push
invoices cloud:pull

# optional subset
invoices cloud:push --tables parties,invoices,invoice_lines

# feedback
invoices feedback:send --message "SDK auth flow failed on staging"

# create parties
invoices party:create --kind issuer --name "Hasna SRL"
invoices party:create --kind customer --name "ACME GmbH"

# create invoice
invoices invoice:create \
  --number INV-1001 \
  --issuer-id <ISSUER_ID> \
  --customer-id <CUSTOMER_ID> \
  --currency EUR \
  --line "Implementation:10:5000:1900"

# list/search/update
invoices invoice:list
invoices invoice:search "INV-1001"
invoices invoice:status <INVOICE_ID> sent

# agent lifecycle
invoices agent:register --name octavian
invoices agent:list

REST API

Run server:

invoices-serve

Key endpoints:

  • GET /health
  • POST /api/migrate
  • POST /api/migrate/pg
  • POST /api/cloud/push
  • POST /api/cloud/pull
  • POST /api/feedback
  • GET|POST /api/parties
  • GET|POST /api/invoices
  • GET /api/invoices/search?q=...
  • POST /api/invoices/:id/status
  • GET /api/stats
  • GET|POST /api/agents
  • POST /api/agents/:id/heartbeat
  • POST /api/agents/:id/focus

MCP

Run MCP stdio server:

invoices-mcp

Core tools:

  • migrate_database, migrate_postgres
  • cloud_push, cloud_pull, send_feedback
  • create_party, list_parties
  • create_invoice, get_invoice, list_invoices, search_invoices, update_invoice_status, delete_invoice
  • register_agent, heartbeat, set_focus, list_agents

Dashboard

cd dashboard
bun install
bun run dev

Set API base if needed:

export VITE_API_BASE_URL=http://localhost:3487

Security

  • Optional API auth via INVOICES_API_KEY
  • Optional CORS allowlist via INVOICES_ALLOWED_ORIGIN
  • Security reports are stored under reports/

Development

bun install
cd dashboard && bun install && cd ..
cd sdk && bun install && cd ..

bun run typecheck
bun run build
bun test

License

Apache-2.0