Skip to content

Commit 1a4f454

Browse files
committed
feat: add tvz command alias
Add a second Cargo binary target named tvz that shares the same CLI implementation as termviz. Document the alias, cover it in CLI and release verification, and include both binaries in release artifacts.
1 parent b85d827 commit 1a4f454

11 files changed

Lines changed: 58 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,12 @@ jobs:
3434
with:
3535
components: rustfmt
3636
- run: cargo build --locked --release
37-
- name: Package Linux release binary
37+
- name: Package Linux release binaries
3838
run: |
3939
mkdir -p target/release/dist
4040
cp target/release/termviz target/release/dist/termviz
41-
tar -czf "termviz-linux-x86_64.tar.gz" -C target/release/dist termviz
41+
cp target/release/tvz target/release/dist/tvz
42+
tar -czf "termviz-linux-x86_64.tar.gz" -C target/release/dist termviz tvz
4243
sha256sum "termviz-linux-x86_64.tar.gz" > "termviz-linux-x86_64.tar.gz.sha256"
4344
- uses: actions/upload-artifact@v4
4445
with:

.github/workflows/release.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,28 @@ jobs:
5959
- run: cargo clippy --all-targets --locked -- -D warnings
6060
- run: cargo build --release --locked --target "$LINUX_X64_TARGET"
6161

62-
- name: Package Linux x64 static binary
62+
- name: Package Linux x64 static binaries
6363
shell: bash
6464
run: |
6565
set -euo pipefail
6666
mkdir -p dist/termviz-linux-x64
6767
cp "target/$LINUX_X64_TARGET/release/termviz" dist/termviz-linux-x64/
68+
cp "target/$LINUX_X64_TARGET/release/tvz" dist/termviz-linux-x64/
6869
cp "target/$LINUX_X64_TARGET/release/termviz" dist/termviz
70+
cp "target/$LINUX_X64_TARGET/release/tvz" dist/tvz
6971
cp README.md LICENSE dist/termviz-linux-x64/
7072
file dist/termviz-linux-x64/termviz
73+
file dist/termviz-linux-x64/tvz
7174
if readelf -l dist/termviz-linux-x64/termviz | grep -q "Requesting program interpreter"; then
7275
echo "Expected a static Linux x64 binary without a glibc runtime dependency." >&2
7376
exit 1
7477
fi
78+
if readelf -l dist/termviz-linux-x64/tvz | grep -q "Requesting program interpreter"; then
79+
echo "Expected a static Linux x64 alias binary without a glibc runtime dependency." >&2
80+
exit 1
81+
fi
7582
dist/termviz-linux-x64/termviz --version
83+
dist/termviz-linux-x64/tvz --version
7684
tar -C dist -czf "dist/termviz-linux-x64.tar.gz" termviz-linux-x64
7785
7886
- uses: actions/upload-artifact@v7
@@ -81,6 +89,7 @@ jobs:
8189
path: |
8290
dist/termviz-linux-x64.tar.gz
8391
dist/termviz
92+
dist/tvz
8493
8594
github-release:
8695
runs-on: ubuntu-latest

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ matching `## [X.Y.Z]` section before the release tag is pushed.
88

99
## [Unreleased]
1010

11+
### Added
12+
13+
- Add `tvz` as a short CLI alias installed alongside the existing `termviz`
14+
command.
15+
1116
### Changed
1217

1318
- Remove unused terminal palette/layout modules and keep test-only dependencies

Cargo.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ keywords = ["terminal", "image", "plot", "viewer", "cli"]
1111
categories = ["command-line-utilities", "visualization"]
1212
exclude = [".github/"]
1313

14+
[[bin]]
15+
name = "termviz"
16+
path = "src/bin/termviz.rs"
17+
18+
[[bin]]
19+
name = "tvz"
20+
path = "src/bin/tvz.rs"
21+
1422
[dependencies]
1523
ab_glyph = "0.2.32"
1624
anyhow = "1.0.102"

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ Install with Cargo:
1414
cargo install --git https://github.com/siriusctrl/termviz
1515
```
1616

17+
This installs both the full command and the short alias:
18+
19+
```sh
20+
termviz --version
21+
tvz --version
22+
```
23+
1724
To install a tagged version:
1825

1926
```sh
@@ -22,6 +29,7 @@ cargo install --git https://github.com/siriusctrl/termviz --tag v0.2.3
2229

2330
```sh
2431
termviz image.png
32+
tvz image.png
2533
termviz image.png --inspect
2634
termviz image.png > frame.png
2735
termviz image.png --output-format ansi > preview.ansi

docs/INDEX.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ Read these when the task matches:
3636

3737
Code orientation:
3838

39-
- `src/main.rs` is the thin binary entry point.
39+
- `src/bin/termviz.rs` and `src/bin/tvz.rs` are thin binary entry points for
40+
the full command and short alias.
4041
- `src/lib.rs` exposes the internal modules used by the binary and tests.
4142
- `src/cli.rs` wires CLI arguments to input profile detection, inspection,
4243
export, and viewer dispatch.

docs/releasing.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,10 @@ Before publishing:
7676
## Release Artifacts
7777

7878
Release artifacts are a Linux x64 static binary tarball plus SHA-256 checksum.
79-
The release workflow verifies that the binary has no glibc runtime interpreter
80-
before packaging, so Linux x64 users can download a self-contained CLI from the
81-
GitHub Release page.
79+
The tarball contains both `termviz` and the `tvz` short alias. The release
80+
workflow verifies that neither binary has a glibc runtime interpreter before
81+
packaging, so Linux x64 users can download a self-contained CLI from the GitHub
82+
Release page.
8283

8384
## Install From Git
8485

@@ -87,6 +88,7 @@ The supported package-manager-free install path is Cargo from GitHub:
8788
```sh
8889
cargo install --git https://github.com/siriusctrl/termviz --tag vX.Y.Z
8990
termviz --version
91+
tvz --version
9092
```
9193

9294
For local validation before tagging, run `scripts/release-verify.sh`. The script

scripts/release-verify.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ cargo package --locked --allow-dirty
2020
printf 'Building release binary for smoke checks...\n'
2121
cargo build --quiet --locked --release
2222
BIN="${REPO_ROOT}/target/release/termviz"
23+
SHORT_BIN="${REPO_ROOT}/target/release/tvz"
2324

2425
tmp_dir="$(mktemp -d)"
2526
trap 'rm -rf "$tmp_dir"' EXIT
@@ -34,6 +35,9 @@ EOF
3435

3536
printf 'Running CLI smoke checks...\n'
3637

38+
"$BIN" --version | grep -q "termviz"
39+
"$SHORT_BIN" --version | grep -q "termviz"
40+
3741
"$BIN" examples/inspect-square.png --inspect > "${tmp_dir}/inspect-png.out"
3842
grep -q "content=Png" "${tmp_dir}/inspect-png.out"
3943
grep -q "shape=RasterImage" "${tmp_dir}/inspect-png.out"
File renamed without changes.

src/bin/tvz.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() -> anyhow::Result<()> {
2+
termviz::cli::run()
3+
}

0 commit comments

Comments
 (0)