@silicaclaw/cli 1.0.0-beta.12 → 1.0.0-beta.13

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 CHANGED
@@ -8,6 +8,12 @@
8
8
  - `INSTALL.md`
9
9
  - `DEMO_GUIDE.md`
10
10
  - `RELEASE_NOTES_v1.0.md`
11
+ - CLI onboarding install UX polish:
12
+ - added shell alias fallback (`silicaclaw -> npx @silicaclaw/cli@beta`) when global install is unavailable
13
+ - reduced reliance on manual PATH/env edits for first-run success
14
+ - `silicaclaw update` guidance polish:
15
+ - prioritize zero-setup `npx` flow
16
+ - clarify global install is optional
11
17
  - README first-screen and structure polish:
12
18
  - fixed v1.0 beta project positioning
13
19
  - added concise feature summary
package/INSTALL.md CHANGED
@@ -57,6 +57,14 @@ silicaclaw gateway status
57
57
  silicaclaw gateway stop
58
58
  ```
59
59
 
60
+ If global install fails with `EACCES`, use alias mode (no PATH edits):
61
+
62
+ ```bash
63
+ alias silicaclaw='npx -y @silicaclaw/cli@beta'
64
+ silicaclaw onboard
65
+ silicaclaw update
66
+ ```
67
+
60
68
  ## 3. Run
61
69
 
62
70
  Start local console:
package/README.md CHANGED
@@ -92,6 +92,14 @@ silicaclaw gateway status
92
92
  silicaclaw gateway stop
93
93
  ```
94
94
 
95
+ If global install is blocked by system permissions (`EACCES`), use alias mode:
96
+
97
+ ```bash
98
+ alias silicaclaw='npx -y @silicaclaw/cli@beta'
99
+ silicaclaw onboard
100
+ silicaclaw update
101
+ ```
102
+
95
103
  ## Quick Start (OpenClaw-style)
96
104
 
97
105
  ### 1. Prerequisites
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@silicaclaw/cli",
3
- "version": "1.0.0-beta.12",
3
+ "version": "1.0.0-beta.13",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -91,6 +91,49 @@ default_system_bin_dir() {
91
91
  printf '/usr/local/bin'
92
92
  }
93
93
 
94
+ detect_shell_rc_file() {
95
+ local sh_name="${SHELL:-}"
96
+ case "$sh_name" in
97
+ */zsh) printf '%s' "$HOME/.zshrc" ;;
98
+ */bash) printf '%s' "$HOME/.bashrc" ;;
99
+ *)
100
+ if [ -n "${ZSH_VERSION:-}" ]; then
101
+ printf '%s' "$HOME/.zshrc"
102
+ else
103
+ printf '%s' "$HOME/.bashrc"
104
+ fi
105
+ ;;
106
+ esac
107
+ }
108
+
109
+ install_npx_alias() {
110
+ local rc_file
111
+ rc_file="$(detect_shell_rc_file)"
112
+ local begin_mark="# >>> silicaclaw npx alias >>>"
113
+ local end_mark="# <<< silicaclaw npx alias <<<"
114
+ local alias_line="alias silicaclaw='npx -y @silicaclaw/cli@beta'"
115
+
116
+ mkdir -p "$(dirname "$rc_file")"
117
+ touch "$rc_file"
118
+
119
+ if grep -Fq "$begin_mark" "$rc_file"; then
120
+ echo "已存在 silicaclaw alias 配置: $rc_file"
121
+ return 0
122
+ fi
123
+
124
+ {
125
+ echo ""
126
+ echo "$begin_mark"
127
+ echo "$alias_line"
128
+ echo "$end_mark"
129
+ } >>"$rc_file"
130
+
131
+ echo "已写入 alias 到: $rc_file"
132
+ echo "执行以下命令即可在当前 shell 立即生效:"
133
+ echo "source \"$rc_file\""
134
+ return 0
135
+ }
136
+
94
137
  ask_yes_no() {
95
138
  local prompt="$1"
96
139
  local default="${2:-Y}"
@@ -252,11 +295,25 @@ EOF"
252
295
  hash -r || true
253
296
  if command -v silicaclaw >/dev/null 2>&1; then
254
297
  echo "验证成功: $(command -v silicaclaw)"
298
+ INSTALLED=1
255
299
  else
256
300
  echo "安装完成,但当前 shell 未刷新。请新开终端后运行 silicaclaw。"
257
301
  fi
258
302
  else
259
- echo "已跳过 sudo 安装。你仍可使用: npx @silicaclaw/cli@beta <command>"
303
+ echo "已跳过 sudo 安装。"
304
+ fi
305
+ fi
306
+
307
+ if [ "$INSTALLED" != "1" ]; then
308
+ echo "无需改 PATH/环境变量,也可一键使用 silicaclaw。"
309
+ if ask_yes_no "是否自动写入 shell alias(silicaclaw -> npx @silicaclaw/cli@beta)?" "Y"; then
310
+ if install_npx_alias; then
311
+ echo "alias 安装完成。新开终端后可直接使用 silicaclaw。"
312
+ else
313
+ echo "alias 安装失败。可继续使用: npx @silicaclaw/cli@beta <command>"
314
+ fi
315
+ else
316
+ echo "你仍可继续使用: npx @silicaclaw/cli@beta <command>"
260
317
  fi
261
318
  fi
262
319
  fi
@@ -73,11 +73,16 @@ function showUpdateGuide(current, latest, beta) {
73
73
  }
74
74
  console.log("");
75
75
  console.log("Recommended commands:");
76
- console.log("1) npx mode (no global install)");
76
+ console.log("1) npx mode (recommended, zero setup)");
77
77
  console.log(" npx @silicaclaw/cli@beta onboard");
78
78
  console.log(" npx @silicaclaw/cli@beta connect");
79
+ console.log(" npx @silicaclaw/cli@beta update");
79
80
  console.log("");
80
- console.log("2) global install mode");
81
+ console.log("2) shell alias mode (no global install / no PATH edits)");
82
+ console.log(" alias silicaclaw='npx -y @silicaclaw/cli@beta'");
83
+ console.log(" silicaclaw version");
84
+ console.log("");
85
+ console.log("3) global install mode (optional)");
81
86
  console.log(" npm i -g @silicaclaw/cli@beta");
82
87
  console.log(" silicaclaw version");
83
88
  console.log("");