可编程信用卡智能财务管家
简介
基于Klutch官方API的个人开源工具,提供信用卡管理、自动支出分析与预算管控,支持1Password安全凭证与细粒度权限控制。
原始描述
OpenClaw skill for Klutch programmable credit card API integration. View cards, transactions, spending categories, and analyze spending patterns.
通过你的 Agent 添加
安装目录:klutch/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
技能正文
name: klutch description: OpenClaw skill for Klutch programmable credit card API integration. View cards, transactions, spending categories, and analyze spending patterns. metadata: openclaw: emoji: 💳 requires: env: [] optional_env: - KLUTCH_CLIENT_ID - KLUTCH_SECRET_KEY - KLUTCH_API_KEY - KLUTCH_API_SECRET - KLUTCH_1PASSWORD_ITEM install: - id: pip kind: pip requirements: requirements.txt
Klutch Skill
OpenClaw skill for Klutch programmable credit card API integration.
Overview
This skill provides a command-line interface for accessing Klutch credit card data through their GraphQL API. It supports viewing card information, transaction history, spending categories, and spending analysis.
Prerequisites
- Klutch Account: Active Klutch credit card account
- API Credentials: Client ID and Secret Key from Klutch developer portal
- Python 3.10+: Required for running the scripts
Configuration
Environment Variables
Set your Klutch API credentials:
# Option 1: Direct credentials
export KLUTCH_CLIENT_ID="your-client-id"
export KLUTCH_SECRET_KEY="your-secret-key"
# Option 2: 1Password CLI integration (requires 'op' CLI)
export KLUTCH_1PASSWORD_ITEM="Klutch API Credential"
Configuration File
The skill stores configuration and session tokens in ~/.config/klutch/:
~/.config/klutch/
├── config.json # User preferences
└── token.json # Cached session token (auto-managed)
Configuration Options
Edit ~/.config/klutch/config.json to customize:
{
"api": {
"endpoint": "https://graphql.klutchcard.com/graphql",
"timeout": 30
}
}
Commands Reference
Balance
# Check card information
python scripts/klutch.py balance
# Example output:
{
"cards": [
{
"id": "crd_xxx",
"name": "Martin Kessler",
"status": "ACTIVE"
}
]
}
Transactions
# List recent transactions (last 30 days)
python scripts/klutch.py transactions
# Limit results
python scripts/klutch.py transactions --limit 25
# Example output:
{
"transactions": [
{
"id": "txn_xxx",
"amount": -100.0,
"merchantName": "Checking",
"transactionStatus": "SETTLED"
}
]
}
Card Management
List Cards
python scripts/klutch.py card list
View Categories
python scripts/klutch.py card categories
View Spending by Category
python scripts/klutch.py card spending
Configuration Management
# Get configuration value
python scripts/klutch.py config get api.timeout
# Set configuration value
python scripts/klutch.py config set api.timeout 60
# View all configuration
python scripts/klutch.py config get
API Endpoints
The skill connects to Klutch's GraphQL API:
| Environment | Endpoint |
|---|---|
| Production | https://graphql.klutchcard.com/graphql |
| Sandbox | https://sandbox.klutchcard.com/graphql |
Authentication Flow
The skill uses Klutch's session token authentication:
- Initial Request: Sends
createSessionTokenmutation with Client ID and Secret Key - Token Caching: Stores the JWT session token in
~/.config/klutch/token.json - Subsequent Requests: Uses cached token until it expires
- Auto-Refresh: Creates a new session token when the cached one fails
Hypothetical Agent Use Cases
The Klutch skill enables agents to handle their own budget or provide personal finance assistance.
- Sub-Agent Budgeting: Create a virtual card for a sub-agent to pay for its own usage (AWS, OpenAI) with a hard limit.
- Budget Guardrails: Monitor spending categories (e.g., 'FOOD') and alert the user if they exceed a monthly budget.
- Transaction Alerts: Watch for specific merchants or unusual activity and notify the user immediately.
- Expense Summary: Summarize monthly spending and categorize transactions for personal journaling.
Error Handling
The skill handles common error scenarios:
- Authentication failures: Prompts to verify credentials
- Session expiration: Automatically creates a new session token
- Network errors: Clear error messages with retry suggestions
- GraphQL errors: Detailed error messages from the API
Integration with OpenClaw
Using from OpenClaw Sessions
# OpenClaw can invoke the skill directly
klutch balance
klutch transactions --limit 5
klutch card list
Troubleshooting
Authentication Issues
If you receive authentication errors:
- Verify your credentials with
python scripts/klutch.py config get - Delete
~/.config/klutch/token.jsonto force re-authentication - Check that your API credentials are correct
Session Token Issues
Force token refresh:
rm ~/.config/klutch/token.json
Security Notes
- Never commit credentials to version control
- The skill stores tokens in
~/.config/klutch/token.json - Session tokens are refreshed automatically when needed
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。