F2
$ f2 Community Med Riskf2 is a cross-platform Go bulk file renamer engineered for safety: it runs in dry-run preview mode by default and requires -x (--exec) to actually rename files. It natively supports --json output, conflict detection, --no-color, and --undo to revert the last batch rename.
brew install f2 f2 handles complex regex, EXIF, and conflict-checked batch renames locally with --json and dry-run defaults.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Dry-run by default, native --json structured diff plans, --no-color, and zero interactive prompts make f2 ideal for coding agents.
- Supports
--jsonoutput for both dry-run and-xexecution - Dry-run preview is the default behavior unless
-xis passed
Prevents accidental writes via default dry-run, validates filename conflicts automatically, and supports --undo rollback.
- Requires explicit
-x(--exec) to mutate filenames - Built-in
--undoreverses the previous rename batch
Single static Go binary available via brew install f2, go install, and GitHub releases on macOS, Linux, and Windows.
- Cross-platform zero-dependency Go binary
Replaces fragile mv loops with regex capture groups, EXIF/ID3 variables, and automatic collision checking.
- Handles recursive (
-R), regex, and metadata-driven renames in one command
Actively maintained MIT-licensed Go project (ayoisaiah/f2) with v2 releases.
- Active upstream repository and regular releases
Thorough documentation covering variables, flags (-f, -r, -x, --undo, --json), and examples.
- Comprehensive README and
--helpoutput
Security, Auth & Guardrails
None required; stores local undo map files under the user cache/state directory when -x runs.
100% free, offline, and open-source (MIT).
# F2 Agent Rules - ALWAYS run `f2 ... --json` WITHOUT `-x` first to verify old/new paths and confirm zero conflicts. - Only add `-x` (`--exec`) after inspecting the dry-run JSON plan; use `f2 --undo` if a batch needs rollback.
Agent-Ready Command Recipes
Safe Read-Only Queries
f2 -f 'IMG_(\d+)' -r 'photo_$1' --json assets/
Computes source-to-target mappings and conflict checks in --json without touching any file (-x omitted).
Controlled Writes & Previews
f2 -f 'IMG_(\d+)' -r 'photo_$1' -x --json assets/
Applies the previewed rename using -x (--exec) and records an undo map reversible via f2 --undo.
Strengths for Agents
- + Dry-run by default (
-xrequired to write) eliminates accidental blind renames. - + Native
--jsonoutput, conflict detection, and--undorollback.
Caveats & Pitfalls
- ! Note
-ris--replacewhile uppercase-Ris--recursive; verify flags carefully.