Skip to content

Add CLI command toggle#206

Merged
ryota-murakami merged 1 commit into
mainfrom
codex/cli-command-toggle
Jun 11, 2026
Merged

Add CLI command toggle#206
ryota-murakami merged 1 commit into
mainfrom
codex/cli-command-toggle

Conversation

@ryota-murakami

@ryota-murakami ryota-murakami commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a main-process CLI command service for managing ~/.local/bin/skills-desktop
  • expose typed IPC/preload APIs and Settings → General install/remove UI
  • add service, IPC, and browser tests for installed, missing, and blocked states

Safety

  • writes only a marker-managed shim that opens/focuses the app bundle
  • refuses unmanaged files, directories, and symlinks
  • removes only the exact generated shim content

Verification

  • pnpm exec vitest run src/main/services/cliCommandService.test.ts
  • pnpm validate
  • pnpm test:e2e

Summary by CodeRabbit

リリースノート

  • 新機能

    • 設定画面に CLI コマンドの管理セクションを追加しました。コマンドのインストール状態確認、インストール、削除の操作が可能になります。
  • テスト

    • 新機能のテストスイートを追加しました。

@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
skills-desktop Ready Ready Preview, Comment Jun 11, 2026 9:07pm

Request Review

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.63551% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.56%. Comparing base (ac036f9) to head (354dede).

Files with missing lines Patch % Lines
src/main/services/cliCommandService.ts 71.69% 9 Missing and 6 partials ⚠️
src/renderer/settings/sections/General.tsx 87.23% 4 Missing and 2 partials ⚠️
src/preload/index.ts 0.00% 3 Missing ⚠️
src/main/ipc/handlers.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #206      +/-   ##
==========================================
+ Coverage   65.89%   66.56%   +0.66%     
==========================================
  Files         196      198       +2     
  Lines        5994     6101     +107     
  Branches     1359     1380      +21     
==========================================
+ Hits         3950     4061     +111     
+ Misses       1639     1623      -16     
- Partials      405      417      +12     
Flag Coverage Δ
unittests 66.56% <76.63%> (+0.66%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ryota-murakami

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: eb864038-a50a-468a-aadb-84785c505ed7

📥 Commits

Reviewing files that changed from the base of the PR and between ac036f9 and 354dede.

📒 Files selected for processing (14)
  • .storybook/storybook-utils.tsx
  • src/main/ipc/cliCommand.integration.test.ts
  • src/main/ipc/cliCommand.ts
  • src/main/ipc/handlers.ts
  • src/main/services/cliCommandService.test.ts
  • src/main/services/cliCommandService.ts
  • src/preload/index.ts
  • src/renderer/settings/sections/General.browser.test.tsx
  • src/renderer/settings/sections/General.tsx
  • src/renderer/src/types/electron.d.ts
  • src/shared/ipc-channels.ts
  • src/shared/ipc-contract.test.ts
  • src/shared/ipc-contract.ts
  • src/shared/types.ts

Walkthrough

~/.local/bin/skills-desktop CLI シムのインストール/削除機能をフルスタック実装。型定義→ファイルシステム操作サービス→IPC ハンドラ→プレロード API→UI の完全な経路で、ブロック状態(未管理ファイル占有)を適切にハンドル。

Changes

CLI Command Install/Remove

Layer / File(s) Summary
Shared types and IPC contract
src/shared/types.ts, src/shared/ipc-channels.ts, src/shared/ipc-contract.ts, src/shared/ipc-contract.test.ts, src/renderer/src/types/electron.d.ts
CliCommandStatusKind、CliCommandStatus、CliCommandOperationResult 型を定義。3 つの CLI チャネル (getStatus/install/remove) を IPC_CHANNELS と IpcInvokeContract に登録。Electron 型定義に cliCommand API を追加。
CLI command service implementation
src/main/services/cliCommandService.ts, src/main/services/cliCommandService.test.ts
getCliCommandStatus で lstat とファイル内容照合により状態判定。installCliCommand は mkdir→tmp 書き込み→link で競合回避。removeCliCommand は削除と状態検証。未管理ファイルやシンボリックリンク占有は blocked。テストで全状態遷移とエラーケースを検証。
IPC handler registration
src/main/ipc/cliCommand.ts, src/main/ipc/cliCommand.integration.test.ts, src/main/ipc/handlers.ts
registerCliCommandHandlers で 3 チャネルを main IPC に登録。registerAllHandlers から呼び出し。Integration test でハンドラと service 連携を検証。
Preload API exposure
src/preload/index.ts
electron.cliCommand に getStatus、install、remove メソッドを expose。typedInvoke で IPC チャネル呼び出し、型安全を確保。
General settings UI implementation and tests
src/renderer/settings/sections/General.tsx, src/renderer/settings/sections/General.browser.test.tsx
useCliCommandControl hook で状態取得と install/remove 非同期実行。UI は installed/blocked/unknown に応じてボタンと表示を切り替え。isBusy でローディング状態を管理。3 ケースの状態遷移を browser test で検証。
Storybook mock
.storybook/storybook-utils.tsx
installStorybookElectronMock に cliCommand モック追加。getStatus、install、remove が状態とメッセージを返すよう設定。

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PRのタイトル「Add CLI command toggle」は、CLIコマンド(~/.local/bin/skills-desktop)のインストール/削除機能を追加することを正確に反映している。変更内容(サービス実装、IPC API、Settings UIの追加)の要点を簡潔に表現している。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/cli-command-toggle

Comment @coderabbitai help to get the list of available commands and usage tips.

@ryota-murakami ryota-murakami merged commit a3b2d3b into main Jun 11, 2026
11 checks passed
@ryota-murakami ryota-murakami deleted the codex/cli-command-toggle branch June 11, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants