Skip to content

feat(vision): rename --smart command (slug v1)#76

Merged
gfargo merged 1 commit into
mainfrom
feat/vision-rename
May 11, 2026
Merged

feat(vision): rename --smart command (slug v1)#76
gfargo merged 1 commit into
mainfrom
feat/vision-rename

Conversation

@gfargo
Copy link
Copy Markdown
Owner

@gfargo gfargo commented May 11, 2026

Closes #75. See issue for full design.

closes #75)

`localpress rename <ids> [--smart | --to <name>]` renames attachment
slugs (WP permalinks). With --smart, the new name is generated via the
Ollama vision model using the `title` kind, then slugified.

This release updates the WP slug (`post_name`) — affects the attachment
permalink. Does NOT rename the underlying file on disk; that requires
WP-CLI + filesystem ops and is deferred to a follow-up.

- UpdateMetadata gains `slug?: string`
- RestAdapter forwards `slug` → WP REST `slug` field
- New slugify() helper (kebab-case, ASCII, hyphen-collapse, 100-char cap)
- Time-machine snapshot before each rename
- Idempotent: skips if current slug already matches
- 8 unit tests covering: spaces, punctuation, underscores, unicode,
  length cap, trailing punctuation

MCP tool `rename` accepts ids + smart|to + optional model/dryRun.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@gfargo gfargo merged commit 1787e9c into main May 11, 2026
4 checks passed
@gfargo gfargo deleted the feat/vision-rename branch May 11, 2026 20:40
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.

feat(vision): rename --smart command (slug-only v1)

1 participant