# Sttr | Cross-Platform, Cli App To Perform Various Operations On String

**URL:** <https://onehack.st/t/sttr-cross-platform-cli-app-to-perform-various-operations-on-string/284727>\
**Category:** Tools & Scripts\
**Tags:** tools, programming, hacking, freebies\
**Created:** [June 15, 2024, 8:49pm UTC](https://onehack.st/t/sttr-cross-platform-cli-app-to-perform-various-operations-on-string/284727 "2024-06-15T20:49:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![PlayBoy83](https://onehack.st/user_avatar/onehack.st/playboy83/32/164314_2.png) [@PlayBoy83](https://onehack.st/u/PlayBoy83)\
**Post date:** [June 15, 2024, 8:49pm UTC](https://onehack.st/t/sttr-cross-platform-cli-app-to-perform-various-operations-on-string/284727/1 "2024-06-15T20:49:52Z")

</div>

![image](https://onehack.st/uploads/default/original/3X/6/9/69da477b1ea6d62bddbbc0a9e90e0799a113fc0c.png)

# sttr

[Website](https://abhimanyu003.github.io/sttr/) | [Install](https://github.com/abhimanyu003/sttr#battery-installation) | [Getting Started](https://github.com/abhimanyu003/sttr#books-guide) | [CLI Reference](https://abhimanyu003.github.io/sttr/cli/sttr/) | [Source Code](https://github.com/abhimanyu003/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

[![sttr demo](https://github.com/abhimanyu003/sttr/raw/main/media/demo.gif)](https://github.com/abhimanyu003/sttr/blob/main/media/demo.gif)

# 🔋 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](https://raw.githubusercontent.com/abhimanyu003/sttr/main/install.sh) | sh

#### Webi

**macOS / Linux**

curl -sS [https://webi.sh/sttr](https://webi.sh/sttr) | sh

**Windows**

curl.exe [https://webi.ms/sttr](https://webi.ms/sttr) | powershell

See [here](https://webinstall.dev/sttr/)

#### Homebrew

If you are on macOS and using Homebrew, you can install `sttr` with the following:

brew tap abhimanyu003/sttr brew install sttr

#### Snap

sudo snap install sttr

#### Arch Linux

yay -S sttr-bin

#### Scoop

```auto
scoop bucket add sttr https://github.com/abhimanyu003/scoop-bucket.git
scoop install sttr

```

#### Go

go install [github.com/abhimanyu003/sttr@latest](http://github.com/abhimanyu003/sttr@latest)

#### Manually

Download the pre-compiled binaries from the [Release!](https://github.com/abhimanyu003/sttr/releases) 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](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

#### Encode/Decode

- **ascii85-encode** - Encode your text to Ascii85
- **ascii85-decode** - Decode your Ascii85 text
- **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
- **base85-encode** - Encode your text to Base85
- **base85-decode** - Decode your Base85 text
- **base64url-decode** - Decode your Base64 URL
- **base64url-encode** - Encode your text to URL
- **html-decode** - Unescape your HTML
- **html-encode** - Escape your HTML
- **rot13-encode** - Encode your text to ROT13
- **url-decode** - Decode URL entities
- **url-encode** - Encode URL entities

#### Hash

- **bcrypt** - Get the bcrypt hash of your text
- **md5** - Get the MD5 checksum of your text
- **sha1** - Get the SHA1 checksum of your text
- **sha256** - Get the SHA256 checksum of your text
- **sha512** - Get the SHA512 checksum of your text

#### String

- **camel** - Transform your text to CamelCase
- **kebab** - Transform your text to kebab-case
- **lower** - Transform your text to lower case
- **reverse** - Reverse Text ( txeT esreveR )
- **slug** - Transform your text to slug-case
- **snake** - Transform your text to snake\_case
- **title** - Transform your text to Title Case
- **upper** - Transform your text to UPPER CASE

#### Lines

- **count-lines** - Count the number of lines in your text
- **reverse-lines** - Reverse lines
- **shuffle-lines** - Shuffle lines randomly
- **sort-lines** - Sort lines alphabetically
- **unique-lines** - Get unique lines from list

#### Spaces

- **remove-spaces** - Remove all spaces + new lines
- **remove-newlines** - Remove all new lines

#### Count

- **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

#### RGB/Hex

- **hex-rgb** - Convert a #hex-color code to RGB
- **hex-encode** - Encode your text Hex
- **hex-decode** - Convert Hexadecimal to String

#### JSON

- **json** - Format your text as JSON
- **json-escape** - JSON Escape
- **json-unescape** - JSON Unescape
- **json-yaml** - Convert JSON to YAML text
- **json-msgpack** - Convert JSON to MSGPACK
- **msgpack-json** - Convert MSGPACK to JSON

#### YAML

- **yaml-json** - Convert YAML to JSON text

#### Markdown

- **markdown-html** - Convert Markdown to HTML

#### Extract

- **extract-emails** - Extract emails from given text
- **extract-ip** - Extract IPv4 and IPv6 from your text
- **extract-urls** - Extract URLs your text ( we don’t do ping check )

#### Other

- **escape-quotes** - escape single and double quotes from your text
- **completion** - generate the autocompletion script for the specified shell
- **interactive** - Use sttr in interactive mode
- **version** - Print the version of sttr
- **zeropad** - Pad a number with zeros
- **and adding more…**

# Featured On

These are the few locations where `sttr` was highlighted, many thanks to all of you. Please feel free to add any blogs/videos you may have made that discuss `sttr` to the list.

- [YouTube: The Giants of Open Source - DevOps Paradox](https://youtu.be/4nFRKbY_HVE?t=2529?ref=abhimanyu003/sttr)
- [Terminal Trove - Tool of the Week](https://terminaltrove.com/sttr/?ref=abhimanyu003/sttr)
- [nixCraft](https://www.cyberciti.biz/open-source/sttr-awesome-linux-unix-command-tool-for-transformation-string/?ref=abhimanyu003/sttr)

## GitHub:

> **[GitHub - abhimanyu003/sttr: cross-platform, cli app to perform various...](https://github.com/abhimanyu003/sttr)**
>
> cross-platform, cli app to perform various operations on string
