← Back to Skills Marketplace
wangshuaiitr-ai

Byteplan Chat

by wangshuaiitr-ai · GitHub ↗ · v1.0.2 · MIT-0
cross-platform ⚠ suspicious
277
Downloads
0
Stars
1
Active Installs
3
Versions
Install in OpenClaw
/install byteplan-chart
Description
BytePlan AI 图表生成技能。当用户查询 byteplan 中的数据、请求数据可视化、生成图表(如"查看不同性别分数段分布"、"查询学生成绩分布"、"byteplan 数据分析")时自动触发。支持 12 种图表类型(柱状图、折线图、饼图等)。
README (SKILL.md)

BytePlan Chart - BytePlan AI 图表生成技能

功能描述

通过 BytePlan AI 接口自动生成数据可视化图表,支持 12 种图表类型。

配置说明

环境变量(.env 文件)

# BytePlan API 配置
BYTEPLAN_BASE_URL=https://uatapp.byteplan.com
BYTEPLAN_AUTH_USER=PC
BYTEPLAN_AUTH_PASS=你的认证密码

# 登录参数
BYTEPLAN_USERNAME=你的用户名
BYTEPLAN_PASSWORD=你的密码(会自动 RSA 加密)
BYTEPLAN_GRANT_TYPE=password
BYTEPLAN_SCOPE=write
# BYTEPLAN_PUBLIC_KEY_ID 不再需要,运行时动态获取

# AI 配置
BYTEPLAN_AGENT_ID=Agent ID(可选,留空则自动生成)
BYTEPLAN_PAGE_CODE=AI_REPORT

# 图表配置
CHART_WIDTH=800
CHART_HEIGHT=600
CHART_OUTPUT_DIR=charts

配置项说明

配置项 说明 默认值
BYTEPLAN_BASE_URL BytePlan API 基础 URL https://uatapp.byteplan.com
BYTEPLAN_AUTH_USER API 认证用户名 PC
BYTEPLAN_AUTH_PASS API 认证密码 -
BYTEPLAN_USERNAME 登录用户名 -
BYTEPLAN_PASSWORD 登录密码(自动 RSA 加密) -
BYTEPLAN_AGENT_ID AI Agent ID 自动生成
CHART_OUTPUT_DIR 图表输出目录 charts

使用方法

命令行

cd skills/byteplan-chart
uv run python main.py \x3C查询内容>

示例

# 查询不同分数段学生数量
uv run python main.py 查询不同分数段学生数量

# 查看不同性别分数段分布
uv run python main.py 查看不同性别分数段分布

# 生成折线图
uv run python main.py 展示每月销售趋势

支持的图表类型

全部支持(12 种)✅

类型 说明 状态
Line 折线图
Column 柱状图(支持分组/堆叠)
Bar 条形图
Area 面积图
Pie 饼图
Rose 南丁格尔玫瑰图
Scatter 散点图
Box 箱型图
Heatmap 热力图
DualAxisChart 双轴图(柱状图 + 折线图)
DetailTable 明细表
PivotTable 透视表

测试时间: 2026-03-13 12:40
测试结果: 12/12 通过 ✅

