← 返回
数据分析 Key 中文

FreshBooks CLI

FreshBooks CLI for managing invoices, clients, and billing. Use when the user mentions freshbooks, invoicing, billing, clients, or accounting.
用于管理发票、客户和账单的 FreshBooks 命令行工具。当用户提及 freshbooks、开票、账单、客户或会计时使用。
haseebuchiha
数据分析 clawhub v1.0.0 1 版本 99785.4 Key: 需要
★ 1
Stars
📥 1,840
下载
💾 28
安装
1
版本
#latest

概述

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 "<FRESHBOOKS_CLIENT_ID>" \
  --client-secret "<FRESHBOOKS_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 --client-secret --manual -- authenticate via OAuth2 OOB flow
  • freshbooks auth logout -- clear stored tokens and credentials
  • freshbooks auth status -- show account ID, token expiry, and auth state
  • freshbooks auth refresh -- manually refresh the access token

Clients commands

  • freshbooks clients list [-p ] [--per-page ] [-s ] -- list clients, search by org name
  • freshbooks clients get -- get a single client by ID
  • freshbooks clients create [--fname ] [--lname ] [--email ] [--organization ] -- create a client
  • freshbooks clients create --data '' -- create with full JSON payload
  • freshbooks clients update --data '' -- update a client

Example: freshbooks clients create --fname "Taha" --organization "abcg.io"

Invoices commands

  • freshbooks invoices list [-p ] [--per-page ] -- list invoices
  • freshbooks invoices get -- get a single invoice by ID
  • freshbooks invoices create --client-id [--lines ''] -- create an invoice with line items
  • freshbooks invoices create --client-id --data '' -- create with full JSON payload
  • freshbooks invoices update --data '' -- update an invoice
  • freshbooks invoices archive -- archive an invoice (no permanent delete in FreshBooks)
  • freshbooks invoices share-link -- 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

  1. freshbooks clients create --fname "Name" --organization "Company" -- note the returned id
  2. freshbooks invoices create --client-id --lines '[...]' -- create the invoice
  3. freshbooks invoices share-link -- get shareable link

Look up billing for a client

  1. freshbooks clients list -s "company name" -- find the client ID
  2. freshbooks invoices list -- list all invoices (filter by client in output)
  3. freshbooks invoices get -- get full invoice details

Notes

  • All output is JSON to stdout. Pipe to jq for 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.
  • archive sets vis_state=1. FreshBooks does not support permanent deletion.
  • Tokens auto-refresh. If refresh fails, re-run freshbooks auth login --client-id --client-secret --manual.
  • Client credentials can also be read from env vars FRESHBOOKS_CLIENT_ID and FRESHBOOKS_CLIENT_SECRET (takes priority over stored config).
  • Always use --manual for auth login. The localhost callback redirect URI does not work with FreshBooks.
  • Confirm with the user before creating invoices or modifying billing data.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-28 19:26 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

Excel / XLSX

ivangdavila
创建、检查和编辑 Microsoft Excel 工作簿及 XLSX 文件,支持可靠的公式、日期、类型、格式、重算及模板保留功能。
★ 367 📥 140,249
data-analysis

A股量化 AkShare

mbpz
A股量化数据分析工具,基于AkShare库获取A股行情、财务数据、板块信息等。用于回答关于A股股票查询、行情数据、财务分析、选股等问题。
★ 164 📥 59,860
data-analysis

Stock Analysis

udiedrichsen
{"answer":"基于雅虎财经数据,分析股票与加密货币。支持投资组合管理、自选股预警、股息分析、8维评分、热门趋势扫描及传闻/早期信号探测。适用于股票分析、持仓追踪、财报异动、加密监控、热门股追踪或提前发掘非主流传闻。"}
★ 270 📥 56,928