Help center
Use the command line and SDK
Bookledo has a command line tool and a code library for a developer who wants to work with your books from a terminal or from a program. Both do what the app and the API do, with the same key, the same plan rules and the same audit log. If you only want an AI assistant to help with your books, read Connect AI to your books instead.
Both tools are free to install from npm, the public library of JavaScript packages. They need Node 18 or newer.
Get an API key first
Both tools sign in with an API key from your business. Make one on the AI access tab, as described in Connect AI to your books. A key reads and writes only the business it was made in. Without the confirm permission, a write from a key waits in AI Activity for you to approve it, so nothing reaches your books by surprise. Review what AI drafted covers that screen.
Install the command line tool
In a terminal, run this command.
npm install -g bookledo
Sign in
bookledo login
The tool asks for your key and checks it before saving anything. You can also pass it with --key. The key is saved in a file only your computer user can read. On a Mac or Linux that is ~/.config/bookledo/config.json. On Windows it is in the bookledo folder inside %APPDATA%.
Two more commands help along the way.
bookledo whoamishows the business the key belongs to, its plan, and where the key came from.bookledo logoutremoves the saved key.
On a server or in an automated job, set the BOOKLEDO_API_KEY environment variable instead. It wins over a saved key. Fill it from your secret store, not from a file in the project.
See what you can do
bookledo ops list --filter invoice
bookledo ops describe invoices.create
The first command lists every operation, and --filter narrows the list. The second shows what one operation does, which permission and plan it needs, and the fields it accepts. Neither needs a key.
Run an operation
bookledo call reports.profitAndLoss --data '{"from":"2026-01-01","to":"2026-03-31"}'
bookledo call invoices.list --field overdue:=true
You can give the input in a few ways.
--data '{...}'takes JSON written right there.--data @invoice.jsonreads a file.--data -reads whatever you pipe in.--field name=valuesets one field as text and can be repeated. Use:=for a number or a true or false value, as in--field limit:=10. A dotted name such ascustomer.name=Annfills a field inside another.
Add --json to get plain JSON that other tools can read. Use --base-url or the BOOKLEDO_BASE_URL variable to point at a different server, such as a copy running on your own computer.
What the exit codes mean
A script can check how the tool finished.
- 0 means it worked.
- 1 means Bookledo refused the call, or the tool could not reach Bookledo. The tool prints
Errorfollowed by the code and the message, for exampleError insufficient_scopewith the reason. The Free plan, a missing permission and invalid input all land here. - 2 means the command itself was wrong, such as a missing operation name.
Use the SDK in your own code
A developer who prefers to write a program can use the library instead.
import { Bookledo } from '@bookledo/sdk'
const client = new Bookledo({ apiKey: process.env.BOOKLEDO_API_KEY })
const { invoices } = await client.invoices.list({ overdue: true })
Install it in your project with npm install @bookledo/sdk. Every operation is typed, so a code editor suggests the fields as you type. The library retries a read once if the network drops or Bookledo is briefly unavailable, and it never retries a write. A failed call raises a BookledoError that carries the code and message. The full reference for developers is on the package page at https://www.npmjs.com/package/@bookledo/sdk.