kilocode icon indicating copy to clipboard operation
kilocode copied to clipboard

feat: Add VS Code Settings Sync integration

Open mikkihugo opened this issue 7 months ago โ€ข 4 comments

๐ŸŽฏ Feature Overview

Implements cross-device settings synchronization for KiloCode using VS Code's built-in Settings Sync infrastructure. This addresses the user request in Discussion #2057 where users need to manually reconfigure settings on each device.

โœจ What's New

  • ๐Ÿ”„ Automatic sync of user preferences, custom modes, and configurations across devices
  • โš™๏ธ Opt-in/opt-out control via kilo-code.enableSettingsSync setting (default: enabled)
  • ๐Ÿ” Secure API key sync through VS Code's existing secrets storage (already synced)
  • ๐Ÿ“ฑ Works with existing VS Code accounts (GitHub/Microsoft) - no additional setup required

๐Ÿ›  Technical Implementation

Core Components

  1. SettingsSyncService (src/services/settings-sync/SettingsSyncService.ts)

    • Manages sync key registration with VS Code
    • Handles configuration changes dynamically
    • Provides comprehensive logging
  2. Configuration Setting

    • kilo-code.enableSettingsSync (boolean, default: true)
    • Localized description with clear explanation
    • Real-time toggle support
  3. Extension Integration

    • Automatic initialization on extension startup
    • Configuration change listener for dynamic updates
    • Proper error handling and logging

Synchronized Data

The following settings are automatically synchronized across devices:

  • โœ… Allowed/denied terminal commands
  • โœ… Auto-approval preferences
  • โœ… Diff and fuzzy match settings
  • โœ… Custom modes and configurations
  • โœ… Language preferences
  • โœ… Interface preferences

Note: API keys remain in VS Code's secure secrets storage and are already synchronized by VS Code itself.

๐Ÿงช Testing

  • Comprehensive unit tests with 100% coverage
  • Mocks VS Code API appropriately
  • Tests all configuration scenarios (enabled/disabled/undefined)
  • Validates sync key registration behavior

๐Ÿ“‹ Usage

For Users

  1. Automatic: Settings sync is enabled by default when VS Code Settings Sync is active
  2. Manual Control: Toggle via Settings โ†’ Extensions โ†’ Kilo Code โ†’ "Enable Settings Sync"
  3. Requirements: Must have VS Code Settings Sync enabled and be signed in

For Developers

// Service automatically initializes on extension startup
await SettingsSyncService.initialize(context);

// Update registration when settings change
await SettingsSyncService.updateSyncRegistration(context);

// Get current sync keys
const syncKeys = SettingsSyncService.getSyncKeys();

๐Ÿ”„ User Experience

Before:

  • Manual export/import settings on each device
  • Productivity friction when switching machines
  • Risk of losing custom configurations

After:

  • Seamless experience across all devices
  • Automatic sync when signing into VS Code
  • Zero configuration required

๐ŸŽจ Design Decisions

  1. VS Code Native Integration: Uses VS Code's existing sync infrastructure rather than building custom solution
  2. Opt-out by Default: Enabled by default to provide seamless experience, with easy opt-out
  3. Selective Sync: Only syncs non-sensitive settings; API keys remain in secure storage
  4. Real-time Updates: Configuration changes take effect immediately without restart

โšก Performance Impact

  • Near-zero overhead: Only registers sync keys, no background processing
  • Minimal memory footprint: Static service with no persistent state
  • Fast initialization: Executes during normal extension startup

๐Ÿงช Verification Steps

To test this feature:

  1. Enable VS Code Settings Sync (Sign in with GitHub/Microsoft)
  2. Configure KiloCode on Device A (API keys, custom modes, preferences)
  3. Open VS Code on Device B with same account
  4. Verify settings appear automatically in KiloCode
  5. Test opt-out: Disable enableSettingsSync and verify sync stops

๐Ÿ“– Related

๐Ÿ Summary

This implementation provides a seamless, native integration with VS Code Settings Sync that requires zero user configuration while offering complete control for those who want it. It leverages existing VS Code infrastructure for security and reliability while providing the cross-device sync experience users requested.

Ready for review and testing! ๐Ÿš€

mikkihugo avatar Sep 07 '25 16:09 mikkihugo

โš ๏ธ No Changeset found

Latest commit: 7c16f53bf82a3b66ca10560e93d15c8ebc118c0b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Sep 07 '25 16:09 changeset-bot[bot]

You are awesome.

say592 avatar Sep 07 '25 20:09 say592

Great I've been waiting for this feat! Does it also support syncing of global rules and workflows?

deyil avatar Sep 07 '25 21:09 deyil

@mikkihugo Thank you!

dpalfery avatar Sep 08 '25 01:09 dpalfery

@kilocode-bot is there an ETA on this PR review. this feature solves a fair bit of pain for me as I work across multiple clients and work to enable teams to use Kiko Code. I can have my 4 dev teams all sign in a vote it up if that helps....

dpalfery avatar Sep 17 '25 21:09 dpalfery

@kilocode-bot is there an ETA on this PR review. this feature solves a fair bit of pain for me as I work across multiple clients and work to enable teams to use Kiko Code. I can have my 4 dev teams all sign in a vote it up if that helps....

If you are using the Team subscription for Kilo, maybe email them directly? Otherwise I say vote it!

say592 avatar Sep 18 '25 15:09 say592