工作流程

  1. 🔑 请求公钥接口获取 RSA 公钥(含 keyId 和 key)
  2. 🔐 使用公钥对密码进行 RSA 加密
  3. 🔑 使用加密后的密码和 keyId 登录获取 access_token
  4. 📡 调用 AI 接口识别 model_code
  5. 📊 执行 AI 分析请求获取图表数据
  6. 🎨 使用 matplotlib 渲染图表为 PNG(纯 Python 方案,自动检测中文字体

渲染方案

当前使用:matplotlib(纯 Python)

特性 说明
渲染引擎 matplotlib 3.10+
字体处理 自动检测系统字体并配置
支持平台 Windows / macOS / Linux
输出格式 PNG(150 DPI)

字体检测

渲染时自动执行:

  1. 检测操作系统
  2. 查找预装中文字体
  3. 配置 matplotlib 字体参数
  4. 输出检测日志

支持的字体

  • Windows: Microsoft YaHei(微软雅黑)、SimHei(黑体)、SimSun(宋体)
  • macOS: PingFang SC(苹方)、Heiti SC(黑体)
  • Linux: WenQuanYi Zen Hei(文泉驿)、Noto Sans CJK

如遇到中文乱码

# Linux 安装字体
sudo apt-get install fonts-wqy-zenhei fonts-noto-cjk  # Ubuntu/Debian
sudo yum install wqy-zenhei-fonts google-noto-sans-cjk-fonts  # CentOS/RHEL

输出

  • 图表文件: charts/antv_chart_YYYYMMDD_HHMMSS.png
  • 控制台输出: 完整的 API 响应和图表信息

依赖

  • Python 3.8+
  • Python 包:requests, python-dotenv, pycryptodome, matplotlib, numpy

安装依赖

第一步:创建虚拟环境

Windows:

cd C:\Users\wangshuai\.openclaw\skills\byteplan-chart
uv venv

macOS / Linux:

cd ~/.openclaw/skills/byteplan-chart
uv venv

第二步:安装 Python 包

uv pip install requests python-dotenv pycryptodome matplotlib numpy

🍎 macOS 兼容性

  • 完全兼容 macOS 10.15+ (Catalina 或更高版本)
  • 中文字体: 自动检测并使用 PingFang SC(苹方)或 Heiti SC(黑体)
  • 路径处理: 使用 pathlib.Path 自动适配 macOS 路径格式
  • 编码: UTF-8 编码,无乱码问题

验证安装

cd skills/byteplan-chart
uv run python main.py 查询不同分数段学生数量

查看输出中的字体检测信息:

🔍 检测系统中文字体...
✅ 找到中文字体:Microsoft YaHei
✅ 字体配置成功:Microsoft YaHei

🔧 修复记录(2026-03-13)

问题 1:渲染脚本调用命令错误

  • 文件: main.py (第 473 行)
  • 问题: 使用 py 命令在虚拟环境中找不到 matplotlib
  • 修复: 改为 uv run python 确保在虚拟环境中运行
  • 代码: ['uv', 'run', 'python', str(render_script), ...]

问题 2:参数检查错误

  • 文件: render_chart.py (第 607 行)
  • 问题: len(sys.argv) \x3C 4 检查错误,实际只需要 3 个参数
  • 修复: 改为 len(sys.argv) \x3C 3
  • 说明: 参数 = 脚本名 + JSON 字符串 + 输出路径

问题 3:依赖缺失

  • 问题: 虚拟环境中缺少 matplotlib 等必要的 Python 包
  • 修复: 使用 uv pip install 安装所有依赖

安全提示

  • .env 文件包含敏感信息,请勿提交到版本控制
  • 建议将 .env 添加到 .gitignore
  • 定期更新 API 凭证
Usage Guidance
This skill appears to implement BytePlan integration and chart rendering, but its published metadata incorrectly states it requires no environment variables while the code expects multiple sensitive values (API auth user/pass, login username/password). Before installing: (1) treat any .env you create as sensitive — do not put real production credentials there; prefer a limited-scope or read-only test account. (2) Review main.py lines that log entire API responses (these can contain tokens) and remove or redact verbose prints. (3) Verify the BASE_URL is the intended endpoint (default points at a UAT host) and ensure HTTPS is used. (4) Run the skill in an isolated environment (VM or container) and inspect network traffic if possible. (5) If you will use real credentials, consider adding token caching with secure storage and avoid writing tokens to logs. Finally, ask the publisher to correct the registry metadata to list required env vars and to document what fields the API responses contain so you can judge logging exposure.
Capability Analysis
Type: OpenClaw Skill Name: byteplan-chart Version: 1.0.2 The byteplan-chart skill bundle is a legitimate tool designed to interface with the BytePlan API (uatapp.byteplan.com) for data visualization. The code in main.py and render_chart.py implements a standard workflow: fetching RSA public keys for secure password encryption, authenticating to obtain access tokens, and rendering various chart types using matplotlib. No evidence of data exfiltration to unauthorized domains, malicious command execution, or prompt injection attacks was found; the logic is consistent with the stated purpose of generating charts from user queries.
Capability Assessment
Purpose & Capability
Name/description (BytePlan chart generation) matches the code and docs: the code calls BytePlan endpoints, obtains a public key, logs in, calls AI endpoints, and renders charts with matplotlib. The requested network access and crypto usage are consistent with that purpose.
Instruction Scope
SKILL.md and main.py instruct reading a local .env and performing login flows, RSA-encrypting the user password, calling BytePlan AI APIs, and printing '完整的 API 响应' to console. Printing entire API responses risks exposing sensitive tokens/credentials in logs; instructions also recommend creating a .env with passwords. The runtime instructions do not ask for unrelated system files, but they are permissive about logging sensitive data.
Install Mechanism
No download-from-URL install step; dependencies are standard Python packages installed via pip in a virtualenv. No installer pulls arbitrary archives or executes remote code during install. This is low-risk compared with download-style installs.
Credentials
Registry metadata lists no required env vars/credentials, but SKILL.md, .env, main.py, and README expect multiple sensitive values (BYTEPLAN_BASE_URL, BYTEPLAN_AUTH_USER, BYTEPLAN_AUTH_PASS, BYTEPLAN_USERNAME, BYTEPLAN_PASSWORD, etc.). That mismatch is an incoherence: the skill will read and require credentials despite metadata claiming none. The credentials requested are relevant to the stated BytePlan integration, but the metadata omission and the code's verbose logging of API responses increase risk of accidental credential exposure.
Persistence & Privilege
The skill is not marked always:true and does not request system-wide configuration changes. It reads its own .env and does not attempt to modify other skills or agent-wide settings. Autonomous invocation is allowed by platform default (not flagged by itself).
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install byteplan-chart
  3. After installation, invoke the skill by name or use /byteplan-chart
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.2
**BytePlan Chart v1.0.2 Changelog** - 图表渲染从 Node.js + node-canvas 切换为纯 Python 方案,使用 matplotlib 支持跨平台及中文字体自动检测。 - 移除 render_antv.js,新增 render_chart.py,简化渲染部署依赖。 - 增加对中文字体自动检测与配置,提升在 Windows/macOS/Linux 下多语言兼容性。 - 修复命令行参数及依赖问题,保证虚拟环境下功能完整可用。 - 丰富配置说明、依赖安装与常见问题排查指引。
v1.0.1
- 更新工作流程,明确步骤
v1.0.0
BytePlan 图表自动生成技能首次发布。 - 支持基于 BytePlan AI 数据分析接口自动生成 12 种图表类型,包括柱状图、折线图、饼图等 - 提供详细的环境变量与配置说明,便于快速集成与部署 - 支持命令行方式查询并生成 PNG 格式图表文件 - 输出包括控制台 API 信息和本地图表图片 - 提供安全及依赖管理建议
Metadata
Slug byteplan-chart
Version 1.0.2
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 3
Frequently Asked Questions

What is Byteplan Chat?

BytePlan AI 图表生成技能。当用户查询 byteplan 中的数据、请求数据可视化、生成图表(如"查看不同性别分数段分布"、"查询学生成绩分布"、"byteplan 数据分析")时自动触发。支持 12 种图表类型(柱状图、折线图、饼图等)。 It is an AI Agent Skill for Claude Code / OpenClaw, with 277 downloads so far.

How do I install Byteplan Chat?

Run "/install byteplan-chart" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Byteplan Chat free?

Yes, Byteplan Chat is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Byteplan Chat support?

Byteplan Chat is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Byteplan Chat?

It is built and maintained by wangshuaiitr-ai (@wangshuaiitr-ai); the current version is v1.0.2.

💬 Comments