bpmax-cli 0.1.6 → 0.1.8

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bpmax-cli",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "CLI for BPMAX environments with multi-profile config and local login callback flow",
5
5
  "type": "module",
6
6
  "bin": {
@@ -32,6 +32,7 @@ bpmax-cli flow get --flow-id 123 --format json
32
32
  - 流程枚举优先 `flow list`
33
33
  - 只在需要单流程细节时才用 `flow get`
34
34
  - 需要读取创建选项或流程相关参数时,再用 `flow options`
35
+ - 创建项目之前,必须用 `flow get` 或 `flow options` 获取流程表单结构,供 `project create` 的 `form` 映射和校验使用
35
36
 
36
37
  ## 输出建议
37
38
 
@@ -39,13 +39,18 @@ bpmax-cli project create --flow-id 123 --name "Demo" --json '{"priority":"P1"}'
39
39
 
40
40
  ## 创建规则
41
41
 
42
- - V1 的 `project create` 只承诺最小可用路径
42
+ - 创建项目前必须先确认流程和创建表单结构,不能直接凭字段名猜测 `form`
43
+ - 优先用 `bpmax-cli flow get --id <flow-id> --format json` 或 `bpmax-cli flow options --format json` 获取流程/表单信息
44
+ - 将用户输入映射到流程创建表单字段后,再执行 `project create`
45
+ - `project create` 默认会对 `--json.form` 做本地表单结构校验
43
46
  - 必填优先只保留 `--flow-id` 和 `--name`
44
47
  - 需要补充字段时,用 `--json`
48
+ - 如果本地无法识别流程表单结构,先向用户说明风险;只有用户确认要交给后端校验时,才追加 `--skip-form-validation`
45
49
  - 若 payload 已经超出 shortcut 覆盖范围,再降级到 `bpmax-cli api`
46
50
 
47
51
  ## 异常处理
48
52
 
49
53
  - 本地参数校验失败:先修正 `--flow-id`、`--name` 或 JSON
54
+ - 表单校验失败:按错误补齐必填字段、修正字段 key/type/选项值,不要绕过校验重试
50
55
  - 服务端校验失败:保留错误原文
51
56
  - 创建路径不满足业务变体:改走 `project create --json ...` 或原始 `api POST`
@@ -54,6 +54,23 @@ bpmax-cli auth status
54
54
  - 如果当前 profile 没有可用 API Key,先走 `auth login`
55
55
  - 如果用户明确指定环境,始终显式加 `--profile <name>`
56
56
 
57
+ ## Profile Recipes
58
+
59
+ 对环境强绑定、流程/表单强绑定的操作,不要直接沉淀到通用 `bpmax-*` skill。先检查当前 profile/workspace 是否已有本地 recipe:
60
+
61
+ ```bash
62
+ bpmax-cli recipe list --format table
63
+ bpmax-cli recipe show <name> --format json
64
+ ```
65
+
66
+ 规则:
67
+
68
+ - recipe 存储在 `~/.bpmax/profiles/<profile>/recipes/<workspace>/<recipe-name>/`
69
+ - 适合沉淀“创建店员”“发起某个固定业务流程”这类依赖具体环境 flow/template/key 的操作
70
+ - 执行 recipe 用 `bpmax-cli recipe run <name> --var key=value --vars '{...}' --yes`
71
+ - mutating recipe 必须显式 `--yes`
72
+ - 找不到 recipe 时,再走 flow/project/api 的通用发现流程,并建议用户把验证成功的操作沉淀为 profile recipe
73
+
57
74
  ## 配置与环境
58
75
 
59
76
  多环境 profile 管理统一走这里: