Skip to content

feat: redesign paths management and improve MCP sync UX#40

Closed
sametbrr wants to merge 7 commits into
tawanorg:mainfrom
sametbrr:main
Closed

feat: redesign paths management and improve MCP sync UX#40
sametbrr wants to merge 7 commits into
tawanorg:mainfrom
sametbrr:main

Conversation

@sametbrr

Copy link
Copy Markdown

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):

  • CLAUDE.md
  • plugins
    ...

Exclude:

  • plugins//node_modules/
    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.

sametbrr and others added 7 commits June 12, 2026 23:18
- 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
@tawanorg

Copy link
Copy Markdown
Owner

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 (paths exclude <glob> vs nested subcommands)
✅ Smart default vs custom path detection
✅ Auto-cleanup of conflicting excludes when re-adding paths
✅ MCP sync improvements with immediate push on enable
✅ Good documentation updates

Concerns/Questions:

  1. Breaking changes: The command structure change (excludepaths exclude) is a breaking change. Should this be a major version bump?

  2. MCP *bool field: Using *bool with omitempty is clever for backward compat, but could be confusing. Would a migration path be clearer?

  3. 688 additions: This is a large PR. Consider breaking into smaller, focused PRs:

    • Paths command redesign
    • MCP improvements
    • Documentation updates
  4. Test coverage: Does this include tests for the new command behavior?

This is good work overall, but the scope is large. Would you be open to splitting this into smaller PRs for easier review?

@sametbrr

Copy link
Copy Markdown
Author

Thanks for the review! Per your feedback, I've split this into two smaller, focused PRs and addressed the points raised:

  • feat!: redesign sync path management #46feat!: redesign sync path management (paths only). Marked as a breaking change (feat!: + BREAKING CHANGE: footer) so semantic-release cuts a major version. The PR body also clarifies that there was never a top-level exclude command — paths exclude always lived under paths; only the sub-command syntax was flattened.
  • feat: improve MCP sync UX (enable/disable/status, *bool semantics) #45feat: improve MCP sync UX (MCP only). The body explains the rationale for the *bool + omitempty field: it encodes the unset / on / off states in the type itself and keeps full backward compatibility with no config-migration step.

Docs are reorganized per PR. Closing this in favor of the two above.

@sametbrr sametbrr closed this Jun 20, 2026
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