A collection of useful command-line tools written in Go, designed to enhance your development workflow and file management tasks.
Convert text between various case formats with support for 14 different transformations including snake_case, camelCase, PascalCase, and more.
Analyze folder sizes with colored output, progress tracking, and customizable exclusions. Perfect for identifying disk space usage.
Search for text content within files using regex or plain text matching. Supports multiple file types and directory exclusions.
Advanced file and directory finder with pattern matching, size filtering, and parallel processing for large directory trees.
Find and replace text in files or directories with automatic backup creation and support for multi-line replacements.
- Go 1.21 or later
- Git (for cloning)
- Powershell 7 - required only if you run these tools in Windows PowerShell. Ignore if you're using Command Prompt.
-
Clone the repository:
git clone <repository-url> cd my-cli
-
Build all tools:
# Build all tools at once for dir in */; do if [ -f "$dir/go.mod" ]; then echo "Building $(basename "$dir")..." cd "$dir" go build -o "$(basename "$dir")" . cd .. fi done
-
Or build individual tools:
# Case Converter cd case-converter && go build -o case-converter . && cd .. # Check Folder Size cd check-folder-size && go build -o check-folder-size . && cd .. # Find Content cd find-content && go build -o find-content . && cd .. # Find Everything cd find-everything && go build -o find-everything . && cd .. # Replace Text cd replace-text && go build -o replace-text . && cd ..
Purpose: Convert text between various case formats for programming and documentation.
Key Features:
- 14 different case formats (snake_case, camelCase, PascalCase, etc.)
- Automatic detection of input format
- Colored terminal output
- File input support
Usage:
# Basic conversion
./case-converter "hello world"
# From file
./case-converter -f input.txt
# Specific format only
./case-converter "hello world" --format snake
Supported Formats:
normal
,upper
,lower
,capitalized
,swapped
snake_case
,kebab-case
,camel_case
,pascal_case
constant_case
,title_case
,dot_case
,path_case
,pascal_kebab
Purpose: Analyze disk usage and identify large files/folders.
Key Features:
- Colored output based on size (green/yellow/red)
- Progress tracking for large directories
- Customizable exclusions
- Sort by size or name
Usage:
# Analyze current directory
./check-folder-size
# Analyze with progress
./check-folder-size -progress
# Exclude specific folders
./check-folder-size -exclude-dirs "node_modules,.git"
# Sort by name
./check-folder-size -sort name -asc
Purpose: Search for text content within files using regex or plain text.
Key Features:
- Regex and plain text search
- Multiple file type support
- Directory exclusions
- Line number display
Usage:
# Search for text
./find-content "search term" /path/to/search
# Use regex
./find-content -regex "pattern.*" /path/to/search
# Show line numbers
./find-content -line-nums "term" /path/to/search
# Case insensitive
./find-content -case-insensitive "term" /path/to/search
Purpose: Advanced file and directory finder with pattern matching and filtering.
Key Features:
- Pattern-based file/directory matching
- Size filtering (min/max)
- File type filtering
- Parallel processing
- Progress tracking
Usage:
# Find files by pattern
./find-everything "*.txt" /path/to/search
# Filter by size
./find-everything -min-size "1MB" -max-size "100MB" "*.log" /path
# Find specific file types
./find-everything -file-types "go,js,py" "*" /path
# Show progress
./find-everything -progress "*.md" /path
Purpose: Find and replace text in files with automatic backup creation.
Key Features:
- File and directory processing
- Automatic backup creation (.bak files)
- Multi-line replacement support
- Escape sequence handling
Usage:
# Replace in single file
./replace-text "old text" "new text" file.txt
# Replace in directory
./replace-text "old text" "new text" /path/to/directory
# Handle escape sequences
./replace-text "\\n" "\\r\\n" file.txt
- Case Converter: Standardize variable names, file names, and documentation
- Find Content: Search for function usage, API endpoints, or configuration values
- Replace Text: Bulk refactoring, configuration updates, or text standardization
- Check Folder Size: Monitor disk usage, identify large files
- Find Everything: Locate specific file types, audit file systems
- Find Content: Search logs, configuration files, or documentation
- Find Everything: Organize files by type, size, or pattern
- Replace Text: Batch file modifications with safety backups
- Check Folder Size: Clean up disk space efficiently
my-cli/
βββ case-converter/ # Text case conversion tool
βββ check-folder-size/ # Disk usage analyzer
βββ find-content/ # Text search tool
βββ find-everything/ # Advanced file finder
βββ replace-text/ # Text replacement tool
Each tool is self-contained with its own go.mod
file:
# Navigate to any tool directory
cd case-converter
# Install dependencies
go mod tidy
# Build
go build -o case-converter .
# Run
./case-converter "hello world"
All tools use:
- Cobra: CLI framework for Go
- Standard library: File operations, regex, unicode handling
# Convert API endpoint names
./case-converter "user authentication endpoint" --format snake
# Output: user_authentication_endpoint
# Convert to PascalCase for class names
./case-converter "database connection manager" --format pascal
# Output: DatabaseConnectionManager
# Find largest directories
./check-folder-size -sort size -asc
# Exclude build artifacts
./check-folder-size -exclude-dirs "node_modules,dist,build,.git"
# Find all TODO comments
./find-content "TODO" /path/to/project
# Search for specific function usage
./find-content -case-insensitive "getUser" /path/to/code
# Find all configuration files
./find-everything "*.{json,yaml,yml,ini}" /path/to/config
# Find large log files
./find-everything -min-size "10MB" "*.log" /var/log
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is open source and available under the MIT License.
For issues, feature requests, or questions:
- Check the individual tool READMEs for specific documentation
- Review the examples above
- Open an issue on the repository
Happy coding! π