Storg

A Golang-based CLI utility for efficient file organization and batch renaming with MIME-type classification and progress tracking.

No cover image yet

Project Details

Storg is a command-line utility built with Golang and the Cobra library, designed to streamline file management tasks. It enables users to bulk rename files in a directory using a numerical sequence with an optional prefix, and to organize files automatically into subdirectories based on their MIME types. The program supports both long and short command options, providing flexibility for experienced CLI users. Storg also includes real-time progress tracking, giving users visibility into ongoing operations during bulk tasks. The utility demonstrates a focus on performance, user experience, and reliability within the command-line environment.

Tech Stack

GolangCobraos/filepathmimeCLI

Tags

CLI toolUtilityPersonal ProjectFile Management

Behind the Project

Problem

I kept running into the same tedious task: a directory full of files with no meaningful names or structure — downloads, exports, screenshots all piled together. Manually sorting and renaming them was a time sink. I wanted a single command I could run from anywhere that just handled it.

Approach

Go was the natural choice — it compiles to a single binary, starts fast, and has excellent standard library support for filesystem operations. I used Cobra to structure the CLI so that adding new subcommands later wouldn't require restructuring the whole program. MIME-type detection from file content (not just extension) made the classification more reliable on files with missing or wrong extensions.

What I learned

  • Go's standard library covers most CLI needs — reaching for external packages too early adds complexity without proportional benefit.
  • MIME detection by content is significantly more reliable than extension-based detection, especially for files created by tools that don't follow conventions.
  • Cobra's command structure is easy to grow — the time spent setting it up correctly at the start paid off when adding the rename subcommand later.
  • Real-time progress feedback matters more in CLI tools than I expected — silent bulk operations feel broken even when they're working.

Lawal Habeebullahi

Software Engineer/System Administrator • Building reliable systems & beautiful interfaces

© 2026 Lawal Habeebullahi. All rights reserved.