feat: redesign paths management and improve MCP sync UX#40
Conversation
- Add Config.SyncPaths field (sync_paths in config.yaml) to override scope-based path set - Add GetEffectiveSyncPaths(): returns custom list when set, otherwise ScopedSyncPaths(scope) - Update syncPaths() method to call GetEffectiveSyncPaths() so sync_paths takes precedence over scope - Add workflows to default SyncPaths - Add claude-sync paths command: list, add, remove, edit, reset, exclude sub-commands - Thread syncPaths through handleFirstPullWithExistingFiles and createBackup for accurate backups
When adding a path, remove any existing exclude patterns that would block it. When removing a path, automatically add it to excludes so future default additions don't re-include it.
When listing paths, detect any active sync paths that are already blocked by an exclude pattern and remove them from config automatically, keeping the displayed list consistent with what actually gets synced.
Add `mcp enable` and `mcp disable` commands to toggle automatic MCP sync via config instead of requiring the --include-mcp flag every time. Also expand the paths command long description to better document subcommands.
- Flatten paths exclude sub-commands into top-level exclude/unexclude - paths remove now smart: default paths get exclude entry, custom paths don't - paths bare command shows sync list and exclude filters - Add rich Long docs and examples to all paths subcommands - Add mcp status command showing auto-sync state and server changes - Change MCPSync field to *bool so mcp disable writes explicit false - mcp enable now immediately runs MCP push after setting the flag
- Document paths management architecture and smart remove behavior - Expand MCP sync section with enable/disable/status commands and *bool field details - Add MCP Server Sync section to README with all subcommands - Add Sync Paths Management section to README with exclude/unexclude usage - Update Exclude Patterns section to use CLI commands instead of direct YAML
|
Thanks for this comprehensive redesign of paths management! This is a significant change, so here's a detailed review: What I like: ✅ Flattening the command structure ( Concerns/Questions:
This is good work overall, but the scope is large. Would you be open to splitting this into smaller PRs for easier review? |
|
Thanks for the review! Per your feedback, I've split this into two smaller, focused PRs and addressed the points raised:
Docs are reorganized per PR. Closing this in favor of the two above. |
This PR redesigns two areas: sync path management and MCP sync UX.
paths commands redesigned
exclude is no longer a nested exclude list/add/remove subcommand group — it's now a flat paths exclude / paths unexclude .
Smart remove: paths remove now detects whether the target is a default or custom path:
Default path (e.g. history.jsonl) → removed from sync list + added to exclude → stays off after paths reset
Custom path → simply deleted from sync list, exclude untouched
paths add automatically cleans up conflicting exclude entries when re-enabling a removed path.
paths (no args) now shows the list directly:
Sync Paths (default):
...
Exclude:
MCP sync improvements
mcp enable no longer just writes a flag to config — it also immediately runs an MCP push. Enabling auto-sync syncs your current state right away; subsequent push/pull runs include MCP automatically.
mcp disable now writes mcp_sync: false explicitly instead of removing the field. Existing configs without the field unmarshal to nil → disabled, preserving backward compatibility (*bool + omitempty).
mcp status is a new command showing the current setting, server count, and whether there are unpushed local changes:
Auto-sync ✓ enabled (included in every push/pull)
Servers 5 configured
Changes ✓ in sync
Docs
CLAUDE.md and README.md updated to document the paths management architecture, MCP *bool field semantics, new commands, and usage examples.