FreshBooks CLI
/install freshbooks-cli
freshbooks-cli
CLI tool for managing FreshBooks invoices, clients, and billing. Uses the official @freshbooks/api SDK.
Install
npm install -g @haseebuchiha/freshbooks-cli
Requires .npmrc with @haseebuchiha:registry=https://npm.pkg.github.com for GitHub Package Registry.
Setup (once)
Authenticate with FreshBooks OAuth2. You must use the --manual flag (localhost redirect does not work with FreshBooks).
freshbooks auth login \
--client-id "\x3CFRESHBOOKS_CLIENT_ID>" \
--client-secret "\x3CFRESHBOOKS_CLIENT_SECRET>" \
--manual
This opens the browser. Authorize, then copy the code from the page and paste it into the CLI. Tokens are stored at ~/.config/freshbooks-cli/config.json (0600 permissions) and auto-refresh before expiry.
Verify: freshbooks auth status
Auth commands
freshbooks auth login --client-id \x3Cid> --client-secret \x3Csecret> --manual-- authenticate via OAuth2 OOB flowfreshbooks auth logout-- clear stored tokens and credentialsfreshbooks auth status-- show account ID, token expiry, and auth statefreshbooks auth refresh-- manually refresh the access token
Clients commands
freshbooks clients list [-p \x3Cpage>] [--per-page \x3Cn>] [-s \x3Csearch>]-- list clients, search by org namefreshbooks clients get \x3Cid>-- get a single client by IDfreshbooks clients create [--fname \x3Cname>] [--lname \x3Cname>] [--email \x3Cemail>] [--organization \x3Corg>]-- create a clientfreshbooks clients create --data '\x3Cjson>'-- create with full JSON payloadfreshbooks clients update \x3Cid> --data '\x3Cjson>'-- update a client
Example: freshbooks clients create --fname "Taha" --organization "abcg.io"
Invoices commands
freshbooks invoices list [-p \x3Cpage>] [--per-page \x3Cn>]-- list invoicesfreshbooks invoices get \x3Cid>-- get a single invoice by IDfreshbooks invoices create --client-id \x3Cid> [--lines '\x3Cjson>']-- create an invoice with line itemsfreshbooks invoices create --client-id \x3Cid> --data '\x3Cjson>'-- create with full JSON payloadfreshbooks invoices update \x3Cid> --data '\x3Cjson>'-- update an invoicefreshbooks invoices archive \x3Cid>-- archive an invoice (no permanent delete in FreshBooks)freshbooks invoices share-link \x3Cid>-- get a shareable link for an invoice
Line items format
Lines are a JSON array. Each line has name, qty, and unitCost (money object):
[
{"name": "Web Services", "qty": 1, "unitCost": {"amount": "15000.00", "code": "USD"}},
{"name": "App Services", "qty": 1, "unitCost": {"amount": "15000.00", "code": "USD"}}
]
Example (full invoice create):
freshbooks invoices create --client-id 818183 \
--lines '[{"name":"Web Services","qty":1,"unitCost":{"amount":"15000.00","code":"USD"}},{"name":"App Services","qty":1,"unitCost":{"amount":"15000.00","code":"USD"}}]'
Workflows
Onboard a new client and invoice them
freshbooks clients create --fname "Name" --organization "Company"-- note the returnedidfreshbooks invoices create --client-id \x3Cid> --lines '[...]'-- create the invoicefreshbooks invoices share-link \x3Cinvoice-id>-- get shareable link
Look up billing for a client
freshbooks clients list -s "company name"-- find the client IDfreshbooks invoices list-- list all invoices (filter by client in output)freshbooks invoices get \x3Cid>-- get full invoice details
Notes
- All output is JSON to stdout. Pipe to
jqfor filtering:freshbooks clients list | jq '.clients[].organization' - Money values are
{"amount": "string", "code": "USD"}. The amount is always a string like"30000.00", never a number. Do not use parseFloat on money. archivesets vis_state=1. FreshBooks does not support permanent deletion.- Tokens auto-refresh. If refresh fails, re-run
freshbooks auth login --client-id \x3Cid> --client-secret \x3Csecret> --manual. - Client credentials can also be read from env vars
FRESHBOOKS_CLIENT_IDandFRESHBOOKS_CLIENT_SECRET(takes priority over stored config). - Always use
--manualfor auth login. The localhost callback redirect URI does not work with FreshBooks. - Confirm with the user before creating invoices or modifying billing data.
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install freshbooks-cli - After installation, invoke the skill by name or use
/freshbooks-cli - Provide required inputs per the skill's parameter spec and get structured output
What is FreshBooks CLI?
FreshBooks CLI for managing invoices, clients, and billing. Use when the user mentions freshbooks, invoicing, billing, clients, or accounting. It is an AI Agent Skill for Claude Code / OpenClaw, with 1478 downloads so far.
How do I install FreshBooks CLI?
Run "/install freshbooks-cli" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is FreshBooks CLI free?
Yes, FreshBooks CLI is completely free (open-source). You can download, install and use it at no cost.
Which platforms does FreshBooks CLI support?
FreshBooks CLI is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created FreshBooks CLI?
It is built and maintained by haseebuchiha (@haseebuchiha); the current version is v1.0.0.