gcase

cli
cobra
golang
Gopher

gcase

Rename files and folders by case upper, lower, or capitalize


Small utility to fix my recurring pain of capital and uppercase folders. Nothing fancy.

gcase is a CLI tool for bulk-renaming files and directories by changing their case. Point it at a path, pick a mode, and it renames everything with full control over recursion, hidden files, extension preservation, and dry-run previews before touching anything.


Table of Contents


Features

  • Rename files, directories, or both in one shot
  • Recursive mode for entire directory trees
  • Dry-run preview to see every change before it happens
  • Preserve file extensions during rename (e.g. FILE.TXTfile.TXT)
  • Hidden file support (.dotfiles and .dotdirs)
  • Deepest paths renamed first safe order guaranteed, no stale parent paths
  • Works on Linux, macOS, and Windows

Installation

go install github.com/shricodev/gcase@latest

Usage

gcase <command> <path> [flags]

Commands

CommandDescription
lowerRename items to lowercase
upperRename items to uppercase
capitalizeCapitalize the first letter of each item name

Flags

FlagShortDefaultDescription
--dry-run-nfalseShow what would be renamed without changing anything
--recursive-rfalseRename recursively
--targetdirsWhat to rename: dirs, files, or all
--preserve-extensiontruePreserve file extensions when renaming
--include-hiddenfalseInclude hidden files and directories

Examples

Preview lowercasing all files recursively, without changing anything:

gcase lower ./myproject --target files --recursive --dry-run

Uppercase all directory names in the current folder:

gcase upper . --target dirs

Capitalize everything recursively, including hidden files:

gcase capitalize ./myproject --target all --recursive --include-hidden

Lowercase file names but keep their extensions untouched:

gcase lower ./myproject --target files --preserve-extension

Rename a single file:

gcase upper ./docs/README.md

Full recursive rename of files and dirs, live (no dry-run):

gcase lower ./myproject --target all --recursive --include-hidden --preserve-extension=false

License

Licensed under the Apache 2.0 License.