Xero Cli

v1.0.7

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

0· 343·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for teddyengel/xero-cli.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Xero Cli" (teddyengel/xero-cli) from ClawHub.
Skill page: https://clawhub.ai/teddyengel/xero-cli
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Required env vars: XERO_CLIENT_ID, XERO_CLIENT_SECRET
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install xero-cli

ClawHub CLI

Package manager switcher

npx clawhub@latest install xero-cli
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description match the code and required environment variables. The skill only requests XERO_CLIENT_ID and XERO_CLIENT_SECRET, which are exactly what's needed to authenticate to the Xero API. The included commands operate on invoices, contacts, accounts, payments and bank transactions via the Xero SDK — consistent with the description.
Instruction Scope
The SKILL.md instructs the agent to run the repo's TypeScript CLI via 'npx -y bun ${SKILL_DIR}/scripts/cli.ts'. At runtime the code will: open a browser for OAuth, start a local Express server on port 5001 to receive the callback, call Xero's API endpoints, and read/write a local token file (data/tokens.json). These actions are coherent with performing OAuth and using the Xero API, but they do give the skill the ability to bind a local port, open the browser, and write files under the skill directory. The code also reads optional env vars (XERO_REDIRECT_URI, XERO_SCOPES) beyond the two declared required env vars.
Install Mechanism
There is no formal install spec in registry metadata, but SKILL.md uses 'npx -y bun' to execute the TypeScript scripts. That will fetch and execute a runtime package via npx (npm). This is a common pattern but means the agent will download and run a package at execution time rather than relying on preinstalled, audited binaries. The repository includes full source code, so code will run from the checked-in files.
Credentials
Only XERO_CLIENT_ID and XERO_CLIENT_SECRET are required and are appropriate for a Xero integration. The code also checks optional env vars (XERO_REDIRECT_URI, XERO_SCOPES) which are reasonable for customizing OAuth behavior. No unrelated secrets or platform credentials are requested.
Persistence & Privilege
The skill stores OAuth tokens to a local file (data/tokens.json) inside the skill directory and can refresh tokens. It also starts a temporary HTTP server on port 5001 during authentication. 'always' is false and the skill is user-invocable, so it will not be force-enabled globally. The file writes and port binding are expected for an OAuth client but are persistent effects you should be aware of.
Assessment
This skill appears to do what it says: it needs your Xero client ID/secret, will open a browser for OAuth, run a temporary local server on port 5001, and store tokens under the skill's data/tokens.json. Before installing or running: (1) confirm you trust the source (repo: https://github.com/TeddyEngel/XeroCli), (2) be aware that 'npx -y bun' will fetch/execute a runtime package at execution time — consider running in an isolated environment or container if you want extra safety, (3) understand the skill will write tokens to the skill directory (revoke the Xero app or clear tokens if you stop using it), and (4) if you need stricter control, inspect the included source files yourself (they are present) and/or change XERO_REDIRECT_URI to a value you control. If anything is unclear, run the OAuth step manually outside the agent or test in a throwaway workspace first.

Like a lobster shell, security has layers — review code before you run it.

Runtime requirements

📊 Clawdis
EnvXERO_CLIENT_ID, XERO_CLIENT_SECRET
Primary envXERO_CLIENT_ID
latestvk97799v6mrvsbths5wm5j6vgen82paa4
343downloads
0stars
8versions
Updated 1mo ago
v1.0.7
MIT-0

Xero Accounting Skill

Interact with Xero accounting software via CLI. Manage invoices, contacts, payments, bank transactions, and more. All commands output JSON for easy parsing.

Script Directory

Agent: Determine this SKILL.md file's directory as SKILL_DIR, then run commands with:

npx -y bun ${SKILL_DIR}/scripts/cli.ts <command>

Setup

1. Get Xero Credentials

Users need a Xero Developer account with API credentials:

  1. Go to developer.xero.com/app/manage
  2. Create a Web App
  3. Set redirect URI: http://localhost:5001/callback
  4. Copy the Client ID and Client Secret

Note: If you see a scopes configuration page, add: openid, offline_access, accounting.contacts, accounting.settings, accounting.invoices, accounting.payments, accounting.banktransactions, accounting.attachments. If no scopes page is shown, that's fine - scopes are requested during OAuth.

Agent note: If credentials are missing, ask the user for their Client ID and Secret.

2. Configure OpenClaw

Add credentials to openclaw.json:

{
  "skills": {
    "xero": {
      "env": {
        "XERO_CLIENT_ID": "your_client_id",
        "XERO_CLIENT_SECRET": "your_client_secret"
      }
    }
  }
}

3. Authenticate

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

This opens a browser for OAuth. Once complete, verify with:

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

Quick Reference

