Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

ccat

> 编程语言
Open source

Colorizing `cat`

3.2K stars0 likes0 views
WebsiteGitHub

About

Colorizing `cat`

ccat

ccat is the colorizing cat. It works similar to cat but displays content with syntax highlighting.

Supported Languages

  • JavaScript
  • Java
  • Ruby
  • Python
  • Go
  • C
  • JSON

Installation

OSX

$ brew install ccat

Arch Linux

$ pacaur -S ccat
$ pacaur -S ccat-git

The ccat package will reflect the current release snapshot, while the ccat-git will be based on the current source available in the master branch of the git repo. You can use any AUR helper in place of pacaur AUR Helpers

Standalone

ccat can be easily installed as an executable. Download the latest compiled binaries and put it in your executable path.

From source

Prerequisites:

  • Git
  • Go 1.4+
$ go get -u github.com/owenthereal/ccat

Completion (ZSH Only)

Installation

Move the _ccat file in ./completions/zsh to your site-functions directory usually in /usr/local/share/zsh/site-functions or in /usr/share/zsh/site-functions. If completions don't work on the next ZSH startup, you can delete the file .zcompdump (which caches autocomplete commands) and it is usually in the home directory.

Uninstallation

Go back to the directory you copied _ccat to and delete the file, then simply delete .zcompdump in order to stop errors when trying to use ccat autocomplete afterwards.

Usage

$ ccat FILE1 FILE2 ...
$ ccat FILE1 FILE2 ... --html # output in HTML
$ ccat --bg=dark FILE1 FILE 2 ... # dark background
$ ccat -G String="_darkblue_" -G Plaintext="darkred" FILE # set color codes
$ ccat --palette # show palette
$ ccat # read from standard input
$ curl https://raw.githubusercontent.com/owenthereal/ccat/master/main.go | ccat

It's recommended to alias ccat to cat:

alias cat=ccat

The overhead of ccat comparing to cat is mimimum:

$ wc -l main.go
123 main.go
$ time cat main.go > /dev/null
cat main.go > /dev/null  0.00s user 0.00s system 61% cpu 0.005 total
$ time ccat main.go > /dev/null
ccat main.go > /dev/null  0.00s user 0.00s system 78% cpu 0.007 total

You can always invoke cat after aliasing ccat by typing \cat.

Demo

Roadmap

  • nicer default color scheme
  • ?

Alternatives

ccat is designed to be distributed in one binary, run at native speed and follow the POSIX standards. There're alternatives out there. Use them at your own risk :):

  • pygments
  • source-highlight

License

MIT

Credits

Thanks to Sourcegraph who built this awesome syntax-highlighting package.

Support

Backers

Support us with a monthly donation and help us continue our activities. [Become a backer]

Sponsors

Become a sponsor and get your logo on our README on Github with a link to your site. [Become a sponsor]

GitHub Issues· 41 open

View all on GitHub
  • #93

    Feature Request: Show end of lines like cat -A

    Updated Jan 20, 2026
  • #88

    My custom colors - not an issue, just sharing

    Updated Dec 16, 2025
  • #73

    unable to access ... : gnutls_handshake() failed: Public key signature verification has failed

    Updated Dec 14, 2025
  • #92

    https://github.com/owenthereal/ccat/actions

    Updated Nov 22, 2025
  • #91

    2b0dc03b235e249688b71c46194e802a1c12eac0

    Updated Nov 22, 2025
  • #89

    Change all of my balance

    Updated Dec 2, 2024
  • #77

    Stops colorizing at /* (slash asterisk)

    Updated Jan 5, 2023
  • #86

    Doesn't work with zsh - zsh: command not found: ccat

    Updated Oct 20, 2022
  • #57

    apt-get

    Updated Jul 8, 2022
  • #59

    Proper [Python] syntax

    Updated Nov 16, 2021

Highlights

  • •JavaScript
  • •[ ] nicer default color scheme
  • •pygments
  • •source-highlight

> Tags

Go

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言