@hi-man/himan 0.5.0 → 0.5.2
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/CHANGELOG.md +16 -0
- package/README.md +9 -9
- package/dist/cli/agent-commands.js +3 -3
- package/dist/cli/project-commands.js +5 -5
- package/docs/mvp/README.md +4 -4
- package/docs/mvp/impl.md +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,22 @@ The format is based on Keep a Changelog, and this project follows semver for the
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.5.2] - 2026-05-14
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Added `-g` as a shorthand for `--global` on `install`, `publish`, `agent use`, and `agent clear`.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- Fixed the `himan-resource-manage` skill to stop create/dev/publish workflows when the local Himan CLI is older than the project-directory resource flow.
|
|
18
|
+
|
|
19
|
+
## [0.5.1] - 2026-05-14
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- Fixed `himan-skill-metadata` version resolution so existing skills use lock/source metadata before falling back to `0.0.1` for new skills.
|
|
24
|
+
|
|
9
25
|
## [0.5.0] - 2026-05-14
|
|
10
26
|
|
|
11
27
|
### Added
|
package/README.md
CHANGED
|
@@ -62,7 +62,7 @@ himan publish rule my-rule --patch
|
|
|
62
62
|
- `claude-code` -> `.claude/{rules|commands|skills}/<name>`
|
|
63
63
|
- `codex` -> `.agents/{rules|commands|skills}/<name>`
|
|
64
64
|
- `openclaw` -> `.openclaw/{rules|commands|skills}/<name>`
|
|
65
|
-
- 加 `--global` 时会安装到用户级 agent 目录,并仍按当前项目生效的 agent 选择目标:
|
|
65
|
+
- 加 `-g` / `--global` 时会安装到用户级 agent 目录,并仍按当前项目生效的 agent 选择目标:
|
|
66
66
|
- `cursor` -> `~/.cursor/{rules|commands|skills}/<name>`
|
|
67
67
|
- `claude-code` -> `~/.claude/{rules|commands|skills}/<name>`
|
|
68
68
|
- `codex` -> `~/.agents/{rules|commands|skills}/<name>`
|
|
@@ -72,9 +72,9 @@ himan publish rule my-rule --patch
|
|
|
72
72
|
- `command` -> `.agents/commands/<name>`
|
|
73
73
|
- `skill` -> `.agents/skills/<name>`
|
|
74
74
|
`dev` 修改项目内资源时不再创建 `.himan/dev`,只在资源仅存在于用户级全局目录时复制到当前项目对应 agent 目录。
|
|
75
|
-
- lock 文件:项目安装 `install <type> <name[@version]>` 会写入 `himan.lock`,记录 source、精确版本、agent 和安装模式;`himan install`(无参数)会按 lock 记录的 source 批量恢复安装,不受当前 default source
|
|
75
|
+
- lock 文件:项目安装 `install <type> <name[@version]>` 会写入 `himan.lock`,记录 source、精确版本、agent 和安装模式;`himan install`(无参数)会按 lock 记录的 source 批量恢复安装,不受当前 default source 切换影响。`-g` / `--global` 安装不写当前项目的 `himan.lock`。
|
|
76
76
|
- 安装模式:默认 `--mode copy` 将资源复制到目标 agent 目录;也可用 `--mode link` 使用软链,lock 会记录并复现该模式。
|
|
77
|
-
- 默认 agent:`agent use <agent>` 默认写当前项目 `.himan/config.json`;加 `--global` 写入 `~/.himan/config.json`。当前项目配置优先于全局配置。
|
|
77
|
+
- 默认 agent:`agent use <agent>` 默认写当前项目 `.himan/config.json`;加 `-g` / `--global` 写入 `~/.himan/config.json`。当前项目配置优先于全局配置。
|
|
78
78
|
|
|
79
79
|
版本以 Git tag 为准,格式:`rule/my-rule@1.0.0`。更多设计见 [docs/mvp](./docs/mvp/README.md)。
|
|
80
80
|
|
|
@@ -196,19 +196,19 @@ analysis:
|
|
|
196
196
|
| 命令 | 说明 |
|
|
197
197
|
| --------------------------------- | --------------------------------------------------------- |
|
|
198
198
|
| `list [type] [--agent a,b] [--json]` | 查看当前项目 `himan.lock` 中记录的已安装资源;未传 `type` 时按 `rule`/`command`/`skill` 分组展示 |
|
|
199
|
-
| `install [type] [name[@version]] [
|
|
199
|
+
| `install [type] [name[@version]] [-g\|--global] [--agent a,b] [--mode link\|copy] [--include-archived]` | 有参数时从当前 default source 安装指定资源;**无参数**时按 `himan.lock` 记录的 source 批量安装;加 `-g` / `--global` 时安装到用户级 agent 目录且不写项目 lock;可覆盖安装目标 agent 或安装模式;归档资源必须显式传 `--include-archived` 才能按历史版本安装 |
|
|
200
200
|
| `dev <type> <name>` | 切换到开发态;项目资源原地编辑,全局资源先复制到当前项目目标目录 |
|
|
201
201
|
| `uninstall <type> <name>` | 从项目移除安装目标,并同步删除 `himan.lock` 条目 |
|
|
202
|
-
| `publish <type> <name> [
|
|
202
|
+
| `publish <type> <name> [-g\|--global]` | 默认 `--patch`;可选 `--minor` / `--major`(勿同时使用多个);发布后默认安装到当前项目并更新 lock,`-g` / `--global` 安装到用户级目录 |
|
|
203
203
|
|
|
204
204
|
### 4) agent(默认 Agent)
|
|
205
205
|
|
|
206
206
|
| 命令 | 说明 |
|
|
207
207
|
|------|------|
|
|
208
208
|
| `agent list [--json]` | 查看支持的 agent |
|
|
209
|
-
| `agent use <agent[,agent]> [--project\|--global] [--json]` | 设置当前项目或全局默认 agent;默认 `--project` |
|
|
209
|
+
| `agent use <agent[,agent]> [--project\|-g\|--global] [--json]` | 设置当前项目或全局默认 agent;默认 `--project` |
|
|
210
210
|
| `agent current [--json]` | 查看当前项目、全局和最终生效的默认 agent |
|
|
211
|
-
| `agent clear [--project\|--global] [--json]` | 清除当前项目或全局默认 agent;默认 `--project` |
|
|
211
|
+
| `agent clear [--project\|-g\|--global] [--json]` | 清除当前项目或全局默认 agent;默认 `--project` |
|
|
212
212
|
|
|
213
213
|
### 5) doctor(可用性检查)
|
|
214
214
|
|
|
@@ -226,9 +226,9 @@ analysis:
|
|
|
226
226
|
- `himan doctor ...`
|
|
227
227
|
|
|
228
228
|
说明:资源与项目相关命令统一使用 `--agent` 指定目标 Agent。
|
|
229
|
-
若未显式传 `--agent`,`create` / `install` 会使用当前项目默认 agent、全局默认 agent、资源 metadata 或内置默认 `cursor` 中最合适的一项;`dev` 会优先使用当前项目已有安装位置,找不到时再从用户级全局安装位置复制到当前项目。`install --global` 会优先复用当前项目 lock 里该资源的 agent,未命中时再使用默认 install 解析顺序,但目标根目录是用户 home 下对应 agent 目录。
|
|
229
|
+
若未显式传 `--agent`,`create` / `install` 会使用当前项目默认 agent、全局默认 agent、资源 metadata 或内置默认 `cursor` 中最合适的一项;`dev` 会优先使用当前项目已有安装位置,找不到时再从用户级全局安装位置复制到当前项目。`install -g` / `install --global` 会优先复用当前项目 lock 里该资源的 agent,未命中时再使用默认 install 解析顺序,但目标根目录是用户 home 下对应 agent 目录。
|
|
230
230
|
|
|
231
|
-
`publish` 会展示 prepare、resolve-version、publish-source、sync-store、install、cleanup、done 等阶段日志。发布源优先使用旧版 `.himan/dev` 目录,其次使用当前项目 agent 目标目录,最后回退到 source 仓库对应资源目录。若资源目录包含 `himan.yaml`,发布前会校验元数据与入口文件;若没有 `himan.yaml`,则按默认入口推断最小元数据并发布,不会强制创建 `himan.yaml`。若待发布资源内容与最新已发布版本一致,则以 `E_PUBLISH_NO_CHANGES` 终止发布。发布需要可推送的 Git 权限。发布 commit 会包含资源目录以及自动维护的 source 根目录 `README.md` / `CHANGELOG.md`。发布成功后会从新版本 store 以 `copy` 模式重新安装;默认安装到当前项目并更新 `himan.lock`,传 `--global` 时安装到用户级目录且不写当前项目 lock。
|
|
231
|
+
`publish` 会展示 prepare、resolve-version、publish-source、sync-store、install、cleanup、done 等阶段日志。发布源优先使用旧版 `.himan/dev` 目录,其次使用当前项目 agent 目标目录,最后回退到 source 仓库对应资源目录。若资源目录包含 `himan.yaml`,发布前会校验元数据与入口文件;若没有 `himan.yaml`,则按默认入口推断最小元数据并发布,不会强制创建 `himan.yaml`。若待发布资源内容与最新已发布版本一致,则以 `E_PUBLISH_NO_CHANGES` 终止发布。发布需要可推送的 Git 权限。发布 commit 会包含资源目录以及自动维护的 source 根目录 `README.md` / `CHANGELOG.md`。发布成功后会从新版本 store 以 `copy` 模式重新安装;默认安装到当前项目并更新 `himan.lock`,传 `-g` / `--global` 时安装到用户级目录且不写当前项目 lock。
|
|
232
232
|
|
|
233
233
|
`rename` 暂不推荐使用。该命令会移动 source 仓库里的资源目录并更新资源 metadata 名称、README 资源索引和 CHANGELOG。已有发布 tag 不会被改写;若旧资源已有历史版本,rename 会为新名字创建一个指向当前最新版本的 tag。默认会迁移当前项目中对应的安装目标、`.himan/dev` 副本和 lock 条目;传 `--no-project` 时只改 source。对于 skill,命令只自动更新 metadata / front matter 中的精确 `name` 字段,不会自动替换 `SKILL.md` 正文中的旧名称引用。
|
|
234
234
|
|
|
@@ -21,7 +21,7 @@ export function registerAgentCommands(command, services) {
|
|
|
21
21
|
command
|
|
22
22
|
.command("use")
|
|
23
23
|
.argument("<agent_list>", "agent list, comma separated")
|
|
24
|
-
.option("--global", "save as global default")
|
|
24
|
+
.option("-g, --global", "save as global default")
|
|
25
25
|
.option("--project", "save as current project default")
|
|
26
26
|
.option("--json", "output json format")
|
|
27
27
|
.description("Set default agents globally or for current project")
|
|
@@ -54,7 +54,7 @@ export function registerAgentCommands(command, services) {
|
|
|
54
54
|
});
|
|
55
55
|
command
|
|
56
56
|
.command("clear")
|
|
57
|
-
.option("--global", "clear global default agents")
|
|
57
|
+
.option("-g, --global", "clear global default agents")
|
|
58
58
|
.option("--project", "clear current project default agents")
|
|
59
59
|
.option("--json", "output json format")
|
|
60
60
|
.description("Clear configured default agents")
|
|
@@ -71,7 +71,7 @@ export function registerAgentCommands(command, services) {
|
|
|
71
71
|
}
|
|
72
72
|
function parseScope(options) {
|
|
73
73
|
if (options.global && options.project) {
|
|
74
|
-
throw new HimanError(errorCodes.CLI_USAGE, "Use only one of
|
|
74
|
+
throw new HimanError(errorCodes.CLI_USAGE, "Use only one of -g/--global or --project.");
|
|
75
75
|
}
|
|
76
76
|
return options.global ? "global" : "project";
|
|
77
77
|
}
|
|
@@ -38,7 +38,7 @@ export function registerProjectCommands(command, services, options = {}) {
|
|
|
38
38
|
.argument("[name[@version]]", "resource name with optional @version")
|
|
39
39
|
.option("--agent <list>", "install target agents, comma separated")
|
|
40
40
|
.option("--mode <mode>", "install mode: link or copy")
|
|
41
|
-
.option("--global", "install into user-level agent directories")
|
|
41
|
+
.option("-g, --global", "install into user-level agent directories")
|
|
42
42
|
.option("--include-archived", "allow installing an archived resource explicitly")
|
|
43
43
|
.description("Install resource, or install from himan.lock")
|
|
44
44
|
.action(async (type, nameVersion, options) => {
|
|
@@ -51,7 +51,7 @@ export function registerProjectCommands(command, services, options = {}) {
|
|
|
51
51
|
}
|
|
52
52
|
if (options.global) {
|
|
53
53
|
throw new HimanError(errorCodes.CLI_USAGE, "Global install requires a resource:\n"
|
|
54
|
-
+ " - himan install <type> <name[@version]>
|
|
54
|
+
+ " - himan install <type> <name[@version]> -g [--mode link|copy]");
|
|
55
55
|
}
|
|
56
56
|
const results = await services.installFromLock(process.cwd(), agents, mode);
|
|
57
57
|
if (results.length === 0) {
|
|
@@ -67,7 +67,7 @@ export function registerProjectCommands(command, services, options = {}) {
|
|
|
67
67
|
throw new HimanError(errorCodes.CLI_USAGE, "Install usage:\n"
|
|
68
68
|
+ " - himan install # install from himan.lock\n"
|
|
69
69
|
+ " - himan install <type> <name[@version]> [--mode link|copy] # install single resource\n"
|
|
70
|
-
+ " - himan install <type> <name[@version]>
|
|
70
|
+
+ " - himan install <type> <name[@version]> -g [--mode link|copy] # install single resource globally");
|
|
71
71
|
}
|
|
72
72
|
const resourceType = ensureResourceType(type);
|
|
73
73
|
const { name, version } = parseNameVersion(nameVersion);
|
|
@@ -112,7 +112,7 @@ export function registerProjectCommands(command, services, options = {}) {
|
|
|
112
112
|
.option("--patch", "patch release")
|
|
113
113
|
.option("--minor", "minor release")
|
|
114
114
|
.option("--major", "major release")
|
|
115
|
-
.option("--global", "install the published version into user-level agent directories")
|
|
115
|
+
.option("-g, --global", "install the published version into user-level agent directories")
|
|
116
116
|
.description("Publish resource (default: --patch)")
|
|
117
117
|
.action(async (type, name, options) => {
|
|
118
118
|
await runAction(async () => {
|
|
@@ -121,7 +121,7 @@ export function registerProjectCommands(command, services, options = {}) {
|
|
|
121
121
|
const installScope = options.global ? "global" : "project";
|
|
122
122
|
process.stdout.write(options.global
|
|
123
123
|
? "Published resource will be installed globally; current project lock will not be updated.\n"
|
|
124
|
-
: "Published resource will be installed into the current project and recorded in himan.lock. Use
|
|
124
|
+
: "Published resource will be installed into the current project and recorded in himan.lock. Use -g/--global to install globally instead.\n");
|
|
125
125
|
const result = await services.publish(resourceType, name, releaseType, process.cwd(), {
|
|
126
126
|
installScope,
|
|
127
127
|
onProgress: (progress) => {
|
package/docs/mvp/README.md
CHANGED
|
@@ -57,11 +57,11 @@
|
|
|
57
57
|
|
|
58
58
|
### 2.6 `publish`
|
|
59
59
|
|
|
60
|
-
- `himan publish <type> <name> --patch|--minor|--major [
|
|
60
|
+
- `himan publish <type> <name> --patch|--minor|--major [-g|--global]`(默认 patch,三选一)
|
|
61
61
|
- 发布内容优先取旧版项目 `.himan/dev/<type>/<name>`,其次取当前项目 agent 目标目录,否则取源仓库内对应资源目录。
|
|
62
62
|
- 新版本:基于已有 tag 最新 semver 递增;无任何历史时从 `0.0.0` 起算。
|
|
63
63
|
- 写回源仓库、提交、打 tag、推送,并将该版本同步到本地 store。
|
|
64
|
-
- 发布过程展示阶段日志。发布成功后,用新版本 store 以 copy 模式重新安装;默认安装到项目目标并更新 lock
|
|
64
|
+
- 发布过程展示阶段日志。发布成功后,用新版本 store 以 copy 模式重新安装;默认安装到项目目标并更新 lock,`-g` / `--global` 安装到用户级目录且不写项目 lock。
|
|
65
65
|
|
|
66
66
|
### 2.7 `create`
|
|
67
67
|
|
|
@@ -72,9 +72,9 @@
|
|
|
72
72
|
### 2.8 `agent`
|
|
73
73
|
|
|
74
74
|
- `himan agent list` 查看支持的 agent。
|
|
75
|
-
- `himan agent use <agent[,agent]>` 设置当前项目默认 agent;加 `--global` 设置全局默认 agent。
|
|
75
|
+
- `himan agent use <agent[,agent]>` 设置当前项目默认 agent;加 `-g` / `--global` 设置全局默认 agent。
|
|
76
76
|
- `himan agent current` 查看当前项目、全局和最终生效的默认 agent。
|
|
77
|
-
- `himan agent clear` 清除默认 agent 配置;默认清除当前项目,加 `--global` 清除全局配置。
|
|
77
|
+
- `himan agent clear` 清除默认 agent 配置;默认清除当前项目,加 `-g` / `--global` 清除全局配置。
|
|
78
78
|
- 默认 agent 解析顺序:显式 `--agent` > 当前项目配置 > 全局配置 > 资源 metadata > `cursor`。
|
|
79
79
|
|
|
80
80
|
---
|
package/docs/mvp/impl.md
CHANGED
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
- 下一版本:基于历史最新 tag;无历史则从 `0.0.0` 按 patch/minor/major 递增
|
|
59
59
|
- 将内容同步回缓存仓库中的规范路径,更新元数据中的版本字段,提交、打 tag、推送
|
|
60
60
|
- 将新 tag 对应内容拉取到 store 新版本目录
|
|
61
|
-
- 发布过程展示阶段日志;用新版本 store 以 copy 模式重新安装。默认安装到项目内对应类型目标并更新 lock
|
|
61
|
+
- 发布过程展示阶段日志;用新版本 store 以 copy 模式重新安装。默认安装到项目内对应类型目标并更新 lock,`-g` / `--global` 安装到用户级目标且不写项目 lock
|
|
62
62
|
|
|
63
63
|
### 2.7 `create <type> <name>`
|
|
64
64
|
|