返回顶部
f

freshbooks-cliFreshBooks命令行工具

FreshBooks CLI for managing invoices, clients, and billing. Use when the user mentions freshbooks, invoicing, billing, clients, or accounting.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
1,438
下载量
免费
免费
1
收藏
概述
安装方式
版本历史

freshbooks-cli

freshbooks-cli

用于管理FreshBooks发票、客户和账单的CLI工具。使用官方@freshbooks/api SDK。

安装

bash
npm install -g @haseebuchiha/freshbooks-cli

需要包含@haseebuchiha:registry=https://npm.pkg.github.com的.npmrc文件,用于GitHub包注册表。

设置(一次性操作)

通过FreshBooks OAuth2进行身份验证。必须使用--manual标志(localhost重定向不适用于FreshBooks)。

bash
freshbooks auth login \
--client-id CLIENTID> \
--client-secret CLIENTSECRET> \
--manual

此操作会打开浏览器。授权后,从页面复制代码并粘贴到CLI中。令牌存储在~/.config/freshbooks-cli/config.json(权限为0600),并在过期前自动刷新。

验证:freshbooks auth status

认证命令

  • - freshbooks auth login --client-id --client-secret --manual -- 通过OAuth2 OOB流程进行身份验证
  • freshbooks auth logout -- 清除存储的令牌和凭证
  • freshbooks auth status -- 显示账户ID、令牌过期时间和认证状态
  • freshbooks auth refresh -- 手动刷新访问令牌

客户命令

  • - freshbooks clients list [-p ] [--per-page ] [-s ] -- 列出客户,按组织名称搜索
  • freshbooks clients get -- 按ID获取单个客户
  • freshbooks clients create [--fname ] [--lname ] [--email ] [--organization ] -- 创建客户
  • freshbooks clients create --data -- 使用完整JSON负载创建客户
  • freshbooks clients update --data -- 更新客户

示例:freshbooks clients create --fname Taha --organization abcg.io

发票命令

  • - freshbooks invoices list [-p ] [--per-page ] -- 列出发票
  • freshbooks invoices get -- 按ID获取单个发票
  • freshbooks invoices create --client-id [--lines ] -- 创建包含行项目的发票
  • freshbooks invoices create --client-id --data -- 使用完整JSON负载创建发票
  • freshbooks invoices update --data -- 更新发票
  • freshbooks invoices archive -- 归档发票(FreshBooks不支持永久删除)
  • freshbooks invoices share-link -- 获取发票的可分享链接

行项目格式

行项目是一个JSON数组。每个行项目包含name、qty和unitCost(金额对象):

json
[
{name: Web服务, qty: 1, unitCost: {amount: 15000.00, code: USD}},
{name: 应用服务, qty: 1, unitCost: {amount: 15000.00, code: USD}}
]

示例(完整创建发票):

bash
freshbooks invoices create --client-id 818183 \
--lines [{name:Web服务,qty:1,unitCost:{amount:15000.00,code:USD}},{name:应用服务,qty:1,unitCost:{amount:15000.00,code:USD}}]

工作流程

接入新客户并开具发票

  1. 1. freshbooks clients create --fname 姓名 --organization 公司 -- 记下返回的id
  2. freshbooks invoices create --client-id --lines [...] -- 创建发票
  3. freshbooks invoices share-link -- 获取可分享链接

查找客户的账单信息

  1. 1. freshbooks clients list -s 公司名称 -- 查找客户ID
  2. freshbooks invoices list -- 列出所有发票(在输出中按客户筛选)
  3. freshbooks invoices get -- 获取完整发票详情

注意事项

  • - 所有输出均为JSON格式到标准输出。可通过管道传递给jq进行筛选:freshbooks clients list | jq .clients[].organization
  • 金额值为{amount: string, code: USD}。金额始终为字符串,如30000.00,绝不是数字。不要对金额使用parseFloat。
  • archive操作将visstate设置为1。FreshBooks不支持永久删除。
  • 令牌会自动刷新。如果刷新失败,请重新运行freshbooks auth login --client-id --client-secret --manual。
  • 客户端凭证也可以从环境变量FRESHBOOKSCLIENTID和FRESHBOOKSCLIENT_SECRET中读取(优先级高于存储的配置)。
  • 认证登录时始终使用--manual标志。localhost回调重定向URI不适用于FreshBooks。
  • 在创建发票或修改账单数据前,请先与用户确认。

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 freshbooks-cli-1776347347 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 freshbooks-cli-1776347347 技能

通过命令行安装

skillhub install freshbooks-cli-1776347347

下载

⬇ 下载 freshbooks-cli v1.0.0(免费)

文件大小: 2.36 KB | 发布时间: 2026-4-17 15:05

v1.0.0 最新 2026-4-17 15:05
Initial release of freshbooks-cli.

- Provides CLI commands for managing FreshBooks invoices, clients, and billing using the official API SDK.
- Supports OAuth2 authentication via a manual (OOB) flow.
- Includes commands to create, update, list, and retrieve clients and invoices.
- Offers the ability to generate shareable invoice links and archive invoices.
- Outputs all data as JSON for easy scripting and integration.
- Provides setup, command reference, and sample workflows in documentation.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部