sttr #
sttr
is command line software that allows you to quickly run various transformation operations on the string.
// With input prompt
sttr
// Direct input
sttr md5 "Hello World"
// File input
sttr md5 file.text
sttr base64-encode image.jpg
// Reading from different processor like cat, curl, printf etc..
echo "Hello World" | sttr md5
cat file.txt | sttr md5
// Writing output to a file
sttr yaml-json file.yaml > file-output.json
🎥 Demo #
🔋 Installation #
Quick install #
You can run the below curl
to install it somewhere in your PATH for easy use.
Ideally it will be installed at ./bin
folder
curl -sfL https://raw.githubusercontent.com/abhimanyu003/sttr/main/install.sh | sh
Homebrew #
If you are on macOS and using Homebrew, you can install sttr
with the following:
brew tap abhimanyu003/sttr
brew install sttr
Go #
go install github.com/abhimanyu003/sttr@latest
Manually #
Download the pre-compiled binaries from the Release! page and copy them to the desired location.
📚 Guide #
- After installation simply run
sttr
command.
// For interactive menu
sttr
// Provide your input
// Press two enter to open operation menu
// Press `/` to filter various operations.
// Can also press UP-Down arrows select various operations.
- Working with help.
sttr -h
// Example
sttr zeropad -h
sttr md5 -h
- Working with files input.
sttr {command-name} {filename}
sttr base64-encode image.jpg
sttr md5 file.txt
sttr md-html Readme.md
- Writing output to file.
sttr yaml-json file.yaml > file-output.json
- Taking input from other command.
curl https://jsonplaceholder.typicode.com/users | sttr json-yaml
- Chaining the different processor.
sttr md5 hello | sttr base64-encode
echo "Hello World" | sttr base64-encode | sttr md5
💥 Supported Operations #
- sttr base32-decode - Decode your base32 text
- sttr base32-encode - Encode your text to Base32
- sttr base64-decode - Decode your base64 text
- sttr base64-encode - Encode your text to Base64
- sttr bcrypt - Get the Bcrypt hash of your text
- sttr camel - Transform your text to CamelCase
- sttr completion - generate the autocompletion script for the specified shell
- sttr count-chars - Find the length of your text (including spaces)
- sttr count-lines - Count the number of lines in your text
- sttr count-words - Count the number of words in your text
- sttr extract-emails - Extract emails from given text
- sttr hex-encode - Encode your text Hex
- sttr hex-rgb - Convert a #hex-color code to RGB
- sttr html-decode - Unescape your HTML
- sttr html-encode - Escape your HTML
- sttr interactive - Use sttr in interactive mode
- sttr json - Format your text as JSON
- sttr json-yaml - Convert JSON to YAML text
- sttr kebab - Transform your text to kebab-case
- sttr lower - Transform your text to lower case
- sttr markdown-html - Convert Markdown to HTML
- sttr md5 - Get the MD5 checksum of your text
- sttr reverse - Reverse Text ( txeT esreveR )
- sttr rot13-encode - Encode your text to ROT13
- sttr sha1 - Get the SHA1 checksum of your text
- sttr sha256 - Get the SHA256 checksum of your text
- sttr sha512 - Get the SHA512 checksum of your text
- sttr slug - Transform your text to slug-case
- sttr snake - Transform your text to snake_case
- sttr sort-lines - Sort lines alphabetically
- sttr title - Transform your text to Title Case
- sttr upper - Transform your text to UPPER CASE
- sttr url-decode - Decode URL entities
- sttr url-encode - Encode URL entities
- sttr version - Print the version of sttr
- sttr yaml-json - Convert YAML to JSON text
- sttr zeropad - Pad a number with zeros
Contribution #
This project welcomes your PR and issues. For example, refactoring, adding features, correcting English, etc. If you need any help, you can contact me on Twitter.
Thanks to all the people who already contributed!