Skip to content

shricodev/gcase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gopher

gcase

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

Go Version License Platform CLI


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

Command Description
lower Rename items to lowercase
upper Rename items to uppercase
capitalize Capitalize the first letter of each item name

Flags

Flag Short Default Description
--dry-run -n false Show what would be renamed without changing anything
--recursive -r false Rename recursively
--target dirs What to rename: dirs, files, or all
--preserve-extension true Preserve file extensions when renaming
--include-hidden false Include 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.

About

change 'case' of files and directories recursively. small utility to fix my recurring pain. WIP ✅

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors