Install
openclaw skills install @jackeylee007/guanyuan-data观远数据API工具 - 支持多种认证方式、Token自动管理、卡片数据获取和CSV导出
openclaw skills install @jackeylee007/guanyuan-dataThis skill provides a command-line interface for GuanYuan Data (观远数据) API. It supports multiple authentication methods, automatic token management, card data retrieval, and CSV export with metadata generation.
When a user requests GuanYuan data operations:
Choose authentication method:
loginId and password in config for automatic logintoken directly in config fileguanyuan token <token> command to set token interactivelyGet card data: Use guanyuan card <cardId> to retrieve data in JSON format
Export to CSV: Use guanyuan csv <cardId> --output file.csv to export data
{
"baseUrl": "https://your-guanyuan-domain.com",
"domain": "your-domain",
"loginId": "your-login-id",
"password": "your-password"
}
Then run: guanyuan login
{
"baseUrl": "https://your-guanyuan-domain.com",
"domain": "your-domain",
"token": "your-token-here"
}
No login needed, directly use commands.
{
"baseUrl": "https://your-guanyuan-domain.com",
"domain": "your-domain"
}
Then run: guanyuan token <your-token> or guanyuan token (interactive)
login(): Authenticate and save tokengetCardData(cardId, options): Retrieve card dataconvertToCSV(cardData, sampleRows): Convert data to CSV formatextractMetadata(cardData): Extract field metadatasaveCSVWithMetadata(csv, filename, metadata, cardId): Save CSV and metadata filesgetValidToken(config): Auto-discover and use valid token from multiple sourcesbaseUrl, domainloginId + password, token, or none (use token command)| Command | Description | Example |
|---|---|---|
init | Initialize configuration (show setup instructions) | guanyuan init |
login | Login with credentials from config | guanyuan login |
token [token] | Set token (via parameter or interactive) | guanyuan token eyJ0eX... |
card <id> | Get card data (JSON) | guanyuan card abc123 --limit 50 |
csv <id> | Export to CSV | guanyuan csv abc123 --output data.csv |
status | Show config and token status | guanyuan status |
help | Show help | guanyuan help |
| Option | Description | Default |
|---|---|---|
--view <GRAPH|GRID> | Data view type | GRAPH |
--limit <number> | Number of rows | 100 |
--offset <number> | Data offset | 0 |
| Option | Description | Default |
|---|---|---|
--output <filename> | Output to file | stdout |
--sample <number> | Sample N rows | all rows |
┌─────────────────────────────────────────────────────────────┐
│ User wants to access GuanYuan data │
└────────────────────┬────────────────────────────────────────┘
│
v
┌─────────────────────────────────────────────────────────────┐
│ Check ~/.guanyuan/user.token │
│ Is there a valid token? │
└────────────────────┬────────────────────────────────────────┘
│
┌────────┴────────┐
│ │
Yes │ │ No
│ │
v v
┌───────────────────┐ ┌──────────────────────────────────┐
│ Use saved token │ │ Check config.json │
└───────────────────┘ │ - Has loginId + password? │
│ - Has token? │
│ - Neither? → Use token command │
└────────────┬─────────────────────┘
│
┌──────────────┼──────────────┐
│ │ │
Has Creds Has Token Neither
│ │ │
v v v
┌───────────┐ ┌───────────┐ ┌───────────────┐
│ Auto │ │ Use │ │ Prompt user │
│ Login │ │ Config │ │ to run │
│ │ │ Token │ │ 'guanyuan │
└───────────┘ └───────────┘ │ token' │
└───────────────┘
When exporting CSV with --output, a _meta.json file is automatically generated:
{
"cardId": "card-id",
"cardType": "CHART",
"chartType": "PIVOT_TABLE",
"view": "GRAPH",
"exportTime": "2026-03-25T07:52:00.924Z",
"totalRows": 10,
"dataLimit": 10,
"hasMoreData": false,
"fields": [
{
"name": "字段显示名称",
"originalName": "字段原始名称",
"type": "STRING/TIMESTAMP/DOUBLE",
"metaType": "DIM/METRIC",
"fieldType": "dimension/metric",
"fieldId": "field-id"
}
]
}
~/.guanyuan/user.token - Saved token (highest priority)config.json - Token field in configloginId + password from config# Via parameter
guanyuan token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...
# Interactive mode
guanyuan token
# Then paste your token when prompted
--limit to control API response size--sample to export only N rows without fetching all data