AI News HubLIVE
站内改写3 min read

Asd: A fast, AI-native cat replacement written in Go

asd is a smart universal file viewer for the modern terminal that replaces traditional cat with intelligent file type detection and beautiful rendering. It supports syntax highlighting, structured data formatting, tables, Markdown, archives, office docs, PDFs, media metadata, certificate parsing, Git integration, tail mode, side-by-side diffing, and more.

SourceHacker News AIAuthor: vsmanu

Notifications You must be signed in to change notification settings

Fork 0

Star 0

BranchesTags

Open more actions menu

Folders and files

NameName

Last commit message

Last commit date

Latest commit

History

25 Commits

25 Commits

.antigravitycli

.antigravitycli

.github/workflows

.github/workflows

assets

assets

cmd

cmd

config

config

detect

detect

dist

dist

errors

errors

exec

exec

handlers

handlers

internal/testutil

internal/testutil

pager

pager

registry

registry

render

render

testdata

testdata

.gitignore

.gitignore

.golangci.yaml

.golangci.yaml

.goreleaser.yaml

.goreleaser.yaml

.mise.toml

.mise.toml

CHANGELOG.md

CHANGELOG.md

Makefile

Makefile

README.md

README.md

RELEASE_NOTES.md

RELEASE_NOTES.md

a.txt

a.txt

b.txt

b.txt

cert.pem

cert.pem

demo.tape

demo.tape

go.mod

go.mod

go.sum

go.sum

key.pem

key.pem

main.go

main.go

main_test.go

main_test.go

test.db

test.db

test.ipynb

test.ipynb

test.log

test.log

test_new.txt

test_new.txt

Repository files navigation

A smart universal file viewer for the modern terminal.

asd replaces traditional tools like cat with smart, type-aware file rendering. By automatically detecting file types via magic bytes (and falling back to extensions), asd formats and renders them with beautiful syntax highlighting, layout tables, tree views, and media metadata.

When you output more text than your terminal can fit, asd instantly buffers into an interactive pager. If you pipe the output to another tool, it smartly defaults back to raw bytes (behaving exactly like cat).

🚀 Features

Code & Text: Beautiful syntax highlighting using Chroma, with line numbers and theme support.

Structured Data: JSON, YAML, TOML formatting and valid syntax checking.

Data Tables: CSV and TSV formatted into beautiful, auto-sizing terminal tables via Lipgloss.

Markdown: Fully styled Markdown rendering using Glamour.

Archives: Explores zip, tar, tar.gz, 7z, and rar as interactive directory trees showing uncompressed stats.

Office Docs & PDF: Automatically extracts and parses text from DOCX, XLSX, PPTX, ODT, and PDFs without you needing to extract them manually!

Media: Peeks into Audio and Video files to reveal track metadata, codecs, and durations. Images are rendered natively in your terminal! Enjoy pixel-perfect inline images on modern terminals like iTerm2, WezTerm, and Ghostty, or elegantly scaled true-color ANSI blocks on all standard terminals.

Security: Displays X.509 PEM/CRT properties and SSH Key parameters effortlessly.

Git Integration: Built-in gutter diffs show added, modified, and removed lines instantly!

Tail/Follow Mode: Use asd -F to tail streaming logs with full real-time syntax highlighting.

Log Formatting: Intelligent, on-the-fly parsing and beautiful colorization of log files (.log, /var/log/*, etc) formatting timestamps and log levels neatly!

Side-by-Side Diffing: Use asd --diff for a beautiful side-by-side terminal diff view.

Certificate Parsing: Peek into .pem, .crt, and .der files to automatically parse X.509 certificates and read their metadata (Issuer, Subject, Validity) just like openssl x509 -text!

UI Customization: Use --clean to hide headers and line numbers for clean copying, or --no-pager to disable auto-paging.

Smart Piped Input: Pass curl payloads directly into asd; it automatically detects the content type and highlights the piped output!

Directories: View styled ls -la directory trees and resolve symlinks.

Hex Dump: Safely view unknown binaries with built-in hex-dumping.

📦 Installation

Using Homebrew (macOS/Linux)

brew tap orchestrator-dev/asd
brew install asd

Using Go

Ensure you have Go 1.23 or higher.

go install github.com/orchestrator-dev/asd@latest

Download Pre-built Binaries

Head over to the Releases page to download pre-built binaries for your OS and architecture (Windows, macOS, Linux).

Note: The GitHub Actions workflows are actively compiling v0.8.3, so the binaries will appear on the release page momentarily!

📖 Usage

Using asd is as simple as using cat.

asd [flags] [file...]

Examples:

Read a simple text or code file (syntax highlighted)

asd main.go

Read multiple files at once

asd config.yaml payload.json

Read a compressed archive without unzipping

asd data.zip

Pipe from another program (reads stdin)

echo "{"test": 123}" | asd

Flags

Flag Long Flag Description

-f --flat Bypass all smart rendering and act identically to cat.

-n --lines Show line numbers alongside text and source code.

-p --plain Disable all color and styling (good for older terminals).

--theme Specify a chroma highlight theme (default is auto).

-h --help Print usage and help menus.

--version Print the current version and exit.

⚙️ Configuration

You can customize asd permanently using a global config file located at ~/.config/asd/config.toml:

Set your preferred Chroma theme for syntax highlighting

theme = "dracula"

🛠 Compilation and Development

git clone https://github.com/vsmanu/asd.git
cd asd
go mod download
make build

You can run the tests using:

make test

📄 License

This project is licensed under the MIT License.

About

A smart universal file viewer in Go

Topics

cli

golang

terminal

file-viewer

Resources

Readme

Uh oh!

There was an error while loading. Please reload this page.

Activity

Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks

Report repository

Releases 12

v2.0.0

Latest

Jun 4, 2026

+ 11 releases

Packages 0

Uh oh!

There was an error while loading. Please reload this page.

Contributors

Uh oh!

There was an error while loading. Please reload this page.

Languages

Go 99.2%

Other 0.8%