Skip to content

feat!: redesign sync path management#46

Open
sametbrr wants to merge 1 commit into
tawanorg:mainfrom
sametbrr:feat/paths-redesign
Open

feat!: redesign sync path management#46
sametbrr wants to merge 1 commit into
tawanorg:mainfrom
sametbrr:feat/paths-redesign

Conversation

@sametbrr

Copy link
Copy Markdown

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 paths command set plus dynamic sync-path control:

claude-sync paths                        # Show sync list and exclude filters
claude-sync paths add my-notes           # Add a custom directory
claude-sync paths remove history.jsonl   # Smart remove (stays off after reset)
claude-sync paths exclude "plugins/**/node_modules/**"    # Sub-path glob filter
claude-sync paths unexclude "plugins/**/node_modules/**"  # Remove a filter
claude-sync paths edit                   # Interactive multi-select
claude-sync paths reset                  # Restore factory defaults
  • Model: effective sync = sync_list − exclude_list.
  • Smart remove: removing a default path records an exclude entry so it stays off even after paths reset; removing a custom path just deletes it. paths add clears a conflicting exclude when re-enabling a removed default.
  • New SyncPaths config field + GetEffectiveSyncPaths() lets the synced set be overridden per device; workflows added 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 exclude command. paths exclude has always lived under paths. What this PR changes is the sub-command syntax:

Before After
paths exclude add <pattern> paths exclude <glob>
paths exclude remove <pattern> paths unexclude <glob>
paths exclude list paths (no args)

Flattening the nested paths exclude {list,add,remove} group makes it symmetric with the sibling verbs paths add / paths remove and removes a level of nesting — it reads better and is what users would reach for first. It composes cleanly with the existing paths tree rather than introducing anything alongside it.

Because the old paths exclude sub-command syntax is removed, this is a breaking change. It's marked accordingly so semantic-release cuts a major version: the commit is feat!: with a BREAKING CHANGE: footer.

Docs

CLAUDE.md (paths-management architecture) and README.md (Sync Paths Management, Auto-Sync Hooks, updated Exclude Patterns) updated to match.

Scope

Diff is limited to paths: cmd/claude-sync/main.go (the paths command tree + backup-helper refactor to take an explicit path set), internal/config/config.go (SyncPaths field, GetEffectiveSyncPaths, workflows default), 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.

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.
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.

1 participant