@simonyea/holysheep-cli 2.1.2 → 2.1.3

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": "@simonyea/holysheep-cli",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
4
4
  "description": "Claude Code/Cursor/Cline API relay for China — ¥1=$1, WeChat/Alipay payment, no credit card, no VPN. One command setup for all AI coding tools.",
5
5
  "scripts": {
6
6
  "test": "node tests/droid.test.js && node tests/workspace-store.test.js",
@@ -324,13 +324,28 @@ async function startAionUiMode(opts) {
324
324
  return startLegacyMode(opts)
325
325
  }
326
326
 
327
- // 2. Resolve bun — and auto-install if missing (opt-out via env)
327
+ // 2. Resolve bun — and auto-install if missing (opt-out via env, TTY-gated)
328
328
  let bunPath = resolveBunPath()
329
329
  const autoBunDisabled = process.env.HOLYSHEEP_WEBUI_NO_AUTOFETCH_BUN === '1'
330
330
  if (!bunPath && !autoBunDisabled) {
331
- console.log(chalk.cyan('▶ bun runtime not installed installing automatically (one-time)'))
332
- console.log(chalk.gray(' (disable with HOLYSHEEP_WEBUI_NO_AUTOFETCH_BUN=1; takes ~30s; source: bun.sh official installer)'))
333
- bunPath = autoInstallBun((m) => console.log(chalk.gray(` ${m}`)))
331
+ // TTY guard: auto-install pipes a remote script into a shell. In CI,
332
+ // Docker builds, or other non-interactive environments the user can't
333
+ // cancel and didn't knowingly opt in. Skip auto-install there and fall
334
+ // through to the existing manual-install guidance + legacy fallback.
335
+ if (!process.stdout.isTTY) {
336
+ console.log(chalk.yellow(' bun missing and not running in a TTY — skipping auto-install (safety).'))
337
+ console.log(chalk.gray(' In CI / Docker / non-interactive shells, install bun explicitly first:'))
338
+ console.log(chalk.cyan(` ${describeBunInstall()}`))
339
+ console.log(chalk.gray(' Or opt out of this safety with HOLYSHEEP_WEBUI_FORCE_AUTOFETCH_BUN=1.'))
340
+ if (process.env.HOLYSHEEP_WEBUI_FORCE_AUTOFETCH_BUN === '1') {
341
+ console.log(chalk.cyan('▶ HOLYSHEEP_WEBUI_FORCE_AUTOFETCH_BUN=1 set — attempting auto-install anyway'))
342
+ bunPath = autoInstallBun((m) => console.log(chalk.gray(` ${m}`)))
343
+ }
344
+ } else {
345
+ console.log(chalk.cyan('▶ bun runtime not installed — installing automatically (one-time)'))
346
+ console.log(chalk.gray(' (disable with HOLYSHEEP_WEBUI_NO_AUTOFETCH_BUN=1; takes ~30s; source: bun.sh official installer)'))
347
+ bunPath = autoInstallBun((m) => console.log(chalk.gray(` ${m}`)))
348
+ }
334
349
  }
335
350
  if (!bunPath) {
336
351
  console.log(chalk.red('✗ bun is required to run the AionUi server'))