QuickBooks Online CLI — sync full ledger, query SQLite locally, run duplicate expenses audit, and manage accounting from the terminal.
Created by @kesslerio (Martin Kessler).
Quick Start
1. Install
See Install above.
2. Set Up Credentials
Get your access token from your API provider's developer portal, then store it:
qbo-pp-cli auth set-token YOUR_TOKEN_HERE
Or set it via environment variable:
export QBO_CLIENT_ID="your-token-here"
3. Verify Setup
qbo-pp-cli doctor
This checks your configuration and credentials.
4. Try Your First Command
qbo-pp-cli accounts get mock-value
Usage
Run qbo-pp-cli --help for the full command reference and flag list.
Commands
accounts
Manage accounts
qbo-pp-cli accounts create - Create or update an account
qbo-pp-cli accounts get - Get an account by ID
bills
Manage vendor bills
qbo-pp-cli bills create - Create or update a bill
qbo-pp-cli bills get - Get a bill by ID
cdc
Change Data Capture (CDC) endpoints for incremental syncs
qbo-pp-cli cdc - Query changed entities since a timestamp
customers
Manage customers
qbo-pp-cli customers create - Create or update a customer
qbo-pp-cli customers get - Get a customer by ID
invoices
Manage invoices
qbo-pp-cli invoices create - Create or update an invoice
qbo-pp-cli invoices get - Get an invoice by ID
journal_entries
Manage journal entries
qbo-pp-cli journal-entries create - Create or update a journal entry
qbo-pp-cli journal-entries get - Get a journal entry by ID
payments
Manage customer payments
qbo-pp-cli payments create - Create or update a payment
qbo-pp-cli payments get - Get a payment by ID
purchases
Manage purchases (Expenses)
qbo-pp-cli purchases create - Create or update a purchase
qbo-pp-cli purchases get - Get a purchase by ID
query
Run raw SQL queries against QBO (limitations apply; sync first to query SQLite locally)
qbo-pp-cli query - Run raw QuickBooks SQL query
vendors
Manage vendors
qbo-pp-cli vendors create - Create or update a vendor
qbo-pp-cli vendors get - Get a vendor by ID
Output Formats
# Human-readable table (default in terminal, JSON when piped)
qbo-pp-cli accounts get mock-value
# JSON for scripting and agents
qbo-pp-cli accounts get mock-value --json
# Filter to specific fields
qbo-pp-cli accounts get mock-value --json --select id,name,status
# Dry run — show the request without sending
qbo-pp-cli accounts get mock-value --dry-run
# Agent mode — JSON + compact + no prompts in one flag
qbo-pp-cli accounts get mock-value --agent
Agent Usage
This CLI is designed for AI agent consumption:
- Non-interactive - never prompts, every input is a flag
- Pipeable -
--json output to stdout, errors to stderr
- Filterable -
--select id,name returns only fields you need
- Previewable -
--dry-run shows the request without sending
- Explicit retries - add
--idempotent to create retries when a no-op success is acceptable
- Confirmable -
--yes for explicit confirmation of destructive actions
- Piped input - write commands can accept structured input when their help lists
--stdin
- Agent-safe by default - no colors or formatting unless
--human-friendly is set
Exit codes: 0 success, 2 usage error, 3 not found, 4 auth error, 5 API error, 7 rate limited, 10 config error.
Health Check
qbo-pp-cli doctor
Verifies configuration, credentials, and connectivity to the API.
Configuration
Config file: ~/.config/qbo-pp-cli/config.toml
Static request headers can be configured under headers; per-command header overrides take precedence.
Environment variables:
| Name | Kind | Required | Description |
|---|
QBO_CLIENT_ID | per_call | Yes | Set to your API credential. |
QBO_CLIENT_SECRET | per_call | Yes | Set to your API credential. |
QBO_REALM_ID | per_call | Yes | Set to your API credential. |
agentcookie (optional)
If you use agentcookie to sync secrets across machines, this CLI auto-adopts agentcookie-managed credentials with no extra setup. When the daemon writes to this CLI's config, qbo-pp-cli doctor reports agentcookie: detected and auth-status labels the source as agentcookie. Skip this section if you don't use agentcookie - the CLI works the same as any other.
Troubleshooting
Authentication errors (exit code 4)
- Run
qbo-pp-cli doctor to check credentials
- Verify the environment variable is set:
echo $QBO_CLIENT_ID
Not found errors (exit code 3)
- Check the resource ID is correct
- Run the
list command to see available items
Generated by CLI Printing Press