Command prefix: npx -y bun ${SKILL_DIR}/scripts/cli.ts

Authentication

CommandDescription
auth loginStart OAuth flow (opens browser)
auth statusCheck authentication status
auth logoutClear stored credentials

Organizations

CommandDescription
tenants listList connected Xero organizations
tenants select <id>Switch active organization

Invoices

CommandDescription
invoices listList all invoices
invoices list --status AUTHORISEDFilter by status
invoices list --contact <id>Filter by contact
invoices get <id>Get invoice details
invoices create --contact <id> --items '<json>'Create invoice
invoices update <id> --status AUTHORISEDUpdate status

Statuses: DRAFT, AUTHORISED, PAID, VOIDED

Types: ACCREC (sales), ACCPAY (bills)

Contacts

CommandDescription
contacts listList all contacts
contacts list --search "name"Search by name
contacts list --customersOnly customers
contacts list --suppliersOnly suppliers
contacts get <id>Get contact details
contacts create --name "X" --email "Y"Create contact

Accounts

CommandDescription
accounts listList all accounts
accounts list --type REVENUEFilter by type
accounts list --class EXPENSEFilter by class
accounts get <id>Get account details

Types: BANK, REVENUE, EXPENSE, FIXED, CURRENT, LIABILITY, EQUITY, etc.

Classes: ASSET, EQUITY, EXPENSE, LIABILITY, REVENUE

Bank Transactions

CommandDescription
banktransactions listList all transactions
banktransactions list --type SPENDFilter by type
banktransactions get <id>Get details
banktransactions create ...Create transaction
banktransactions attach <id> <file>Attach file

Types: SPEND, RECEIVE, RECEIVE-OVERPAYMENT, SPEND-OVERPAYMENT

Payments

CommandDescription
payments listList all payments
payments list --invoice <id>Filter by invoice
payments get <id>Get payment details
payments create ...Create payment
payments delete <id>Void payment

Allocations

CommandDescription
allocations list-overpaymentsList overpayments
allocations list-prepaymentsList prepayments
allocations list-creditnotesList credit notes
allocations overpayment -o <id> -i <inv> -a <amt>Apply overpayment
allocations prepayment -p <id> -i <inv> -a <amt>Apply prepayment
allocations creditnote -c <id> -i <inv> -a <amt>Apply credit note

Examples

Create an Invoice

# 1. Find the contact
npx -y bun ${SKILL_DIR}/scripts/cli.ts contacts list --search "Acme"

# 2. Get revenue account codes
npx -y bun ${SKILL_DIR}/scripts/cli.ts accounts list --type REVENUE

# 3. Create the invoice
npx -y bun ${SKILL_DIR}/scripts/cli.ts invoices create \
  --contact "<contact-id>" \
  --items '[{"description":"Consulting","quantity":10,"unitAmount":150,"accountCode":"200"}]' \
  --reference "INV-001"

# 4. Authorize when ready
npx -y bun ${SKILL_DIR}/scripts/cli.ts invoices update <invoice-id> --status AUTHORISED

Record a Payment

# 1. Get bank account ID
npx -y bun ${SKILL_DIR}/scripts/cli.ts accounts list --type BANK

# 2. Create payment (marks invoice as paid)
npx -y bun ${SKILL_DIR}/scripts/cli.ts payments create \
  --invoice "<invoice-id>" \
  --account "<bank-account-id>" \
  --amount 500.00 \
  --reconciled

Create a Contact

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

Record Bank Transaction with Receipt

# 1. Create transaction
npx -y bun ${SKILL_DIR}/scripts/cli.ts banktransactions create \
  --type RECEIVE \
  --bank-account "<bank-id>" \
  --contact "<contact-id>" \
  --items '[{"description":"Payment","unitAmount":500,"accountCode":"200"}]'

# 2. Attach receipt
npx -y bun ${SKILL_DIR}/scripts/cli.ts banktransactions attach "<transaction-id>" ./receipt.pdf

Error Handling

Errors return JSON:

{"error": "Not authenticated. Run auth login"}

Common errors:

ErrorSolution
Not authenticatedRun auth login
Token expiredRun auth login again
No organization selectedRun tenants list then tenants select <id>

Security Notes

Token Storage: OAuth tokens are saved to data/tokens.json in the working directory. This file contains sensitive access/refresh tokens - treat it as you would other credentials.

Environment Variables: The skill reads XERO_CLIENT_ID and XERO_CLIENT_SECRET from environment (set via OpenClaw config). Optional: XERO_REDIRECT_URI (default: http://localhost:5001/callback) and XERO_SCOPES.

Source Code: All skill code is bundled in the scripts/ directory for inspection. Review before granting access to production Xero organizations.

Comments

Loading comments...