https://github.com/ksxgithub/strip-ansi-cli
Strip ANSI escape sequences from text
https://github.com/ksxgithub/strip-ansi-cli
ansi-colors cli color escape escape-sequences strip-ansi
Last synced: 5 months ago
JSON representation
Strip ANSI escape sequences from text
- Host: GitHub
- URL: https://github.com/ksxgithub/strip-ansi-cli
- Owner: KSXGitHub
- License: mit
- Created: 2020-09-11T06:36:05.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2025-02-17T05:30:51.000Z (8 months ago)
- Last Synced: 2025-04-16T06:20:18.519Z (6 months ago)
- Topics: ansi-colors, cli, color, escape, escape-sequences, strip-ansi
- Language: Shell
- Homepage:
- Size: 103 KB
- Stars: 10
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# strip-ansi-cli
[](https://github.com/KSXGitHub/strip-ansi-cli/actions?query=workflow%3ATest)
[](https://crates.io/crates/strip-ansi-cli)Strip ANSI escape sequences from text.
## Usage
### Stdin as input
```sh
ls --color=always | strip-ansi
```### Argument as input
```sh
strip-ansi "$(ls --color=always)"
```### Print help message
```sh
strip-ansi --help
```## Installation
### Manually build from source
1. Make sure to have `cargo` and `rustc` installed. If not, you may install it using [rustup](https://rustup.rs/).
2. Clone this repository.
3. Run `cargo build --release --locked` in the repo root.
4. The binary should be created at `$REPO_DIR/target/release/strip-ansi`.
### Manually download prebuilt binary
Go to [the Release Page](https://github.com/KSXGitHub/strip-ansi-cli/releases) and find file whose name contains `strip-ansi` and your platform name.
### From [Crates.io](https://crates.io/crates/strip-ansi-cli)
```sh
cargo install strip-ansi-cli
```### From the [Arch User Repository](https://aur.archlinux.org)
#### [Build from source](https://aur.archlinux.org/packages/strip-ansi)
```sh
yay -S strip-ansi
```#### [Prebuilt binary](https://aur.archlinux.org/packages/strip-ansi-bin)
```sh
yay -Ss strip-ansi-bin
```## License
[MIT](https://git.io/JUWVF) © [Hoàng Văn Khải](https://github.com/KSXGitHub/)