@seanyao/roll 2026.505.1 → 2026.505.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 (3) hide show
  1. package/README.md +4 -4
  2. package/bin/roll +32 -8
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -48,8 +48,7 @@ roll setup
48
48
  To update:
49
49
 
50
50
  ```bash
51
- npm install -g @seanyao/roll@latest
52
- roll setup
51
+ roll update
53
52
  ```
54
53
 
55
54
  > **For contributors** (working on roll itself): `git clone https://github.com/seanyao/roll.git && cd roll && ./install.sh`
@@ -65,6 +64,7 @@ Unified behavioral conventions for Claude Code / Gemini CLI / Cursor / Codex —
65
64
  | Command | Description |
66
65
  |---------|-------------|
67
66
  | `roll setup` | First-time install on this machine, or re-sync after editing `~/.roll/config.yaml` (use `--force` to overwrite local cache) |
67
+ | `roll update` | One-step upgrade: `npm install -g @seanyao/roll@latest` + re-sync via `roll setup` |
68
68
  | `roll init` | New project: create `AGENTS.md` + `BACKLOG.md` + `docs/features/` |
69
69
  | `roll hook install` | Optional: global git hook that tags commits with the active AI client |
70
70
  | `roll status` | Show sync state, skill links, and detected AI tools |
@@ -80,8 +80,8 @@ roll setup
80
80
  cd my-app
81
81
  roll init
82
82
 
83
- # 3. Re-sync after editing ~/.roll/config.yaml or after upgrading
84
- roll setup
83
+ # 3. Upgrade to a new release
84
+ roll update
85
85
 
86
86
  # 4. Optional: tag commits with AI client name
87
87
  roll hook install
package/bin/roll CHANGED
@@ -4,7 +4,7 @@ set -euo pipefail
4
4
  # Roll — AI Agent Convention Manager
5
5
  # Single source of truth for how all AI coding agents behave.
6
6
 
7
- VERSION="2026.505.1"
7
+ VERSION="2026.505.2"
8
8
  ROLL_HOME="${ROLL_HOME:-${HOME}/.roll}"
9
9
  ROLL_CONFIG="${ROLL_HOME}/config.yaml"
10
10
  ROLL_GLOBAL="${ROLL_HOME}/conventions/global"
@@ -177,18 +177,18 @@ safe_copy() {
177
177
  fi
178
178
  echo ""
179
179
  warn "File exists and differs: ${dst/#$HOME/~} 文件已存在且内容不同: ${dst/#$HOME/~}"
180
- echo -e " ${BOLD}Overwrite?${NC} [y/N/d(iff)] "
180
+ echo -e " ${BOLD}Overwrite?${NC} [Y/n/d(iff)] "
181
181
  read -r answer
182
182
  case "$answer" in
183
183
  d|D|diff)
184
184
  diff --color=auto "$dst" "$src" || true
185
185
  echo ""
186
- echo -e " ${BOLD}Overwrite?${NC} [y/N] "
186
+ echo -e " ${BOLD}Overwrite?${NC} [Y/n] "
187
187
  read -r answer2
188
- [[ "$answer2" =~ ^[Yy]$ ]] || { info "Skipped: ${dst/#$HOME/\~} 已跳过: ${dst/#$HOME/\~}"; return; }
188
+ [[ "$answer2" =~ ^[Nn]$ ]] && { info "Skipped: ${dst/#$HOME/\~} 已跳过: ${dst/#$HOME/\~}"; return; }
189
189
  ;;
190
- y|Y) ;;
191
- *) info "Skipped: ${dst/#$HOME/~} 已跳过: ${dst/#$HOME/~}"; return ;;
190
+ n|N) info "Skipped: ${dst/#$HOME/~} 已跳过: ${dst/#$HOME/~}"; return ;;
191
+ *) ;; # empty answer or 'y' / 'Y' → overwrite (default Yes)
192
192
  esac
193
193
  fi
194
194
 
