Skip to content

feat: add Sync Variants feature to copy config between variants#9

Open
MohMaya wants to merge 3 commits intonumman-ali:mainfrom
MohMaya:feat/sync-variants
Open

feat: add Sync Variants feature to copy config between variants#9
MohMaya wants to merge 3 commits intonumman-ali:mainfrom
MohMaya:feat/sync-variants

Conversation

@MohMaya
Copy link

@MohMaya MohMaya commented Jan 5, 2026

Summary

  • Add "Sync Variants" feature to copy configuration between variants
  • Syncs skills, MCP servers, permissions, and CLAUDE.md from source to multiple targets
  • Creates single backup before sync (overwrites previous backup)
  • Preserves provider-specific env vars (ANTHROPIC_, CC_MIRROR_, Z_AI_*, etc.)

Changes

New Files

  • src/core/sync.ts - Core sync logic with syncVariants(), createConfigBackup(), restoreConfigBackup()
  • src/tui/hooks/useSync.ts - TUI state machine hook
  • src/tui/screens/SyncSourceScreen.tsx - Single variant selection
  • src/tui/screens/SyncTargetsScreen.tsx - Multi-select targets with Space key

Modified Files

  • src/core/index.ts - Export sync functions
  • src/tui/app.tsx - Add sync screen handlers and state
  • src/tui/screens/HomeScreen.tsx - Add "Sync Variants" menu item
  • test/tui.test.ts - Fix menu navigation tests for new item

TUI Flow

Home -> "Sync Variants" -> sync-source (pick one) -> sync-targets (Space to toggle, Enter to confirm) -> sync-running -> sync-done

What Gets Synced

Item Source Target
Skills config/skills/ Copied recursively
MCP Servers .claude.json mcpServers Merged (source wins)
Permissions settings.json permissions Overwritten
CLAUDE.md config/CLAUDE.md Copied if exists

What Does NOT Get Synced

  • Provider-specific env vars (ANTHROPIC_, CC_MIRROR_, TWEAKCC_, Z_AI_, MINIMAX_*, etc.)
  • Theme preferences
  • Team mode configuration

Closes #8

Add ability to sync skills, MCP servers, permissions, and CLAUDE.md
from one source variant to multiple target variants.

- Add src/core/sync.ts with syncVariants(), createConfigBackup(),
  restoreConfigBackup() functions
- Add TUI flow: sync-source -> sync-targets -> sync-running -> sync-done
- Preserve provider-specific env vars (ANTHROPIC_*, CC_MIRROR_*, etc.)
- Create single backup before sync (overwrites previous backup)
- Multi-select targets with Space key, Enter to confirm

Closes numman-ali#8
Copilot AI review requested due to automatic review settings January 5, 2026 01:46
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a "Sync Variants" feature that allows users to copy configuration from one source variant to multiple target variants. The feature includes interactive TUI screens for selecting source and target variants, syncs skills, MCP servers, permissions, and CLAUDE.md files, and creates backups before making changes.

Key changes:

  • New core sync module with functions for syncing config items between variants and managing backups
  • TUI screens for source selection (single) and target selection (multi-select with Space key)
  • Integration of sync flow into main TUI app with proper state management

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/core/sync.ts Core sync logic with backup/restore, individual item sync functions, and async variants
src/core/index.ts Exports sync functions and types
src/tui/hooks/useSync.ts TUI hook managing sync operation state and progress
src/tui/hooks/index.ts Exports useSync hook
src/tui/screens/SyncSourceScreen.tsx Single-select screen for choosing source variant
src/tui/screens/SyncTargetsScreen.tsx Multi-select screen for choosing target variants
src/tui/screens/index.ts Exports new sync screens
src/tui/screens/HomeScreen.tsx Adds "Sync Variants" menu item
src/tui/app.tsx Integrates sync screens and state management
test/tui.test.ts Updates tests to account for new menu item

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@numman-ali
Copy link
Owner

@claude review thoroughly not only from a technical perspective but from a ux and product perspective

Use CEV thinking and consider whether this covers all angles or there is more to make this features applicable universally

@claude
Copy link

claude bot commented Jan 5, 2026

Claude encountered an error —— View job

Command failed: git fetch origin --depth=20 feat/sync-variants

I'll analyze this and get back to you.

- Add CLAUDE.md to HomeScreen sync description for accuracy
- Fix backup error attribution to report on all requested items
- Remove double-counting bug in syncPermissions
@MohMaya
Copy link
Author

MohMaya commented Jan 5, 2026

Claude encountered an error —— View job

Command failed: git fetch origin --depth=20 feat/sync-variants

I'll analyze this and get back to you.

this is an issue with Claude Code Action @numman-ali : #223

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.

feat: Add Sync Variants feature to copy config between variants

2 participants