@hasna/invoices
v0.1.1
Published
Invoice generation and management for AI agents - CLI + MCP server + REST API + dashboard + SDK
Maintainers
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/invoicesCLI
# 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:listREST API
Run server:
invoices-serveKey endpoints:
GET /healthPOST /api/migratePOST /api/migrate/pgPOST /api/cloud/pushPOST /api/cloud/pullPOST /api/feedbackGET|POST /api/partiesGET|POST /api/invoicesGET /api/invoices/search?q=...POST /api/invoices/:id/statusGET /api/statsGET|POST /api/agentsPOST /api/agents/:id/heartbeatPOST /api/agents/:id/focus
MCP
Run MCP stdio server:
invoices-mcpCore tools:
migrate_database,migrate_postgrescloud_push,cloud_pull,send_feedbackcreate_party,list_partiescreate_invoice,get_invoice,list_invoices,search_invoices,update_invoice_status,delete_invoiceregister_agent,heartbeat,set_focus,list_agents
Dashboard
cd dashboard
bun install
bun run devSet API base if needed:
export VITE_API_BASE_URL=http://localhost:3487Security
- 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 testLicense
Apache-2.0
