MCPcopy
hub / github.com/owenthereal/ccat

github.com/owenthereal/ccat @v1.1.0 sqlite

repository ↗ · DeepWiki ↗ · release v1.1.0 ↗
620 symbols 1,717 edges 65 files 284 documented · 46%
README

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

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/jingweno/ccat

Usage

$ ccat FILE1 FILE2 ...
$ 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/jingweno/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

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 :):

License

MIT

Credits

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

Extension points exported contracts — how you extend this code

Printer (Interface)
go:generate gostringer -type=Kind [7 implementers]
Godeps/_workspace/src/github.com/sourcegraph/syntaxhighlight/highlight.go
CCatPrinter (Interface)
(no doc) [7 implementers]
ccat.go
RoundTripper (Interface)
RoundTripper is an interface representing the ability to execute a single HTTP transaction, obtaining the Response for a
Godeps/_workspace/src/github.com/sourcegraph/syntaxhighlight/testdata/net_http_client.go
Value (Interface)
Value is the interface to the dynamic value stored in a flag. (The default value is represented as a string.)
Godeps/_workspace/src/github.com/spf13/pflag/flag.go
Annotator (Interface)
(no doc)
Godeps/_workspace/src/github.com/sourcegraph/syntaxhighlight/highlight.go

Core symbols most depended-on inside this repo

VarP
called by 70
Godeps/_workspace/src/github.com/spf13/pflag/flag.go
String
called by 37
Godeps/_workspace/src/github.com/spf13/pflag/flag.go
Name
called by 31
Godeps/_workspace/src/github.com/spf13/cobra/command.go
Parse
called by 27
Godeps/_workspace/src/github.com/spf13/pflag/flag.go
AddCommand
called by 24
Godeps/_workspace/src/github.com/spf13/cobra/command.go
Flags
called by 24
Godeps/_workspace/src/github.com/spf13/cobra/command.go
PersistentFlags
called by 22
Godeps/_workspace/src/github.com/spf13/cobra/command.go
Lookup
called by 21
Godeps/_workspace/src/github.com/spf13/pflag/flag.go

Shape

Function 280
Method 275
TypeAlias 34
Struct 24
Interface 7

Languages

Go100%
TypeScript1%
Python1%

Modules by API surface

Godeps/_workspace/src/github.com/spf13/cobra/command.go70 symbols
Godeps/_workspace/src/github.com/spf13/pflag/flag.go57 symbols
Godeps/_workspace/src/github.com/spf13/cobra/cobra_test.go51 symbols
Godeps/_workspace/src/github.com/spf13/pflag/flag_test.go29 symbols
Godeps/_workspace/src/github.com/sourcegraph/syntaxhighlight/testdata/net_http_client.go27 symbols
Godeps/_workspace/src/github.com/sourcegraph/syntaxhighlight/highlight.go17 symbols
Godeps/_workspace/src/github.com/mattn/go-colorable/colorable_windows.go17 symbols
Godeps/_workspace/src/github.com/spf13/pflag/bool.go16 symbols
Godeps/_workspace/src/github.com/spf13/pflag/ipmask.go15 symbols
Godeps/_workspace/src/github.com/spf13/pflag/bool_test.go15 symbols
Godeps/_workspace/src/github.com/spf13/pflag/uint32.go14 symbols
Godeps/_workspace/src/github.com/spf13/pflag/uint16.go14 symbols

For agents

$ claude mcp add ccat \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact