cat alternative written in Go.
GitHub release (latest by date) GitHub all releases GitHub Workflow Status Go Report Card LICENSE
$ brew install koki-develop/tap/gat$ brew install gat$ go install github.com/koki-develop/gat@latestDownload the binary from the releases page.
$ gat --help cat alternative written in Go. Usage: gat [file]... [flags] Flags: -b, --force-binary force binary output -c, --force-color force colored output -f, --format string output format (default "terminal256") -h, --help help for gat -l, --lang string language for syntax highlighting --list-formats print a list of supported output formats --list-langs print a list of supported languages for syntax highlighting --list-themes print a list of supported themes with preview --mask-secrets mask sensitive information (API keys, tokens) --no-resize do not resize images -p, --pretty whether to format a content pretty -M, --render-markdown render markdown -t, --theme string highlight theme (default "monokai") -v, --version version for gat
Explicitly set the language for syntax highlighting.
See languages.md for valid languages.
Set the output format ( default: terminal256 ).
Alternatively, it can be set using the GAT_FORMAT environment variable.
See formats.md for valid formats.
Set the highlight theme ( default: monokai ).
Alternatively, it can be set using the GAT_THEME environment variable.
See themes.md for valid themes.
Format a content pretty. For unsupported languages, this flag is ignored.
Mask sensitive information such as API keys and tokens.
Matched patterns are replaced with * characters of the same length.
$ echo 'AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE' | gat --mask-secrets AWS_ACCESS_KEY_ID=********************
Supported patterns:
- AWS Access Key ID
- AWS Secret Access Key
- GitHub Tokens (
ghp_,gho_,ghs_,ghr_) - GitLab Personal Access Tokens
- Slack Tokens
- Anthropic API Keys
- OpenAI API Keys
- Supabase Secret Keys
- JWT Tokens
- Private Key Headers
Render markdown documents.
gat disables colored output when piped to another program.
Settings the --force-color forces colored output to be enabled.
This is useful, for example, when used in combination with the less -R command.
It is also useful to declare the following function to allow gat to be used with a pager.
function gess() { gat --force-color "$@" | less -R }
If your terminal supports Sixel, you can print images.
Supported image formats include:
- JPEG
- PNG
- GIF (animation not supported)
If you like this project, please consider buying me a coffee.