# summary

Sync Cursor canvas cache with repo source files.

# description

Replaces each cached `.canvas.tsx` file under `~/.cursor/projects/<slug>/canvases/` with a symlink to the repo source so edits made outside Cursor are reflected immediately on reopen.

Supported canvas locations (first match wins): `docs/canvases`, `canvases`, `src/canvases`.

# flags.dry-run.summary

Preview changes without writing anything.

# flags.init.summary

Create the cache directory if it does not exist.

# flags.clean.summary

Remove orphan files in cache after syncing.

# flags.path.summary

Target repository path (default: git root of current directory).

# examples

- Sync canvases for the current repo:

  <%= config.bin %> <%= command.id %>

- Preview without making changes:

  <%= config.bin %> <%= command.id %> --dry-run

- Initialize cache dir and sync:

  <%= config.bin %> <%= command.id %> --init

- Sync and remove orphans:

  <%= config.bin %> <%= command.id %> --clean

# warn.cursorNotActive

cursor is not listed in workspace tools — skipping canvas sync.

# warn.orphan

Orphan in cache (no repo counterpart): %s (run canvas clean to remove)

# info.cacheCreated

Created cache directory: %s

# info.linked

linked: %s -> %s

# info.dryRunLink

[dry-run] would link: %s -> %s

# info.dryRunSummary

Dry run — no changes made. would sync: %s · already ok: %s · orphans: %s

# info.summary

Synced %s canvas(es), %s already ok

# error.noCacheDir

No Cursor canvas cache for this project. Expected: %s. Run with --init to create it, or open a .canvas.tsx in Cursor first.

# error.noSources

No .canvas.tsx files found in %s. Searched: docs/canvases, canvases, src/canvases.
