cross-platform, cli app to perform various operations on string

Overview

sttr

sttr

sttr is command line software that allows you to quickly run various transformation operations on the string.

// With input prompt
sttr

// Direct string input
sttr -i "your string"

🎥 Demo

sttr 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.
// With input prompt

sttr 
// ( Press two enter to open operation menu )

// You can also provide string directly without any prompt.
sttr -i "your string"
  • Press / to filter various operations.
  • Can also press UP-Down arrows select various operations.

💥 Supported Operations

  • Base64 Encode
  • Base64 Decode
  • URL Encode
  • URL Decode
  • ROT13 Encode
  • String To Title
  • String To lower
  • String To UPPER
  • String To snake_case
  • String To Kebab
  • String To Slug
  • String To Camel
  • String Reverse
  • Count Number Characters
  • Count Words
  • Count Lines
  • MD5 Encode
  • SHA1 Encode
  • SHA256 Encode
  • SHA512 Encode
  • Format JSON
  • JSON To YAML
  • YAML To JSON
  • Hex To RGB
  • Sort Lines
  • and adding more....

License

MIT

Issues
  • Read files

    Read files

    Adds support for input files. The argument will be checked if it is a file and in that case, it will be read and used as input.

    In addition, a default flag is set for the processors so that they can react differently to the input.

    I noticed that the hash functions give different outputs when you pipe the input.

    > echo "Hello World" | sttr md5
    e59ff97941044f85df5297e1c302d260
    
    > sttr "Hello World"
    b10a8db164e0754105b7a99be72e3fe5
    

    In the first case, a linefeed is passed with the echo command. I have implemented this so that if the input does not come from a file, the trailing line breaks are removed from the input. I think for simple, single-line inputs, you usually don't want the newline passed into the hash function.

    opened by rverst 4
  • Support for macOS with M1 chips.

    Support for macOS with M1 chips.

    Currently unable to follow the installation guide for installation on macOS 12.1 with Apple M1 because of the following error:

    Error: Invalid formula: /opt/homebrew/Library/Taps/abhimanyu003/homebrew-sttr/Formula/sttr.rb
    formulae require at least a URL
    Error: Cannot tap abhimanyu003/sttr: invalid syntax in tap!
    

    I suppose the error stems from this part in the formulae which seems to support only Intel chips?:

    on_macos do
        if Hardware::CPU.intel?
          url "https://github.com/abhimanyu003/sttr/releases/download/v0.2.11/sttr_0.2.11_darwin_amd64.tar.gz"
          sha256 "37f720259894838ccbebf2d2491305f05be47daf3f2a509b2f0b5b06a3f1811f"
    
          def install
            bin.install "sttr"
          end
        end
      end
    
    opened by hoanghun 2
  • Broken due to processor sort line change

    Broken due to processor sort line change

    @abhimanyu003

    go/pkg/mod/github.com/abhimanyu003/[email protected]/cmd/processor_sort-lines.go:40:25

    This just happened in the last hour when I was repulling it into a new project.

    This version works: go install github.com/abhimanyu003/[email protected], everything after this fails.

    Suggest that might be a good github action for post-merge to flag an install failure

    opened by sheldonhull 1
  • Read files

    Read files

    • Adds the ability to read files directly. If the first argument is a file, its content is used as the input (like in tools like cat etc.).
    • Changed the parameter type for the transform function to []byte to support building checksums of binary files.
    • Unified the naming of the 1st parameter of the transform function, was a mix out of input and data.

    I used the file-reading on the README.md, the sttr binary itself and the lazygit binary (commit=50e2ba542264937ead2b9f914c0605acb1ef7924, build date=2021-06-01T16:08:11Z, build source=binaryRelease, version=v0.28.1-next, os=darwin, arch=amd64) and compared it with the results of the tools md5 and shasum (macOS): Screenshot 2021-10-01 at 21 22 13

    opened by rverst 1
  • Improve template

    Improve template

    This PR improves the template for the generated commands. The timestamp is removed to avoid unnecessary changes when (re)generating the files.

    Unfortunately, there are still a few (annoying) trailing tabs in the commands with flags.

    opened by rverst 1
  • Fix character counting

    Fix character counting

    This update fixes character counting, which was previously returning the number of bytes rather than the number of runes.

    For reference, note that with Latin one character is generally one byte, however other unicode characters (such as East-Asian characters and emojis) can have multiple bytes per character.

    |String|Chars|Bytes| |-|-|-| |hi|2|2| |你好|2|6|

    Example: https://play.golang.org/p/hWrTqV9HxWb

    opened by meowgorithm 1
  • Suggestion: add possibility to process the texts directly

    Suggestion: add possibility to process the texts directly

    I would like to see a flag that makes it possible to process the texts directly, without going through the menu. I think this would be quite useful to use the tool e.g. in scripts.

    enhancement 
    opened by rverst 1
  • Add license scan report and status

    Add license scan report and status

    Your FOSSA integration was successful! Attached in this PR is a badge and license report to track scan status in your README.

    Below are docs for integrating FOSSA license checks into your CI:

    opened by fossabot 0
  • Add: Test cases for base command and alias

    Add: Test cases for base command and alias

    Added test cases for command.

    • alias
    • description
    • filterValue
    • flags
    • name
    • title.

    During this, I found that one command alias was not correct.

    PS: I will add more if the format is looking okay.

    opened by abhimanyu003 0
  • add the capability to add padding for the hash traqnsformations (md5, ...)

    add the capability to add padding for the hash traqnsformations (md5, ...)

    an overview of standardized paddings is here https://en.wikipedia.org/wiki/Padding_%28cryptography%29

    i saw the for 0.2 zero-padding has been merged

    this enhancement request would rely upon that capability

    enhancement 
    opened by terefang 8
