Browse Source

fix: default companion install to opt-in

Alvin Unreal 1 month ago
parent
commit
a7142da2c7
9 changed files with 20 additions and 18 deletions
  1. 1 1
      README.ja-JP.md
  2. 1 1
      README.ko-KR.md
  3. 1 1
      README.md
  4. 1 1
      README.zh-CN.md
  5. 4 3
      docs/companion.md
  6. 1 0
      docs/installation.md
  7. 1 1
      src/cli/index.ts
  8. 6 6
      src/cli/install.test.ts
  9. 4 4
      src/cli/install.ts

+ 1 - 1
README.ja-JP.md

@@ -197,7 +197,7 @@ V2 では、バックグラウンド専門家が基本の考え方になりま
   <p><i>左下のビジュアル Companion。</i></p>
 </div>
 
-対話式インストールでは、インストーラーが Companion を有効にするか尋ね、デフォルトは `yes` です。自動化では明示的に有効化できます。
+対話式インストールでは、インストーラーが Companion を有効にするか尋ね、デフォルトは `no` です。自動化では明示的に有効化できます。
 
 ```bash
 bunx oh-my-opencode-slim@latest install --companion=yes

+ 1 - 1
README.ko-KR.md

@@ -195,7 +195,7 @@ V2에서는 백그라운드 전문가가 기본 동작 모델입니다. Orchestr
   <p><i>왼쪽 아래의 시각적 companion.</i></p>
 </div>
 
-대화형 설치 중 인스톨러는 Companion 활성화 여부를 묻고 기본값은 `yes`입니다. 자동화에서는 명시적으로 활성화할 수 있습니다.
+대화형 설치 중 인스톨러는 Companion 활성화 여부를 묻고 기본값은 `no`입니다. 자동화에서는 명시적으로 활성화할 수 있습니다.
 
 ```bash
 bunx oh-my-opencode-slim@latest install --companion=yes

+ 1 - 1
README.md

@@ -224,7 +224,7 @@ background work is easier to follow at a glance.
 </div>
 
 During interactive install, the installer asks whether to enable Companion and
-defaults to `yes`. For automation, enable it explicitly with:
+defaults to `no`. For automation, enable it explicitly with:
 
 ```bash
 bunx oh-my-opencode-slim@latest install --companion=yes

+ 1 - 1
README.zh-CN.md

@@ -192,7 +192,7 @@ V2 将后台专家作为默认心智模型:Orchestrator 规划工作图,启
   <p><i>左下角视觉伴侣。</i></p>
 </div>
 
-交互式安装期间,安装器会询问是否启用 Companion,并默认选择 `yes`。自动化安装可显式启用:
+交互式安装期间,安装器会询问是否启用 Companion,并默认选择 `no`。自动化安装可显式启用:
 
 ```bash
 bunx oh-my-opencode-slim@latest install --companion=yes

+ 4 - 3
docs/companion.md

@@ -71,10 +71,11 @@ after monitor or resolution changes.
 ## Installer Flag
 
 During interactive installation, the installer asks whether to download and
-enable the native Companion binary. The prompt defaults to `yes`, so pressing
-Enter installs it.
+enable the native Companion binary. The prompt defaults to `no`, so pressing
+Enter skips it.
 
-On niri, the prompt installs normally now that the native companion is fixed.
+On niri, Companion can install normally when enabled now that the native binary
+is fixed.
 
 Companion installation is best-effort. If the binary cannot be downloaded or
 installed, the installer prints a warning and continues installing the core

+ 1 - 0
docs/installation.md

@@ -34,6 +34,7 @@ The installer supports the following options:
 | Option | Description |
 |--------|-------------|
 | `--skills=yes|no` | Install bundled skills (default: yes) |
+| `--companion=ask\|yes\|no` | Install and enable the desktop Companion (`ask` by default; prompt defaults to no) |
 | `--preset=<name>` | Active generated config preset: `openai` or `opencode-go` (default: `openai`) |
 | `--background-subagents=ask\|yes\|no` | Configure the required background-subagents environment export (`ask` by default; prompt defaults to yes) |
 | `--background-subagents-target=<path>` | Write the background-subagents export to a specific shell/profile file |

+ 1 - 1
src/cli/index.ts

@@ -74,7 +74,7 @@ Usage:
 Options:
   --skills=yes|no        Install bundled skills (default: yes)
   --companion=ask|yes|no Install desktop companion binary and enable config
-                         (default: ask; prompt defaults to yes)
+                         (default: ask; prompt defaults to no)
   --preset=<name>        Active generated config preset (default: openai)
   --background-subagents=ask|yes|no
                           Persist required OpenCode background subagent env

+ 6 - 6
src/cli/install.test.ts

@@ -24,12 +24,12 @@ describe('shouldInstallCompanion', () => {
     });
   });
 
-  test('dry-run defaults to install on niri', async () => {
+  test('dry-run defaults to skip on niri', async () => {
     process.env.NIRI_SOCKET = '/run/user/1000/niri.sock';
     const config = { ...baseConfig(), dryRun: true };
 
-    await expect(shouldInstallCompanion(config)).resolves.toBe(true);
-    expect(config.companion).toBe('yes');
+    await expect(shouldInstallCompanion(config)).resolves.toBe(false);
+    expect(config.companion).toBe('no');
   });
 
   test('explicit companion yes still enables companion on niri', async () => {
@@ -39,13 +39,13 @@ describe('shouldInstallCompanion', () => {
     await expect(shouldInstallCompanion(config)).resolves.toBe(true);
   });
 
-  test('dry-run still defaults to install outside niri', async () => {
+  test('dry-run defaults to skip outside niri', async () => {
     delete process.env.NIRI_SOCKET;
     delete process.env.XDG_CURRENT_DESKTOP;
     delete process.env.DESKTOP_SESSION;
     const config = { ...baseConfig(), dryRun: true };
 
-    await expect(shouldInstallCompanion(config)).resolves.toBe(true);
-    expect(config.companion).toBe('yes');
+    await expect(shouldInstallCompanion(config)).resolves.toBe(false);
+    expect(config.companion).toBe('no');
   });
 });

+ 4 - 4
src/cli/install.ts

@@ -240,10 +240,10 @@ export async function shouldInstallCompanion(
 
   if (config.dryRun) {
     printInfo(
-      'Dry run mode - would ask to install the desktop companion (default: yes).',
+      'Dry run mode - would ask to install the desktop companion (default: no).',
     );
-    config.companion = 'yes';
-    return true;
+    config.companion = 'no';
+    return false;
   }
 
   if (!process.stdin.isTTY) {
@@ -258,7 +258,7 @@ export async function shouldInstallCompanion(
   printInfo('The optional desktop companion shows live agent activity.');
   const shouldInstall = await confirm(
     'Install and enable the desktop companion?',
-    true,
+    false,
   );
   config.companion = shouldInstall ? 'yes' : 'no';