A simple CLI tool to clean up strings.
- Lowercase the entire string.
- Replace accented Latin letters with their unaccented base letter.
- Replace any sequence of non-alphanumeric characters with a single underscore.
- Insert an underscore between adjacent numeric and alpha characters.
- If the string starts with a digit, prepend an underscore.
- Strip any trailing underscores.
First Name -> first_name
2026 World Cup -> _2026_world_cup
col#1 -> col_1
Amount($) -> amount
Café Müller -> cafe_muller
make install # Builds and installs janitor to ~/.local/binMake sure ~/.local/bin is on your PATH.
janitor -s "string" # Using flag
janitor "string" # Positional args
echo "string" | janitor # PipedCombining -s with a positional argument is an error, since it's ambiguous which one you meant.
make help # List all available targets
make build # Build janitor into bin/
make run # Run janitor
make test # Run the test suite
make lint # Run golangci-lint
make fmt # Format all Go files
make modernize # Report modernizable Go patterns
make tidy # Tidy go.mod and go.sum
make clean # Remove build artifacts