@@ -541,6 +541,27 @@ cmd_setup() {
541
541
  info "Next: run ${BOLD}roll init${NC} inside a project to initialize it. 下一步:在项目目录运行 roll init"
542
542
  }
543
543
 
544
+ # ═══════════════════════════════════════════════════════════════════════════════
545
+ # COMMAND: update
546
+ # Thin wrapper: upgrade the npm-installed package, then re-sync via setup.
547
+ # Equivalent to: npm install -g @seanyao/roll@latest && roll setup
548
+ # ═══════════════════════════════════════════════════════════════════════════════
549
+ cmd_update() {
550
+ info "Current version: roll v${VERSION} 当前版本: roll v${VERSION}"
551
+ info "Upgrading via npm... 正在通过 npm 升级..."
552
+ echo ""
553
+
554
+ if ! npm install -g @seanyao/roll@latest; then
555
+ err "npm install failed. Check network/proxy and try again. npm 安装失败,请检查网络/代理后重试。"
556
+ exit 1
557
+ fi
558
+
559
+ echo ""
560
+ info "Re-syncing to AI tools... 正在重新同步到 AI 工具..."
561
+ echo ""
562
+ cmd_setup
563
+ }
564
+
544
565
  # ─── Helper: merge global AGENTS.md into project (no type prompt) ────────────
545
566
  # Fresh project: copies global AGENTS.md.
546
567
  # Existing AGENTS.md: appends any ## sections missing from global.
@@ -1179,12 +1200,14 @@ usage() {
1179
1200
  echo ""
1180
1201
  echo "Commands:"
1181
1202
  echo " setup [-f] [Machine] First-time install or re-sync 首次安装或重新同步"
1203
+ echo " update [Upgrade] npm install latest + re-sync 一键升级到最新版"
1182
1204
  echo " init [Project] Create AGENTS.md + BACKLOG.md + docs/ 初始化项目工作流文件"
1183
1205
  echo " hook [install|remove] [Optional] Manage global git hook 管理全局 git hook"
1184
1206
  echo " status [Diagnostic] Show current state 显示当前状态"
1185
1207
  echo ""
1186
1208
  echo "Examples / 示例:"
1187
- echo " roll setup # New machine, or re-sync after npm update 新机器或更新后重新同步"
1209
+ echo " roll setup # New machine: first-time install 新机器首次安装"
1210
+ echo " roll update # Upgrade to latest version + re-sync 升级到最新版并重新同步"
1188
1211
  echo " roll init # New or re-merge project (run in project) 新建或重新合并(项目目录)"
1189
1212
  echo " roll hook install # Optional: tag commits with AI client 可选:提交时标记 AI 工具"
1190
1213
  }
@@ -1195,6 +1218,7 @@ main() {
1195
1218
 
1196
1219
  case "$cmd" in
1197
1220
  setup) cmd_setup "$@" ;;
1221
+ update) cmd_update "$@" ;;
1198
1222
  init) cmd_init "$@" ;;
1199
1223
  hook) cmd_hook "$@" ;;
1200
1224
  status) cmd_status "$@" ;;
@@ -1233,7 +1257,7 @@ _notify_update() {
1233
1257
  local latest; latest=$(awk '{print $2}' "$cache" 2>/dev/null || true)
1234
1258
  [[ -z "$latest" || "$latest" == "$VERSION" ]] && return
1235
1259
  echo ""
1236
- warn "v${latest} available — run 'npm install -g @seanyao/roll@latest && roll setup' to upgrade 有新版本 v${latest} — 运行 'npm install -g @seanyao/roll@latest && roll setup' 升级"
1260
+ warn "v${latest} available — run 'roll update' to upgrade 有新版本 v${latest} — 运行 'roll update' 升级"
1237
1261
  }
1238
1262
 
1239
1263
  if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seanyao/roll",
3
- "version": "2026.505.1",
3
+ "version": "2026.505.2",
4
4
  "description": "Roll — Roll out features with AI agents",
5
5
  "scripts": {
6
6
  "test": "find tests/unit tests/integration -name '*.bats' | sort | xargs ./tests/helpers/bats-core/bin/bats"