Skip to content

About

Cyber Swiss Army Knife in Terminal

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

cyberchef-tui

A fast, keyboard-driven terminal UI for everyday data conversions (Base64, hex, hashes, JSON, gzip and more), built on Go ports of the algorithms in GCHQ's CyberChef.

cyberchef-tui screenshot

  • Live output. Results update as you type, and switching operations re-runs instantly.
  • Fuzzy filter. Press / and type b64d or sha5 to jump straight to an operation.
  • Chaining. ctrl+r moves the output into the input, so you can decode, then decode again.
  • Clipboard. ctrl+y copies the output; it works locally and over SSH (OSC 52).
  • Adaptive theme. Separate palettes for light and dark terminals.
  • Single static binary for Linux, macOS and Windows.

Installation

Install script (Linux and macOS)

curl -fsSL https://raw.githubusercontent.com/user3301/cyberchef-tui/main/install.sh | sh

The script downloads the right archive from the latest release, checks it against checksums.txt, and installs cyberchef-tui to /usr/local/bin. If that directory needs sudo and sudo isn't available, it installs to ~/.local/bin instead. You can override both:

curl -fsSL https://raw.githubusercontent.com/user3301/cyberchef-tui/main/install.sh \
  | CYBERCHEF_TUI_VERSION=v0.1.0 CYBERCHEF_TUI_INSTALL_DIR="$HOME/bin" sh

With Go

Requires Go 1.25 or later. Go 1.21+ downloads a newer toolchain automatically.

go install github.com/user3301/cyberchef-tui@latest

This puts cyberchef-tui in $(go env GOPATH)/bin. Make sure that directory is on your PATH.

Pre-built binaries

Download an archive for your platform (including Windows) from the releases page, extract it, and put cyberchef-tui somewhere on your PATH.

From source

git clone https://github.com/user3301/cyberchef-tui.git
cd cyberchef-tui
go build -o cyberchef-tui .
./cyberchef-tui

Check the install with cyberchef-tui --version.

Usage

Run cyberchef-tui. The screen has three panes: Operations on the left, and Input and Output on the right. tab and shift+tab move focus between them; the focused pane has a highlighted border.

  1. Pick an operation with ↑/↓ (or j/k), or press / to filter.
  2. Press enter to jump to the input pane, then type or paste.
  3. The output updates as you type. Press ctrl+y to copy it.

Keys

Where Key Action
Anywhere tab / shift+tab Next / previous pane
ctrl+y Copy output to clipboard
ctrl+r Replace input with output (chain operations)
ctrl+l Clear input
ctrl+c Quit
Operations ↑ ↓ / k j Select operation (output updates live)
g / G First / last operation
/ Fuzzy filter (enter to use, esc to clear)
enter Edit input
? Show all keys
q Quit
Input esc Back to operations
ctrl+v Paste (bracketed paste also works)
Output ↑ ↓ pgup pgdn Scroll
y / c Copy output
esc Back to operations

Non-printable bytes in the output are drawn as control pictures (␀, ␛, …) or �, much like CyberChef. Copying always uses the raw bytes.

Operations

Category Operation Notes
Encoding Base64 Encode / Decode Standard alphabet
Base32 Encode / Decode RFC 4648
Hex Encode / Decode Space-separated on encode
URL Encode / Decode Percent-encoding
Hashing MD5, SHA1, SHA256, SHA512 Hex digest
Data XOR Key 0x42, output as hex
JSON Beautify / Minify
Gzip Compress Output is Base64
Gzip Decompress Input is Base64

Go library

The conversions are also available as a Go package:

go get github.com/user3301/cyberchef-tui/cyberchef
import "github.com/user3301/cyberchef-tui/cyberchef"

encoded, _ := cyberchef.ToBase64([]byte("hello"), cyberchef.Base64Standard) // "aGVsbG8="
digest := cyberchef.SHA256([]byte("hello world"))

See docs/QUICK_REFERENCE.md and docs/OPERATIONS.md for the full API, and examples/main.go for a runnable tour (go run ./examples).

Development

go test ./...          # library and TUI tests
go run .               # run the TUI from source

The project is laid out as follows:

main.go          entrypoint (flags, version)
internal/tui/    Bubble Tea interface: model, view, theme, keys, operation registry
cyberchef/       conversion library
examples/        library usage examples

To add an operation, implement it in cyberchef/ and add an entry to the operations slice in internal/tui/operations.go.

Releasing

Pushing a v* tag triggers GoReleaser via GitHub Actions (.github/workflows/release.yml). It builds archives for Linux, macOS and Windows (amd64 and arm64) and publishes them with a checksums.txt. The install script and go install …@latest both pick up the new release.

git tag v0.1.0
git push origin v0.1.0

To try a release build locally, run goreleaser release --snapshot --clean; the output goes to dist/.

About

Cyber Swiss Army Knife in Terminal

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages