genlab 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +78 -2
  2. package/dist/cli.mjs +1677 -0
  3. package/package.json +64 -4
package/README.md CHANGED
@@ -1,3 +1,79 @@
1
- # Temporary Holding Version
1
+ # genlab
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ 给本地 agent(Claude Code、Codex 等)用的 AI 媒体生成命令行工具。通过 [kie.ai](https://kie.ai) 生成图片、视频、音频(音乐、音效、语音),产物与完整生成记录保存在本机的库里。
4
+
5
+ ## 安装
6
+
7
+ 需要 Node.js 22+。
8
+
9
+ ```bash
10
+ npm install -g genlab # 或直接 npx genlab <命令>
11
+ ```
12
+
13
+ 初始化配置(API Key 与库目录,写入 `~/.config/genlab/.env`,同名环境变量优先):
14
+
15
+ ```bash
16
+ genlab init
17
+ # 或:genlab init --key <KIE_API_KEY> --library ~/GenLab
18
+ ```
19
+
20
+ 给 agent 安装使用说明(skill):
21
+
22
+ ```bash
23
+ npx skills add WBBB0730/genlab -g -s genlab
24
+ ```
25
+
26
+ ## 用法
27
+
28
+ ```bash
29
+ genlab models --kind image --search gpt-image
30
+ genlab models gpt-image-2-5-sunburst-text-to-image # 价格与参数表
31
+ genlab create 角色/主角立绘 -m gpt-image-2-5-sunburst-text-to-image -p prompt="像素风骑士立绘" -n 4
32
+ genlab edit 角色/主角立绘 2 -m gpt-image-2-5-sunburst-image-to-image -p prompt="盔甲改成蓝色" -p input_urls=@source
33
+ genlab use 角色/主角立绘 3
34
+ genlab create 片头/镜头 -m wan/3-0-video -p prompt="骑士转身拔剑" -p first_frame_url=@<库>/<项目>/角色/主角立绘/v3.png
35
+ genlab list
36
+ ```
37
+
38
+ 参数用 `-p key=value`(`key:=JSON` 传 JSON 值,同键重复即数组);值写 `@<路径>` 上传本机文件,`@source` 引用 AI 编辑的源版本。
39
+
40
+ 完整命令见 `genlab --help` 与 [skills/genlab/SKILL.md](skills/genlab/SKILL.md)。
41
+
42
+ ## 库
43
+
44
+ ```
45
+ <GENLAB_LIBRARY>/
46
+ projects.json 代码项目 → 项目的映射
47
+ <项目>/<文件夹…>/<素材>/
48
+ asset.json 素材、生成、版本的完整记录
49
+ v1.png v2.png … 各版本产物
50
+ references/<生成编号>/ 参考输入副本
51
+ ```
52
+
53
+ 项目由当前代码项目自动确定:有远程仓库时取仓库名,没有时用 `genlab project <名字>` 登记一次。
54
+
55
+ ## 模型
56
+
57
+ 模型清单与参数实时取自 kie 的模型目录与 schema(缓存一天,`genlab models --refresh` 强制刷新),覆盖 kie 上全部图片、视频、音频模型。
58
+
59
+ ## 开发
60
+
61
+ ```bash
62
+ pnpm install
63
+ pnpm dev <命令> # 直接运行源码
64
+ pnpm test
65
+ pnpm lint
66
+ pnpm typecheck
67
+ pnpm build
68
+ pnpm link --global # 本机全局使用开发版
69
+ ```
70
+
71
+ ## 发布
72
+
73
+ 推送 `v*` tag 后由 GitHub Actions 发布到 npm,tag 含 `-beta` 时以 `beta` 标签发布。首次使用前需在 npmjs.com 为本包配置 Trusted Publishing,指向 `.github/workflows/publish.yml`。
74
+
75
+ ```bash
76
+ pnpm release # bumpp:改版本号、提交、打 tag 并推送
77
+ ```
78
+
79
+ 设计文档:[CONTEXT.md](CONTEXT.md)、[DESIGN.md](DESIGN.md)、[docs/prd](docs/prd)、[docs/adr](docs/adr)。