Files
renamer/specs/008-ai-rename-prompt/quickstart.md
Rogee 3867736858 feat: implement AI-assisted rename prompting feature
- 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.
2025-11-03 18:08:14 +08:00

1.2 KiB

Quickstart: AI-Assisted Rename Prompting

Prerequisites

  • Go 1.24 environment (CLI build/test)
  • *_MODEL_AUTH_TOKEN stored 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-genkit to emit inline prompt/response traces (written to ~/.renamer/genkit.log).
  • Validation failures: Run with --export-plan out.json to inspect AI output and manually edit.
  • Rate limits: Configure --genkit-model flag or GENKIT_MODEL env variable to select a lighter model.