Releases(v0.2.12)
Owner
Abhimanyu Sharma
Software Developer @rackspace
Abhimanyu Sharma
Tnbassist - A CLI tool for thenewboston blockchain to perform various mundane tasks like taking daily accounts backup

TNB Assist is a CLI (Command Line Interface) tool for thenewboston blockchain to perform various mundane tasks like taking daily accounts backup, computing statistics, etc easier.

Open blockchain explorer 1 Feb 14, 2022
ntest is a cross-platform cli app that runs multiple tests against any address.

ntest ntest is a cross-platform cli app that runs multiple tests against any address. About ntest Having the ability to run common tests against any d

Bruno Schaatsbergen 13 Jan 3, 2022
This is a Go Cli app that receives an string path to a log file, and based on it generates and prints in console an encoded polyline with the locations found in the log file.

GEOENCODE GO CLI APP DESCRIPTION This is a Go Cli app that receives an string path to a log file, and based on it generates and prints in console an e

Jose Luis Ojeda 1 Oct 1, 2021
🚤 Cross-platform, unofficial CLI for Cloudflare Warp

wgcf is an unofficial, cross-platform CLI for Cloudflare Warp

Victor 1.9k Jul 2, 2022
CLI tool for CIDR range operations (check, generate)

cidrchk A CLI tool to assist you with CIDR ranges and IPs. Install it You can download the latest binary for Linux (Intel and Arm), macOS, and Windows

Michael Hausenblas 129 Jun 23, 2022
Vaku is a CLI and API for running path- and folder-based operations on the Vault Key/Value secrets engine.

Vaku Vaku is a CLI and API for running path- and folder-based operations on the Vault Key/Value secrets engine. Vaku extends the existing Vault CLI an

Sean Lingren 136 Jun 24, 2022
CLI and web app to convert HTML markup to go-app.dev's syntax.

HTML to go-app Converter CLI and web app to convert HTML markup to go-app.dev's syntax. Installation CLI Static binaries are also available on GitHub

Felix Pojtinger 8 May 28, 2022
Query git repositories with SQL. Generate reports, perform status checks, analyze codebases. 🔍 📊

askgit is a command-line tool for running SQL queries on git repositories. It's meant for ad-hoc querying of git repositories on disk through a common interface (SQL), as an alternative to patching together various shell commands.

AskGit 3.1k Jun 30, 2022
A simple logging interface that supports cross-platform color and concurrency.

WLog Package wlog creates simple to use UI structure. The UI is used to simply print to the screen. There a wrappers that will wrap each other to crea

Will Dixon 57 May 31, 2022
cross platform command line tool to list, notify and book vaccine using cowin API

Command line tool to List and Book Vaccine cowin-cli is a simple cli tool to book vaccines and list centers using the COWIN API. It also supports auto

Anoop S 35 Mar 7, 2022
🐘 Cross-platform, neofetch alternative for fetching system info.

elefetch ?? Cross-platform, neofetch alternative for fetching system info. Installation go get: go get -u github.com/burntcarrot/elefetch Binaries Bin

Aadhav Vignesh 1 Jan 23, 2022
F2 is a cross-platform command-line tool for batch renaming files and directories quickly and safely. Written in Go!

F2 is a cross-platform command-line tool for batch renaming files and directories quickly and safely.

Ayooluwa 478 Jul 5, 2022
Battery - cross-platform get battery status

battery Cross-platform get battery status. Tested on Arch Linux, Debian, Ubuntu, Windows, macOS. import "github.com/caiguanhao/battery" battery.GetSt

CGH 0 Dec 31, 2021
A small CLI tool to check connection from a local machine to a remote target in various protocols.

CHK chk is a small CLI tool to check connection from a local machine to a remote target in various protocols.

null 25 Mar 30, 2022
A golang CLI to display various stats about Hockey teams and their players

A golang CLI to display various stats about Hockey teams and their players

Jonathan Mainguy 1 Oct 26, 2021
A very basic cli keyring tool to use accross various OS.

A very basic cli keyring tool to use accross various OS.

Vianney Bouchaud 2 Feb 27, 2022
Powerful CLI written in GO to generate projects in various technologies

Barca CLI is a project generator written in GO and its purpose is to build and configure HTTP servers, web proxy, SPA/PWA, Blog and custom landing page. It's easy, fast and productive.

Barca 1 Jun 3, 2022
Various CLI tools in go

tools A collection of small command line utilities: hxd - a small hexdumper imgsize - show sizes of jpeg or png images kwed-dl - download latest track

Brian Schau 0 Mar 10, 2022
The blackbean is a command tool for elasticsearch operations by using cobra.

The blackbean is a command tool for elasticsearch operations by using cobra. Besides, blackbean is the name of my lovely French bulldog.

null 23 Mar 3, 2022