sttr
Website
| Install
| Getting Started
| CLI Reference
| Source Code
sttr
is command line software that allows you to quickly run various transformation operations on the string.
// With input prompt
sttr
// Direct string input
echo "Hello World" | sttr md5
// File input
cat file.txt | sttr base64-encode
// Writing output to a file
cat file.yml | sttr yaml-json > 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.
sttr -h
sttr zeropad -h
- Working with files input.
cat file-input.jpg | sttr base64-encode
cat words.txt | sttr count-chars > count.txt
- Taking input from other command.
curl https://jsonplaceholder.typicode.com/users | sttr json-yaml
- Chaining the different processor.
echo "Hello World" | sttr base64-encode | sttr md5
๐ฅ Supported Operations
- base32-decode - Decode your base32 text
- base32-encode - Encode your text to Base32
- base64-decode - Decode your base64 text
- base64-encode - Encode your text to Base64
- bcrypt - Get the Bcrypt hash of your text
- camel - Transform your text to CamelCase
- completion - generate the autocompletion script for the specified shell
- count-chars - Find the length of your text (including spaces)
- count-lines - Count the number of lines in your text
- count-words - Count the number of words in your text
- extract-emails - Extract emails from given text
- hex-encode - Encode your text Hex
- hex-rgb - Convert a #hex-color code to RGB
- html-decode - Unescape your HTML
- html-encode - Escape your HTML
- interactive - Use sttr in interactive mode
- json - Format your text as JSON
- json-yaml - Convert JSON to YAML text
- kebab - Transform your text to kebab-case
- lower - Transform your text to lower case
- markdown-html - Convert Markdown to HTML
- md5 - Get the MD5 checksum of your text
- reverse - Reverse Text ( txeT esreveR )
- rot13-encode - Encode your text to ROT13
- sha1 - Get the SHA1 checksum of your text
- sha256 - Get the SHA256 checksum of your text
- sha512 - Get the SHA512 checksum of your text
- slug - Transform your text to slug-case
- snake - Transform your text to snake_case
- sort-lines - Sort lines alphabetically
- title - Transform your text to Title Case
- upper - Transform your text to UPPER CASE
- url-decode - Decode URL entities
- url-encode - Encode URL entities
- version - Print the version of sttr
- yaml-json - Convert YAML to JSON text
- zeropad - Pad a number with zeros
- and adding more....
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!
License
MIT