slugomatic-0.2.2 is not a library.
🐌 Slugomatic
A simple and fast CLI tool to slugify and unslugify text, perfect for creating branch names, URLs, and file names.
Features
- Slugify text: Convert text to URL-friendly slugs (default behavior)
- Unslugify text: Convert slugs back to readable text
- Clipboard integration: Automatically copies results to clipboard
- Fast and lightweight: Built with Rust for maximum performance
- Cross-platform: Works on Windows, macOS, and Linux
- Case conversion: Output can be converted to all lowercase, all uppercase, or title case using
--lowercase
,--uppercase
, or--title
Installation
From crates.io
From source
Usage
Slugify text (default behavior)
# Convert text to slug
# Output: Hello-World
# You may also echo text and pipe it (works if TEXT is omitted)
|
# Output: My-Feature-Branch
# Most git branch names should be lowercase; see --lowercase below!
# For human-readable output you can use --title!
Unslugify text
# Convert slug back to text
# Output: hello world
# Output: my feature branch
|
# Output: fix user authentication bug
No clipboard copy
# Disable automatic clipboard copy
Case conversion
# Default: preserves input capitalization
# Output: Some-Mixed-Case-Words
# Force output to lowercase
# Output: some-text-here
# Output: my feature branch
# Force output to uppercase
# Output: SOME-TEXT-HERE
# Output: MY FEATURE BRANCH
# Title Case output:
# Output: Some Mixed Case Words
Examples
# Perfect for Git branch names (commonly lowercase):
# Output: fix-user-authentication-bug
# Title case for readability
# Output: Fix User Authentication Bug
# Works with special characters
# Output: Add-new-feature-v20
### Slugify via stdin
# These both work the same:
|
### Prevent copying to clipboard
|
Options
-s, --slug
: Explicitly slugify the input (default behavior)-u, --unslug
: Unslugify the input (convert dashes to spaces)--no-clipboard
: Do not copy the result to the clipboard (default is to copy)TEXT
: The text to process; if omitted, reads from stdin--lowercase
: Convert the result to all lowercase (mutually exclusive with--uppercase
and--title
)--uppercase
: Convert the result to all uppercase (mutually exclusive with--lowercase
and--title
)--title
: Convert the result to title case (each word starts uppercase, mutually exclusive with--lowercase
and--uppercase
)-h, --help
: Show detailed help information, usage, and examples-V, --version
: Show version information
CLI/Usage Highlights
- Text argument vs stdin: If you provide a
TEXT
, that is processed. IfTEXT
is omitted, input will be read from standard input (stdin). - Clipboard: Results are copied to clipboard by default if available; use
--no-clipboard
to control this. - Case conversion: By default, slug output preserves case. Use
--lowercase
,--uppercase
, or--title
to convert. These options cannot be combined. - Help: Try
slug --help
for full usage details, including all options and examples.
How it works
- Slugify: Removes special characters and replaces spaces with hyphens. Output case is preserved unless
--lowercase
,--uppercase
, or--title
is used. - Unslugify: Turns hyphens into spaces. Use
--lowercase
,--uppercase
, or--title
to standardize output if desired. - Clipboard: Results are automatically copied to your clipboard (unless disabled)
License
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.