claude-runtime-sync 0.1.0 → 0.1.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.
Files changed (2) hide show
  1. package/README.md +83 -54
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,94 +1,123 @@
1
1
  # claude-runtime-sync
2
2
 
3
- Use Claude config (`~/.claude` + `<repo>/.claude`) as the **single source of truth**, and sync reusable runtime capabilities into Codex.
3
+ 让你把 Claude 配置(`~/.claude` + 项目内 `.claude`)作为唯一真实源,并自动复用到 Codex
4
4
 
5
- ## Features
5
+ 适合不想记很多命令的用户:**装好后基本只用 `codex`。**
6
6
 
7
- - Sync skills from Claude to Codex
8
- - Sync MCP servers into managed block of `~/.codex/config.toml`
9
- - Mirror project `.mcp.json` into `~/.claude/mcp.json`
10
- - Sync Claude plugins and hooks metadata into Codex runtime area
11
- - Generate bridge manifest for Codex event -> Claude hooks mapping
12
- - Keep `agents.md` / `gemini.md` aligned with `CLAUDE.md` (symlink-first)
13
- - Install zsh startup hook for auto-check + auto-sync before each `codex` launch
14
-
15
- ## Install
7
+ ## 30 秒上手(推荐)
16
8
 
17
9
  ```bash
10
+ # 1) 全局安装(一次)
18
11
  npm i -g claude-runtime-sync
19
- ```
20
12
 
21
- ## CLI
13
+ # 2) 接入 codex 启动流程(一次)
14
+ crs hook install
22
15
 
23
- ```bash
16
+ # 3) 首次手动同步(一次)
24
17
  crs sync
25
- crs check
26
- crs bridge --watch
27
- crs hook install
28
- crs hook remove
29
- crs sync-base
30
18
  ```
31
19
 
32
- ## Common flags
20
+ 之后日常直接:
33
21
 
34
22
  ```bash
35
- --project-root=/path/to/repo
36
- --claude-home=/path/to/.claude
37
- --codex-home=/path/to/.codex
38
- --no-home
39
- --no-project
23
+ codex
40
24
  ```
41
25
 
42
- ## Recommended bootstrap
26
+ `codex` 每次启动前会自动检查并在需要时同步。
27
+
28
+ ---
29
+
30
+ ## 它会帮你自动处理什么
31
+
32
+ - 同步 skills(`~/.claude/skills` + `<repo>/.claude/skills`)
33
+ - 同步 MCP 到 `~/.codex/config.toml` 托管区块
34
+ - 镜像项目 `.mcp.json` 到 `~/.claude/mcp.json`(保持 `.claude` 为真源)
35
+ - 同步 Claude plugins / hooks 元信息到 Codex 运行目录
36
+ - 把 `CLAUDE.md` 复用到 `agents.md` / `gemini.md`(软链接优先)
37
+ - 通过 bridge 将 Codex 事件映射到 Claude 风格 hooks
38
+
39
+ ---
40
+
41
+ ## 日常使用(你只需要记这些)
42
+
43
+ ### 1) 平时开发
43
44
 
44
45
  ```bash
45
- # 1) one-time hook install
46
- crs hook install
46
+ codex
47
+ ```
47
48
 
48
- # 2) verify drift state
49
- crs check
49
+ ### 2) 改了 `.claude` / `.mcp.json` 后,想立即生效
50
50
 
51
- # 3) apply sync if needed
51
+ ```bash
52
52
  crs sync
53
53
  ```
54
54
 
55
- ## Local development
55
+ ### 3) 想确认是否有漂移
56
56
 
57
57
  ```bash
58
- npm run check
59
- npm run smoke
60
- npm run pack:dry-run
58
+ crs check
61
59
  ```
62
60
 
63
- ## GitHub Actions
64
-
65
- This repo includes:
61
+ ---
66
62
 
67
- - `.github/workflows/ci.yml`: syntax check + CLI smoke + pack dry run
68
- - `.github/workflows/publish.yml`: publish to npm on `v*` tag or manual dispatch
63
+ ## 常用命令(精简版)
69
64
 
70
- Required repository secret:
65
+ ```bash
66
+ crs sync # 执行同步
67
+ crs check # 只检查差异(有差异返回码 1)
68
+ crs hook install # 安装 zsh 自动同步钩子
69
+ crs hook remove # 卸载钩子
70
+ crs bridge --watch # 手动运行事件桥接(一般不需要)
71
+ crs sync-base # 仅同步 skills + mcp
72
+ ```
71
73
 
72
- - `NPM_TOKEN`: npm automation token with publish permission
74
+ ---
73
75
 
74
- ## Publish flow
76
+ ## 可选参数(按需)
75
77
 
76
78
  ```bash
77
- # bump version first
78
- npm version patch
79
+ --project-root=/path/to/repo
80
+ --claude-home=/path/to/.claude
81
+ --codex-home=/path/to/.codex
82
+ --no-home
83
+ --no-project
84
+ ```
79
85
 
80
- # publish from local (optional)
81
- npm publish --access public
86
+ ---
82
87
 
83
- # or publish via CI
84
- # git push --follow-tags
85
- ```
88
+ ## 排障(只在需要时看)
89
+
90
+ - 临时关闭自动同步:
91
+ ```bash
92
+ CODEX_SYNC_DISABLE=1 codex
93
+ ```
94
+ - 临时关闭插件桥接:
95
+ ```bash
96
+ CODEX_PLUGIN_BRIDGE_DISABLE=1 codex
97
+ ```
98
+ - 重新安装钩子:
99
+ ```bash
100
+ crs hook remove
101
+ crs hook install
102
+ ```
103
+
104
+ ---
105
+
106
+ ## 使用前提
107
+
108
+ - Node.js >= 18
109
+ - 已安装 `codex` CLI
110
+ - 当前自动 hook 入口为 **zsh**(`crs hook install`)
111
+
112
+ ---
86
113
 
87
- ## Notes
114
+ ## 发布者本地检查(维护者)
88
115
 
89
- - Event bridge uses structured Codex session events and maps them to Claude-style hook events.
90
- - If you only need base sync (skills + mcp), run `crs sync-base`.
91
- - Example project config: `examples/.claude-codex-sync.example.json`.
116
+ ```bash
117
+ npm run check
118
+ npm run smoke
119
+ npm run pack:dry-run
120
+ ```
92
121
 
93
122
  ## License
94
123
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-runtime-sync",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Use Claude config as the single source of truth and sync reusable capabilities into Codex runtime.",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",