https://github.com/gartenschlaeger/strcli
CLI tool str written in Go.
https://github.com/gartenschlaeger/strcli
go go-cli vscode
Last synced: about 1 month ago
JSON representation
CLI tool str written in Go.
- Host: GitHub
- URL: https://github.com/gartenschlaeger/strcli
- Owner: Gartenschlaeger
- Created: 2023-02-28T22:28:28.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-11T14:09:22.000Z (almost 3 years ago)
- Last Synced: 2025-02-14T21:47:44.224Z (about 1 year ago)
- Topics: go, go-cli, vscode
- Language: Go
- Homepage:
- Size: 70.3 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CLI tool str
[](https://github.com/Gartenschlaeger/strcli/actions/workflows/build.yml)
CLI tool `str` performs common string operations in an easy way.
_Example:_
```sh
# returns "Doe"
echo "John Doe" | str field -i1
```
_`str` works with standard input/output, so you can easily perform multiple operations in a chain:_
```sh
# returns a random string with 10 characters
echo "abcdefghijklmnopqrstuvwxyz0123456789" | str shuffle | str sub -l10
```
Regular expressions are also supported:
```sh
# returns 2023
echo "2023-10-11" | str regex -p"(\d{4})-(\d{2})-(\d{2})" -g1
```
```sh
# returns He__o wor_d!
echo "Hello world\!" | str regex -p"l" -r"_"
```
# Installation
Currently the app has not been added to any package manager.
If you want to use the app, clone the repository and run `make install`.
> The `make install` command may not work on windows systems.
> In this case you can also run make build and copy the binary in dist directory manually.
# Contribution
Since I do not know or can guess all use cases, it is difficult to implement all commands.
If you have a use case or a good idea for a command, feel free to suggest it as an issue.
Of course, pull requests are always welcome.