@centry-digital/bukku-cli
v2.0.4
Published
Bukku accounting CLI - manage invoices, contacts, and accounting from the command line
Maintainers
Readme
@centry-digital/bukku-cli
A command-line interface for Bukku, a Malaysian accounting platform. Manage invoices, contacts, products, and more from your terminal.
What can it do?
The CLI exposes 169 commands across 9 categories, covering the full Bukku API:
| Category | Commands | What you can do | |----------|----------|-----------------| | Sales | 42 | Quotes, orders, delivery orders, invoices, credit notes, payments, refunds | | Purchases | 36 | Purchase orders, bills, credit notes, goods received notes, payments, refunds | | Banking | 18 | Money in, money out, bank transfers | | Contacts | 12 | Customers, suppliers, contact groups | | Products | 18 | Products, bundles, product groups | | Accounting | 13 | Chart of accounts, journal entries | | Files | 3 | Upload and manage file attachments | | Control Panel | 21 | Locations, tags, tag groups | | Reference Data | 10 | Tax codes, currencies, payment methods, terms, and more |
Every list/get/create/update/delete operation available in the Bukku web UI is available from the command line.
Quick Start
Try it without installing:
npx @centry-digital/bukku-cli --helpOr install globally:
npm install -g @centry-digital/bukku-cli
bukku --helpConfiguration
The CLI needs two things: your API token and company subdomain. There are three ways to provide them, listed in order of precedence:
1. CLI flags (highest precedence)
bukku --api-token YOUR_TOKEN --company-subdomain YOUR_SUB sales invoices list2. Environment variables
export BUKKU_API_TOKEN=your-token-here
export BUKKU_COMPANY_SUBDOMAIN=your-subdomain
bukku sales invoices list3. Config file (~/.bukkurc)
bukku config set api_token your-token-here
bukku config set company_subdomain your-subdomainVerify your configuration:
bukku config showThis shows the resolved value for each field and where it came from (flag, environment variable, or config file).
Using with AI Tools
The CLI works great as a tool for AI assistants. Since it outputs structured JSON by default and writes errors to stderr, AI tools can parse the output directly.
Claude Code
First, configure your credentials:
bukku config set api_token your-token-here
bukku config set company_subdomain your-subdomainThen ask Claude Code to use the CLI. For example:
- "Use
bukkuto list my unpaid invoices" - "Create a sales invoice for RM 5,000 to contact 123 using
bukku" - "Show me last month's bank transactions with
bukku"
Claude Code can run bukku commands via its Bash tool, read the JSON output, and take follow-up actions.
Tip: For AI-assisted accounting with richer integration, see also @centry-digital/bukku-mcp — an MCP server that exposes Bukku as native AI tools.
Usage Examples
Sales
# List recent invoices
bukku sales invoices list --limit 5
# Get a specific invoice
bukku sales invoices get 123
# Create an invoice
bukku sales invoices create --data '{
"contact_id": 1,
"date": "2025-01-15",
"currency_code": "MYR",
"exchange_rate": 1,
"tax_mode": "exclusive",
"payment_mode": "credit",
"status": "draft",
"form_items": [{"account_id": 100, "description": "Consulting", "amount": 5000}],
"term_items": [{"payment_due": "100%", "date": "2025-02-15"}]
}'
# List quotes in table format
bukku sales quotes list --format tablePurchases
# List bills
bukku purchases bills list --format table
# Get a specific bill
bukku purchases bills get 456
# List purchase orders
bukku purchases orders list --limit 10Banking
# List money-in transactions
bukku banking money-in list --limit 10
# List money-out transactions
bukku banking money-out list --format table
# List bank transfers
bukku banking transfers listContacts
# List all contacts
bukku contacts contacts list --format table
# Get a specific contact
bukku contacts contacts get 789
# List contact groups
bukku contacts contact-groups listProducts
# List products
bukku products products list --format table
# Get a specific product
bukku products products get 123
# List product groups
bukku products product-groups listAccounting
# List journal entries
bukku accounting journal-entries list
# Search chart of accounts
bukku accounting accounts list --format tableFiles
# Upload a file
bukku files upload /path/to/receipt.pdf
# List uploaded files
bukku files files listControl Panel
# List locations
bukku control-panel locations list
# List tags
bukku control-panel tags list --format table
# List tag groups
bukku control-panel tag-groups listReference Data
# List tax codes
bukku ref-data tax-codes
# List currencies
bukku ref-data currencies
# List payment methods
bukku ref-data payment-methods
# List classification codes (Malaysia e-Invoice)
bukku ref-data classification-codesInput Formats
For create and update commands, provide JSON data in one of these ways:
Inline with --data flag:
bukku sales invoices create --data '{"contact_id": 1, "date": "2025-01-15", ...}'Piped from a file:
cat invoice.json | bukku sales invoices createDry run (preview without sending):
bukku sales invoices create --data '{"contact_id": 1, ...}' --dry-runDry run shows the HTTP method, URL, and request body that would be sent, without making the API call.
Output Formats
JSON (default): Machine-readable output, easy to pipe to jq:
bukku sales invoices list | jq '.[0].total'Table: Human-readable table format:
bukku sales invoices list --format tableErrors are written to stderr as structured JSON, so they don't interfere with piped output.
Exit Codes
| Code | Meaning | |------|---------| | 0 | Success | | 1 | General error | | 2 | Authentication error (missing or invalid credentials) | | 3 | API error (Bukku returned an error) | | 4 | Validation error (invalid input or config) |
Getting Your API Token
- Log into your Bukku account
- Go to Control Panel > Integrations > API Access
- Generate a new API token (or copy your existing one)
- Note your company subdomain from the URL (e.g.
mycompanyfrommycompany.bukku.my)
Uninstalling
npm uninstall -g @centry-digital/bukku-cliTo also remove your saved configuration:
rm ~/.bukkurcRelated
- @centry-digital/bukku-mcp -- MCP server for connecting AI assistants (Claude, etc.) to Bukku
- GitHub repository
License
MIT
