🦀 ClawHub
Test Data Generator
by @shenghoo123-png
Generate customized test data in JSON, CSV, or SQL (MySQL/PostgreSQL) formats using built-in or custom templates with realistic fields like names, emails, an...
TERMINAL
clawhub install test-data-gen📖 About This Skill
test-data-gen — 测试数据生成器
痛点
场景
定价
指令格式
基本用法
test-data-gen [字段名] [数量] [格式]
生成示例
test-data-gen users 100 json # 生成100条用户JSON
test-data-gen orders 50 csv # 生成50条订单CSV
test-data-gen products 20 sql mysql # 生成20条产品SQL(MySQL)
test-data-gen products 20 sql pg # 生成20条产品SQL(PostgreSQL)
内置数据模板
| 模板 | 字段 | |------|------| | users | id, name, email, phone, age, gender | | orders | id, user_id, product, amount, status, created_at | | products | id, name, price, stock, category | | reviews | id, user_id, product_id, rating, comment | | addresses | id, user_id, province, city, district, detail |自定义模板(Pro)
test-data-gen --template my_template.json 100 json
字段类型
name — 中文姓名email — 随机邮箱phone — 中国手机号(以1开头)age — 18-80岁gender — 男/女amount — 金额(0.01-9999.99)date — 日期(2020-01-01 ~ 今天)enum — 自定义枚举值输出格式
--format json — JSON数组--format csv — CSV(带表头)--format sql --db mysql|pg — SQL INSERT语句