feat!: redesign sync path management#46
Open
sametbrr wants to merge 1 commit into
Open
Conversation
Replace the nested `paths exclude {list,add,remove}` subcommand group with a
flat, ergonomic command set and add dynamic sync-path control.
New / changed commands:
- `paths` (no args) prints the effective sync list and exclude filters.
- `paths add <path>` / `paths remove <path>` manage the sync list. `remove`
is smart: removing a default path records an exclude entry so it stays off
after `paths reset`; removing a custom path just deletes it. `add` clears a
conflicting exclude when re-enabling a removed default.
- `paths exclude <glob>` / `paths unexclude <glob>` manage sub-path glob
filters (skip files inside an already-synced directory).
- `paths edit` (interactive) and `paths reset` (factory defaults).
Model: effective sync = sync_list - exclude_list. A new `SyncPaths` config
field plus `GetEffectiveSyncPaths()` lets the synced set be overridden per
device; `workflows` is added to the default set.
There was never a top-level `exclude` command - `paths exclude` always lived
under `paths`. What changed is the sub-command syntax: the old
`paths exclude {list,add,remove}` group is flattened to `paths exclude <glob>`
and `paths unexclude <glob>`, which is symmetric with `paths add` / `paths
remove` and removes a level of nesting. Because the old exclude sub-command
syntax is removed, this is a breaking change.
BREAKING CHANGE: `paths exclude add <pattern>`, `paths exclude remove <pattern>`
and `paths exclude list` are removed. Use `paths exclude <glob>`,
`paths unexclude <glob>`, and `paths` (no args) respectively.
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.
This is one of two focused PRs that replace #40 (which bundled paths + MCP + docs into a single 688-line change). This PR contains only the sync-path management redesign; the MCP sync UX work is a separate PR (#45).
What changed
A flat, ergonomic
pathscommand set plus dynamic sync-path control:effective sync = sync_list − exclude_list.remove: removing a default path records an exclude entry so it stays off even afterpaths reset; removing a custom path just deletes it.paths addclears a conflicting exclude when re-enabling a removed default.SyncPathsconfig field +GetEffectiveSyncPaths()lets the synced set be overridden per device;workflowsadded to the default set.On the breaking change / version bump (re: review feedback on #40)
To be precise about what actually changed: there was never a top-level
excludecommand.paths excludehas always lived underpaths. What this PR changes is the sub-command syntax:paths exclude add <pattern>paths exclude <glob>paths exclude remove <pattern>paths unexclude <glob>paths exclude listpaths(no args)Flattening the nested
paths exclude {list,add,remove}group makes it symmetric with the sibling verbspaths add/paths removeand removes a level of nesting — it reads better and is what users would reach for first. It composes cleanly with the existingpathstree rather than introducing anything alongside it.Because the old
paths excludesub-command syntax is removed, this is a breaking change. It's marked accordingly so semantic-release cuts a major version: the commit isfeat!:with aBREAKING CHANGE:footer.Docs
CLAUDE.md(paths-management architecture) andREADME.md(Sync Paths Management, Auto-Sync Hooks, updated Exclude Patterns) updated to match.Scope
Diff is limited to paths:
cmd/claude-sync/main.go(thepathscommand tree + backup-helper refactor to take an explicit path set),internal/config/config.go(SyncPathsfield,GetEffectiveSyncPaths,workflowsdefault),internal/config/config_test.go(test for the new method),internal/sync/sync.go(helper honors the override), and the paths doc sections. No MCP changes.