| Crates.io | ansi-senor |
| lib.rs | ansi-senor |
| version | 0.1.4 |
| created_at | 2025-10-30 09:35:42.101755+00 |
| updated_at | 2026-01-24 09:20:57.627561+00 |
| description | Run commands with ANSI color output captured to HTML |
| homepage | |
| repository | https://github.com/schacon/ansi-senor |
| max_upload_size | |
| id | 1907878 |
| size | 25,784 |
This is a simple Rust binary that will run whatever command you specify next with CLICOLOR_FORCE=1 automatically exported, then both show the output and also capture it in a buffer file, then run an ansi2html conversion that then writes an html file with the output with proper ansi coloring to an output file specified.
$ ansi-senor git status
---
❯ git status took 9h4m23s
On branch gitbutler/workspace
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: content/2025/2025-11-05-gitbutler-cli.mdx
no changes added to commit (use "git add" and/or "git commit -a")
---
Output saved to /tmp/ansi-senor/git-status-fedd38ae.html
-o, --output <file-path.html> - Specify a custom output file path-t, --theme <light|dark> - Choose the color theme for HTML output (default: dark)# Use light theme
ansi-senor --theme light git status
# Specify output file and theme
ansi-senor -o output.html -t light ls -la
# Short form
ansi-senor -t light git diff
To build the project in debug mode:
cargo build
To build an optimized release version:
cargo build --release
The compiled binary will be located at:
target/debug/ansi-senortarget/release/ansi-senorThe easiest way to install ansi-senor is from crates.io:
cargo install ansi-senor
This will download, compile, and install the binary to your Cargo bin directory (~/.cargo/bin), making the ansi-senor command available system-wide (assuming ~/.cargo/bin is in your PATH).
Alternatively, you can install from source by cloning this repository:
cargo install --path .
cargo run -- <command>
For example:
cargo run -- git status
cargo run -- ls -la
After building:
./target/debug/ansi-senor <command>
# or
./target/release/ansi-senor <command>
After installing:
ansi-senor <command>