- Added data model for AI-assisted renaming including structures for prompts, responses, and policies. - Created implementation plan detailing the integration of Google Genkit into the CLI for renaming tasks. - Developed quickstart guide for setting up and using the new AI rename functionality. - Documented research decisions regarding Genkit orchestration and prompt composition. - Established tasks for phased implementation, including setup, foundational work, and user stories. - Implemented contract tests to ensure AI rename policies and ledger metadata are correctly applied. - Developed integration tests for validating AI rename flows, including preview, apply, and undo functionalities. - Added tooling to pin Genkit dependency for consistent builds.
1.2 KiB
1.2 KiB
Quickstart: AI-Assisted Rename Prompting
Prerequisites
- Go 1.24 environment (CLI build/test)
*_MODEL_AUTH_TOKENstored under$HOME/.config/.renamer/(default OpenAI-compatible key)
Install Dependencies
# Sync Go modules (includes google/genkit)
go mod tidy
Preview AI Rename Plan
go run ./cmd/renamer ai \
--path ./fixtures/batch \
--sequence-width 3 \
--sequence-style prefix \
--naming-casing kebab \
--banned "promo,ad" \
--dry-run
CLI invokes the in-process Genkit workflow and renders a preview table with sequential, sanitized names.
Apply Approved Plan
go run ./cmd/renamer ai --path ./fixtures/batch --yes
Validates the cached plan, applies filesystem renames, and writes ledger entry with AI metadata.
Testing
# Go unit + integration tests (includes Genkit workflow tests)
go test ./...
Troubleshooting
- Genkit errors: Run with
--debug-genkitto emit inline prompt/response traces (written to~/.renamer/genkit.log). - Validation failures: Run with
--export-plan out.jsonto inspect AI output and manually edit. - Rate limits: Configure
--genkit-modelflag orGENKIT_MODELenv variable to select a lighter model.