首页龙虾技能列表 › Invoice Generator — 技能工具

🧾 Invoice Generator — 技能工具

v1.0.0

[自动翻译] Generate professional PDF invoices from JSON data. Use when the user needs to create an invoice, billing document, or payment request with company/cli...

2· 3,962·24 当前·24 累计
by @tmigone (Tomás Migone)·MIT-0
下载技能包
License
MIT-0
最后更新
2026/2/27
安全扫描
VirusTotal
无害
查看报告
OpenClaw
可疑
medium confidence
该技能提供发票生成功能,代码和指令与其声明目的一致。
评估建议
此技能用于生成发票文档,使用前请确保了解相关法律法规。...
详细分析 ▾
用途与能力
Name/description (generate PDFs from JSON) matches the required binaries (node, jq, weasyprint) and the single env var INVOICE_DIR. Requesting a directory path as the primaryEnv is unusual but explainable (output/config location). Handlebars dependency is appropriate for templating.
指令范围
Runtime instructions and the script operate within the stated purpose (read JSON from stdin/file/config, render HTML with Handlebars, convert to PDF with weasyprint, write to $INVOICE_DIR). However, the script references assets/invoice.hbs (template) which is not present in the provided file manifest — that makes the skill incomplete and will cause failures or unexpected behavior. The script also reads configs from $INVOICE_DIR/configs and will write PDFs to $INVOICE_DIR/invoices; ensure that INVOICE_DIR is set to a safe directory (not a system or credential folder).
安装机制
This is instruction-only with no install spec; the SKILL.md tells users to run 'npm install' in the skill folder. That is reasonable but means network access to npm is required at install time and the node_modules will be created on disk. No remote downloads or unusual installers are used in the package files present.
凭证需求
Only INVOICE_DIR is required. That's a directory path (not a secret token) and is directly used to read configs and write invoices, so the requested env var is proportionate. Warning: if a user points INVOICE_DIR at a sensitive system path the script could read or overwrite files in its configs/invoices subpaths — the skill does not request network credentials or other unrelated secrets.
持久化与权限
always is false and the skill does not request persistent platform-level privileges. It writes generated files under the user-specified INVOICE_DIR and creates a local node_modules when installing — standard behavior for a CLI-style skill.
安全有层次,运行前请审查代码。

License

MIT-0

可自由使用、修改和再分发,无需署名。

运行时依赖

无特殊依赖

版本

latestv1.0.02026/1/23

Initial release: Generate PDF invoices from structured JSON. - Converts invoice data in JSON format to professional PDF files. - Supports multiple input methods: stdin, file path, or saved config. - Stores generated invoices in a user-specified directory. - Handles auto-versioning for duplicate filenames. - Provides clear error handling for invalid input or PDF generation issues.

● 无害

安装命令 点击复制

官方npx clawhub@latest install invoice-generator
镜像加速npx clawhub@latest install invoice-generator --registry https://cn.clawhub-mirror.com

技能文档

Generate PDF invoices from structured JSON data.

Setup

  • Install Node.js dependencies:
cd invoice-generator && npm install
  • Set INVOICE_DIR environment variable (or in skills.entries.invoice-generator.env):
export INVOICE_DIR="/path/to/your/invoices"

This creates the directory structure:

$INVOICE_DIR/
├── configs/    # Optional: saved invoice configs
└── invoices/   # Generated PDF output

Usage

# From stdin (on-the-fly)
cat invoice-data.json | {baseDir}/scripts/generate.sh

# From a full file path {baseDir}/scripts/generate.sh /path/to/invoice-data.json

# From a saved config (looks in $INVOICE_DIR/configs/) {baseDir}/scripts/generate.sh client-template # Loads: $INVOICE_DIR/configs/client-template.json

# Output goes to: $INVOICE_DIR/invoices/invoice-{number}.pdf (auto-versions if exists)

Input Data Format

The JSON input must contain these fields:

{
  "company": {
    "name": "Your Company",
    "address": "123 Main St",
    "cityStateZip": "City, State, 12345",
    "country": "Country"
  },
  "client": {
    "name": "Client Name",
    "address": "456 Client Ave",
    "cityStateZip": "City, State, 67890",
    "country": "Country",
    "taxId": "TAX123"
  },
  "invoice": {
    "number": "INV-2025.01",
    "date": "Jan 15 2025",
    "dueDate": "Jan 30 2025"
  },
  "items": [
    {
      "description": "Service description",
      "rate": "1000.00",
      "currency": "USD"
    }
  ],
  "totals": {
    "currency": "USD",
    "total": "1,000.00"
  }
}

See references/data-schema.md for complete field documentation.

Output

The script outputs the path to the generated PDF file on success:

$INVOICE_DIR/invoices/invoice-INV-2025.01.pdf
# If that filename already exists, the script will write:
# $INVOICE_DIR/invoices/invoice-INV-2025.01-2.pdf (then -3, etc.)

Error Handling

  • Exits with code 1 if JSON is invalid or missing required fields
  • Exits with code 2 if weasyprint fails to generate PDF
  • Error messages are written to stderr
数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制

免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制

了解定制服务