feat(gemini): support syncing default instance credentials to wsl#654
Open
Benjaminlooi wants to merge 3 commits intojlcodes99:mainfrom
Open
feat(gemini): support syncing default instance credentials to wsl#654Benjaminlooi wants to merge 3 commits intojlcodes99:mainfrom
Benjaminlooi wants to merge 3 commits intojlcodes99:mainfrom
Conversation
- Added `gemini_sync_wsl` to the configuration schema. - Added a toggle in the Settings UI for Windows users to control the WSL sync behavior. - Implemented `sync_default_gemini_home_to_wsl` using `wsl.exe` to sync `~/.gemini` to the WSL default home. - Trigger WSL sync when switching the default Gemini instance on Windows if the setting is enabled.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation / 动机
English:
Development on Windows frequently involves using WSL2. This feature allows users to install the Gemini CLI directly within their WSL2 environment while using Cockpit Tools on the Windows host to manage Gemini and other AI providers. By syncing the active
.geminiconfiguration across the OS boundary, it ensures a seamless developer experience without needing to manually copy credentials when switching accounts.中文:
在 Windows 上进行开发通常会深度依赖 WSL2。此功能允许用户在 WSL2 环境中直接安装 Gemini CLI,同时在 Windows 宿主机上使用 Cockpit Tools 来管理 Gemini 和其他 AI 驱动。通过跨系统边界自动同步
.gemini配置,它确保了无缝的开发者体验,避免了在切换账号时手动复制凭据的麻烦。Summary / 摘要
English:
Implemented logic using
wsl.exeto automatically sync~/.geminito the default WSL distribution when switching the active Gemini instance.Added a
gemini_sync_wslconfiguration option (enabled by default) to control this behavior.Added a "Sync WSL Configuration" toggle to both the main Settings page and the Gemini Quick Settings popover (visible only on Windows).
Added English and Chinese translations for the new WSL sync settings.
中文:
使用
wsl.exe实现了在切换 Gemini 活跃实例时,自动将~/.gemini同步到默认的 WSL 发行版的逻辑。添加了
gemini_sync_wsl配置选项(默认启用)来控制此行为。在主设置页面和 Gemini 快捷设置弹出窗口中添加了“同步 WSL 配置”开关(仅在 Windows 上可见)。
为新的 WSL 同步设置添加了中英文翻译。
Test Plan / 测试计划
English:
[ ] On Windows, verify that the "Sync WSL Configuration" toggle appears in the Settings page and the Gemini Quick Settings popover.
[ ] With the setting enabled, switch the active Gemini account and verify that the credentials in
~/.geminiinside WSL are updated accordingly.[ ] With the setting disabled, verify that switching the active Gemini account does not modify the WSL
.geminidirectory.[ ] Verify the toggle does not appear on macOS/Linux.
中文:
[ ] 在 Windows 上,验证“同步 WSL 配置”开关正常显示在设置页面和 Gemini 快捷设置弹出窗口中。
[ ] 启用该设置后,切换活跃的 Gemini 账号,验证 WSL 内的
~/.gemini目录凭据是否相应更新。[ ] 禁用该设置后,验证切换活跃的 Gemini 账号不会修改 WSL 中的
.gemini目录。[ ] 验证该开关在 macOS/Linux 上不显示。