闲社服务运行正常AI智能体自动化平台
x

Xero会计交互

技能标识:xero

Interact with Xero accounting software - manage invoices, contacts, accounts, payments, and bank transactions

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 1.0.7
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

Xero会计交互

Xero 会计技能

通过命令行界面与 Xero 会计软件交互。管理发票、联系人、付款、银行交易等。所有命令均输出 JSON 格式,便于解析。

脚本目录

代理: 确定此 SKILL.md 文件的目录为 SKILL_DIR,然后使用以下命令运行:

bash
npx -y bun ${SKILL_DIR}/scripts/cli.ts <命令>

设置

1. 获取 Xero 凭证

用户需要拥有 Xero 开发者账户及 API 凭证:

  1. 1. 访问 developer.xero.com/app/manage
  2. 创建一个 Web 应用
  3. 设置重定向 URI:http://localhost:5001/callback
  4. 复制 客户端 ID 和 客户端密钥

注意:如果看到作用域配置页面,请添加:openid、offline_access、accounting.contacts、accounting.settings、accounting.invoices、accounting.payments、accounting.banktransactions、accounting.attachments。如果没有显示作用域页面,也没关系——作用域会在 OAuth 过程中请求。

代理提示: 如果缺少凭证,请向用户询问其客户端 ID 和密钥。

2. 配置 OpenClaw

将凭证添加到 openclaw.json:

json
{
skills: {
xero: {
env: {
XEROCLIENTID: 你的客户端ID,
XEROCLIENTSECRET: 你的客户端密钥
}
}
}
}

3. 身份验证

bash
npx -y bun ${SKILL_DIR}/scripts/cli.ts auth login

此命令会打开浏览器进行 OAuth 认证。完成后,使用以下命令验证:

bash
npx -y bun ${SKILL_DIR}/scripts/cli.ts auth status

快速参考

命令前缀: npx -y bun ${SKILL_DIR}/scripts/cli.ts

身份验证

命令描述
auth login启动 OAuth 流程(打开浏览器)
auth status
检查身份验证状态 | | auth logout | 清除存储的凭证 |

组织

命令描述
tenants list列出已连接的 Xero 组织
tenants select <id>
切换活动组织 |

发票

命令描述
invoices list列出所有发票
invoices list --status AUTHORISED
按状态筛选 | | invoices list --contact | 按联系人筛选 | | invoices get | 获取发票详情 | | invoices create --contact --items | 创建发票 | | invoices update --status AUTHORISED | 更新状态 |

状态: DRAFT(草稿)、AUTHORISED(已授权)、PAID(已付款)、VOIDED(已作废)

类型: ACCREC(销售)、ACCPAY(采购)

联系人

命令描述
contacts list列出所有联系人
contacts list --search 名称
按名称搜索 | | contacts list --customers | 仅显示客户 | | contacts list --suppliers | 仅显示供应商 | | contacts get | 获取联系人详情 | | contacts create --name X --email Y | 创建联系人 |

账户

命令描述
accounts list列出所有账户
accounts list --type REVENUE
按类型筛选 | | accounts list --class EXPENSE | 按类别筛选 | | accounts get | 获取账户详情 |

类型: BANK(银行)、REVENUE(收入)、EXPENSE(费用)、FIXED(固定资产)、CURRENT(流动资产)、LIABILITY(负债)、EQUITY(权益)等。

类别: ASSET(资产)、EQUITY(权益)、EXPENSE(费用)、LIABILITY(负债)、REVENUE(收入)

银行交易

命令描述
banktransactions list列出所有交易
banktransactions list --type SPEND
按类型筛选 | | banktransactions get | 获取详情 | | banktransactions create ... | 创建交易 | | banktransactions attach <文件> | 附加文件 |

类型: SPEND(支出)、RECEIVE(收款)、RECEIVE-OVERPAYMENT(收款多付)、SPEND-OVERPAYMENT(支出多付)

付款

命令描述
payments list列出所有付款
payments list --invoice <id>
按发票筛选 | | payments get | 获取付款详情 | | payments create ... | 创建付款 | | payments delete | 作废付款 |

分配

命令描述
allocations list-overpayments列出多付款项
allocations list-prepayments
列出预付款项 | | allocations list-creditnotes | 列出贷项通知单 | | allocations overpayment -o -i <发票> -a <金额> | 应用多付款项 | | allocations prepayment -p -i <发票> -a <金额> | 应用预付款项 | | allocations creditnote -c -i <发票> -a <金额> | 应用贷项通知单 |

示例

创建发票

bash

1. 查找联系人


npx -y bun ${SKILL_DIR}/scripts/cli.ts contacts list --search Acme

2. 获取收入账户代码

npx -y bun ${SKILL_DIR}/scripts/cli.ts accounts list --type REVENUE

3. 创建发票

npx -y bun ${SKILL_DIR}/scripts/cli.ts invoices create \ --contact <联系人ID> \ --items [{description:咨询服务,quantity:10,unitAmount:150,accountCode:200}] \ --reference INV-001

4. 准备就绪后授权

npx -y bun ${SKILL_DIR}/scripts/cli.ts invoices update <发票ID> --status AUTHORISED

记录付款

bash

1. 获取银行账户 ID


npx -y bun ${SKILL_DIR}/scripts/cli.ts accounts list --type BANK

2. 创建付款(将发票标记为已付款)

npx -y bun ${SKILL_DIR}/scripts/cli.ts payments create \ --invoice <发票ID> \ --account <银行账户ID> \ --amount 500.00 \ --reconciled

创建联系人

bash
npx -y bun ${SKILL_DIR}/scripts/cli.ts contacts create \
--name Acme 公司 \
--email billing@acme.com \
--customer

记录带收据的银行交易

bash

1. 创建交易


npx -y bun ${SKILL_DIR}/scripts/cli.ts banktransactions create \
--type RECEIVE \
--bank-account <银行ID> \
--contact <联系人ID> \
--items [{description:付款,unitAmount:500,accountCode:200}]

2. 附加收据

npx -y bun ${SKILL_DIR}/scripts/cli.ts banktransactions attach <交易ID> ./receipt.pdf

错误处理

错误返回 JSON 格式:

json
{error: 未认证。请运行 auth login}

常见错误:

错误解决方案
未认证运行 auth login
令牌已过期
再次运行 auth login |
| 未选择组织 | 运行 tenants list,然后运行 tenants select |

安全说明

令牌存储: OAuth 令牌保存到工作目录中的 data/tokens.json 文件。此文件包含敏感的访问/刷新令牌——请像对待其他凭证一样对待它。

环境变量: 该技能从环境变量中读取 XERO_CLIENT

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 xero-cli-1776126363 技能

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

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

通过命令行安装

skillhub install xero-cli-1776126363

下载

⬇ 下载 xero v1.0.7(免费)

文件大小: 21.85 KB | 发布时间: 2026-4-15 15:03

v1.0.7 最新 2026-4-15 15:03
- Fixed issue with using old xero scopes
- Clarified the setup instructions for obtaining Xero credentials by noting which OAuth2 scopes should be added on Xero's app configuration page (or that scopes will be requested during OAuth).
- No other changes detected.
返回顶部