A command-line interface for Bkper, a financial accounting platform. Build and deploy Bkper apps, and manage your financial data -- books, accounts, transactions, and balances -- directly from the terminal.
bun add -g bkperOther package managers
# npm
npm i -g bkper
# yarn
yarn global add bkperbkper loginbkper app init my-app
cd my-app
bkper app devWhen ready, deploy to production:
bkper app sync && bkper app deployRun
bkper --helporbkper <command> --helpfor built-in documentation on any command.
Build, deploy, and manage Bkper apps.
# Scaffold a new app from the template
bkper app init my-app
# Start local development servers
bkper app dev
# Build artifacts
bkper app build
# Sync configuration and deploy to production
bkper app sync && bkper app deploy
# Deploy to development environment
bkper app deploy --preview
# Deploy only the events handler
bkper app deploy --events
# Check deployment status
bkper app status# Install an app on a book
bkper app install my-app -b abc123
# Uninstall an app from a book
bkper app uninstall my-app -b abc123# Store a secret (prompts for value)
bkper app secrets put API_KEY
# List all secrets
bkper app secrets list
# Delete a secret
bkper app secrets delete API_KEYApps are configured via a bkper.yaml file in the project root. See the complete reference with all available fields: bkper.yaml reference.
Environment variables:
BKPER_API_KEY-- Optional. If not set, uses the Bkper API proxy with a managed API key. Set it for direct API access with your own quotas. Follow these steps to enable.
Command reference
login- Authenticate with Bkper, storing credentials locallylogout- Remove stored credentials
app init <name>- Scaffold a new app from the templateapp list- List all apps you have access toapp sync- Sync bkper.yaml reference configuration (URLs, description) to Bkper APIapp build- Build app artifactsapp deploy- Deploy built artifacts to Cloudflare Workers for Platforms-p, --preview- Deploy to preview environment--events- Deploy events handler instead of web handler
app status- Show deployment statusapp undeploy- Remove app from platform-p, --preview- Remove from preview environment--events- Remove events handler instead of web handler--delete-data- Permanently delete all associated data (requires confirmation)--force- Skip confirmation prompts (use with--delete-datafor automation)
app dev- Run local development servers--cp, --client-port <port>- Client dev server port (default:5173)--sp, --server-port <port>- Server simulation port (default:8787)--ep, --events-port <port>- Events handler port (default:8791)-w, --web- Run only the web handler-e, --events- Run only the events handler--no-open- Do not open browser on startup
Note:
syncanddeployare independent operations. Usesyncto update your app's URLs in Bkper (required for webhooks and menu integration). Usedeployto push code to Cloudflare. For a typical deployment workflow, run both:bkper app sync && bkper app deploy
app install <appId> -b <bookId>- Install an app on a bookapp uninstall <appId> -b <bookId>- Uninstall an app from a book
app secrets put <name>- Store a secret-p, --preview- Set in preview environment
app secrets list- List all secrets-p, --preview- List from preview environment
app secrets delete <name>- Delete a secret-p, --preview- Delete from preview environment
Interact with books, accounts, transactions, and balances.
All data commands that operate within a book use -b, --book <bookId> to specify the book context. Use --json for machine-readable output on any command.
Create and manage financial books with locale-specific settings.
# List all books
bkper book list
# Get book details
bkper book get abc123
# Create a book with Brazilian settings
bkper book create --name "My Company" --fraction-digits 2 \
--date-pattern "dd/MM/yyyy" --decimal-separator COMMA \
--time-zone "America/Sao_Paulo"
# Create a book with custom properties
bkper book create --name "Project X" -p "code=PX001" -p "department=Engineering"
# Update a book
bkper book update abc123 --lock-date 2024-12-31Command reference
book list- List all books-q, --query <query>- Search query
book get <bookId>- Get a book's detailsbook create- Create a new book--name <name>- Book name (required)--fraction-digits <digits>- Number of decimal places (0-8)--date-pattern <pattern>- Date format pattern (dd/MM/yyyy,MM/dd/yyyy, oryyyy/MM/dd)--decimal-separator <separator>- Decimal separator (DOTorCOMMA)--time-zone <timezone>- IANA time zone (e.g.America/New_York,UTC)--period <period>- Period (MONTH,QUARTER, orYEAR)-p, --property <key=value>- Set a property (repeatable)
book update <bookId>- Update a book--name <name>- Book name--fraction-digits <digits>- Number of decimal places (0-8)--date-pattern <pattern>- Date format pattern (dd/MM/yyyy,MM/dd/yyyy, oryyyy/MM/dd)--decimal-separator <separator>- Decimal separator (DOTorCOMMA)--time-zone <timezone>- IANA time zone identifier (e.g.America/New_York,Europe/London,UTC)--lock-date <date>- Lock date in ISO format (yyyy-MM-dd, e.g.2024-01-31)--closing-date <date>- Closing date in ISO format (yyyy-MM-dd)--period <period>- Period (MONTH,QUARTER, orYEAR)-p, --property <key=value>- Set a property (repeatable, e.g.-p code=1010 -p branch=NYC; empty value deletes the property)
Manage your chart of accounts within a book.
# List all accounts
bkper account list -b abc123
# Get an account by name
bkper account get "Bank Account" -b abc123
# Create an asset account
bkper account create -b abc123 --name "Bank Account" --type ASSET --groups "Current Assets"
# Update an account
bkper account update "Bank Account" -b abc123 --type LIABILITY
# Archive an account
bkper account update "Old Account" -b abc123 --archived true
# Delete an account
bkper account delete "Old Account" -b abc123Command reference
account list -b <bookId>- List accounts in a bookaccount get <nameOrId> -b <bookId>- Get an accountaccount create -b <bookId>- Create a new account--name <name>- Account name (required)--type <type>- Account type (ASSET,LIABILITY,INCOMING,OUTGOING)--description <description>- Account description--groups <groups>- Comma-separated group names-p, --property <key=value>- Set a property (repeatable)
account update <nameOrId> -b <bookId>- Update an account--name <name>- Account name--type <type>- Account type (ASSET,LIABILITY,INCOMING,OUTGOING)--archived <true|false>- Archive status-p, --property <key=value>- Set a property (repeatable, merges with existing)
account delete <nameOrId> -b <bookId>- Delete an account
Organize accounts into hierarchical groups for structured reporting.
# List all groups (shows hierarchy)
bkper group list -b abc123
# Create a group
bkper group create -b abc123 --name "Current Assets"
# Create a child group
bkper group create -b abc123 --name "Cash" --parent "Current Assets"
# Update a group
bkper group update "Cash" -b abc123 --hidden true
# Delete a group
bkper group delete "Cash" -b abc123Command reference
group list -b <bookId>- List groups in a bookgroup get <nameOrId> -b <bookId>- Get a groupgroup create -b <bookId>- Create a new group--name <name>- Group name (required)--parent <parent>- Parent group name or ID--hidden- Hide the group-p, --property <key=value>- Set a property (repeatable)
group update <nameOrId> -b <bookId>- Update a group--name <name>- Group name--hidden <true|false>- Hide status-p, --property <key=value>- Set a property (repeatable, merges with existing)
group delete <nameOrId> -b <bookId>- Delete a group
Record, query, and manage financial transactions.
# Create a transaction
bkper transaction create -b abc123 --date 2025-01-15 --amount 100.50 \
--from "Bank Account" --to "Office Supplies" --description "Printer paper"
# List transactions with a query
bkper transaction list -b abc123 -q "after:2025-01-01"
# List with custom properties included
bkper transaction list -b abc123 -q "account:Sales" -p
# Update a transaction
bkper transaction update tx_456 -b abc123 --amount 120.00 --description "Printer paper (corrected)"
# Post a draft transaction
bkper transaction post tx_456 -b abc123
# Check (reconcile) a transaction
bkper transaction check tx_456 -b abc123
# Trash a transaction
bkper transaction trash tx_456 -b abc123
# Merge two duplicate transactions
bkper transaction merge tx_123 tx_456 -b abc123Command reference
transaction list -b <bookId> -q <query>- List transactions matching a query-l, --limit <limit>- Maximum number of results (1-1000, default100)-c, --cursor <cursor>- Pagination cursor-p, --properties- Include custom properties in the output
transaction create -b <bookId>- Create a transaction--date <date>- Transaction date (required)--amount <amount>- Transaction amount (required)--description <description>- Transaction description--from <from>- Credit account (source)--to <to>- Debit account (destination)--url <url>- URL (repeatable)--remote-id <remoteId>- Remote ID (repeatable)-p, --property <key=value>- Set a property (repeatable, empty value deletes)
transaction update <transactionId> -b <bookId>- Update a transaction--date <date>- Transaction date--amount <amount>- Transaction amount--description <description>- Transaction description--from <from>- Credit account (source)--to <to>- Debit account (destination)--url <url>- URL (repeatable, replaces all)-p, --property <key=value>- Set a property (repeatable, empty value deletes)
transaction post <id> -b <bookId>- Post a draft transactiontransaction check <id> -b <bookId>- Check a transactiontransaction trash <id> -b <bookId>- Trash a transactiontransaction merge <id1> <id2> -b <bookId>- Merge two transactions
Query account balances and group totals.
# List balances for a query
bkper balance list -b abc123 -q "period:2025-01"
# Expand groups to see individual accounts
bkper balance list -b abc123 -q "period:2025-01" --expanded 2Command reference
balance list -b <bookId> -q <query>- List balances--expanded <level>- Expand groups to specified depth (0+)
Organize books into collections.
# Create a collection
bkper collection create --name "My Collection"
# Add books to a collection
bkper collection add-book col_789 -b abc123 -b def456
# List all collections
bkper collection list
# Remove a book from a collection
bkper collection remove-book col_789 -b abc123
# Delete a collection
bkper collection delete col_789Command reference
collection list- List all collectionscollection get <collectionId>- Get a collectioncollection create- Create a new collection--name <name>- Collection name (required)
collection update <collectionId>- Update a collection--name <name>- Collection name
collection delete <collectionId>- Delete a collectioncollection add-book <collectionId>- Add books to a collection-b, --book <bookId>- Book ID (repeatable)
collection remove-book <collectionId>- Remove books from a collection-b, --book <bookId>- Book ID (repeatable)
All commands output human-readable formatted tables by default. Use the --json global flag to get raw JSON output instead.
# Table output (default)
bkper book list
# JSON output
bkper book list --jsonThe getOAuthToken function returns a Promise that resolves to a valid OAuth token, for use with the bkper-js library:
import { Bkper } from 'bkper-js';
import { getOAuthToken } from 'bkper';
Bkper.setConfig({
oauthTokenProvider: async () => getOAuthToken(),
});