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

dc-qb-cli

v0.1.0

Published

QuickBooks Online CLI - CRUD for invoices, payments, customers, and products

Downloads

101

Readme

qb - QuickBooks CLI

CRUD operations for QuickBooks Online: invoices, payments, customers, and products.

Installation

pnpm install
pnpm build
npm link  # optional: makes 'qb' available globally

Setup

  1. Create an app at developer.intuit.com
  2. Set environment variables:
export QB_CLIENT_ID="your-client-id"
export QB_CLIENT_SECRET="your-client-secret"
  1. Authenticate:
qb auth login

Usage

qb [global flags] <command> <subcommand> [args]

Global Flags

| Flag | Env Var | Description | |------|---------|-------------| | -h, --help | | Show help | | --version | | Print version | | -q, --quiet | QB_QUIET=1 | Suppress non-essential output | | -v, --verbose | QB_VERBOSE=1 | Show debug information | | --json | QB_OUTPUT=json | Output as JSON | | --plain | QB_OUTPUT=plain | Tab-separated values, no headers | | --no-color | NO_COLOR=1 | Disable color output | | --no-input | QB_NO_INPUT=1 | Fail instead of prompting | | --company <id> | QB_COMPANY_ID | Override default company | | --sandbox | QB_SANDBOX=1 | Use sandbox environment |

Commands

auth

Manage QuickBooks authentication.

qb auth login          # OAuth browser flow
qb auth logout         # Revoke and delete tokens
qb auth status         # Show current auth state
qb auth switch         # Switch between companies

invoice

Manage invoices.

# List invoices
qb invoice list
qb invoice list --status unpaid --json
qb invoice list --limit 50 --all

# Get invoice details
qb invoice get 1234

# Create invoice from file
qb invoice create -f invoice.json

# Create from stdin
cat invoice.json | qb invoice create --stdin

# Update invoice
qb invoice update 1234 -f updates.json

# Delete (with confirmation)
qb invoice delete 1234
qb invoice delete 1234 --force  # skip confirmation

# Send invoice via email
qb invoice send 1234

customer

Manage customers.

# List customers
qb customer list
qb customer list --query "Acme"
qb customer list --all --json

# Get customer details
qb customer get 5

# Create customer
qb customer create -f customer.json

# Update customer
qb customer update 5 -f updates.json

# Deactivate customer (soft delete)
qb customer delete 5
qb customer delete 5 --force

payment

Manage payments.

# List payments
qb payment list
qb payment list --since 2025-01-01

# Get payment details
qb payment get 789

# Create payment
qb payment create -f payment.json

# Update payment
qb payment update 789 -f updates.json

# Delete payment
qb payment delete 789 --force

# Void payment
qb payment void 789
qb payment void 789 --force --reason "Customer dispute"

product

Manage products/items.

# List products
qb product list
qb product list --type Service
qb product list --type Inventory --json

# Get product details
qb product get 42

# Create product
qb product create -f product.json

# Update product
qb product update 42 -f updates.json

# Deactivate product (soft delete)
qb product delete 42
qb product delete 42 --force

Data Format

All create/update operations accept JSON files. Example invoice:

{
  "CustomerRef": {
    "value": "5"
  },
  "Line": [
    {
      "Amount": 500.00,
      "DetailType": "SalesItemLineDetail",
      "SalesItemLineDetail": {
        "ItemRef": {
          "value": "1"
        }
      }
    }
  ],
  "DueDate": "2025-02-15"
}

Example customer:

{
  "DisplayName": "Acme Corporation",
  "CompanyName": "Acme Corp",
  "PrimaryEmailAddr": {
    "Address": "[email protected]"
  },
  "PrimaryPhone": {
    "FreeFormNumber": "(555) 123-4567"
  }
}

Exit Codes

| Code | Meaning | |------|---------| | 0 | Success | | 1 | General error (API failure, network) | | 2 | Invalid usage (bad args, missing required) | | 3 | Authentication error (not logged in, expired) | | 4 | Not found (resource doesn't exist) | | 5 | Conflict (duplicate, version mismatch) | | 130 | Interrupted (Ctrl-C) |

Config

Token storage: ~/.config/qb/tokens.json

Config file: ~/.config/qb/config.toml

[defaults]
company_id = "1234567890"
output = "json"
sandbox = false

Precedence: CLI flags > env vars > project config > user config > defaults

Scripting Examples

# Get all unpaid invoices over 30 days as JSON
qb invoice list --status unpaid --json | jq '.[] | select(.days_overdue > 30)'

# Export all customers
qb customer list --all --json > customers.json

# Bulk create from JSONL
cat customers.jsonl | while read line; do
  echo "$line" | qb customer create --stdin
done

# Check if authenticated before running
if qb auth status > /dev/null 2>&1; then
  qb invoice list
else
  echo "Not authenticated"
  exit 1
fi

Development

pnpm install          # Install dependencies
pnpm dev              # Run in dev mode
pnpm build            # Build for production
pnpm typecheck        # Type check
pnpm lint             # Lint code
pnpm test             # Run tests

License

MIT