cat on steroids. Leveraging great go modules to ease my CLI life.
brew install batmac/tap/ccatos
Get the latest release from https://github.com/batmac/ccat/releases/latest
Run the zero-install code or use your mage binary:
$ git clone https://github.com/batmac/ccat
$ go run magefiles/mage.go -l # or 'mage -l'
Targets:
buildDefault
buildDefaultAndTest* buildDefault,test
buildFull tags: libcurl,crappy,plugins
buildMinimal tags: nohl,fileonly
clean
install put ccat to $GOPATH/bin/ccat
installDeps go mod download
test all
testCompressionGo
testGo go test ./...
updateREADME
verifyDeps go mod verify
* default target
$ go run magefiles/mage.go # or 'mage'
- You can update to the latest github release with
ccat --selfupdate
. - You can check against your current installed version with
ccat --check
.
available build tags:
libcurl
: build with the libcurl opener.plugins
: build with the yaegi plugins engine.fileonly
: build with the local file opener only.nohl
: build without the syntax-highlighter.crappy
: build with some crappy (but useful) openers/mutators.keystore
: build with the OS keyring support (Mac,Linux,Windows).
$ ccat -m "x:kubectl get all" -i -w -t ready,Running --bg
NAME READY STATUS RESTARTS AGE
pod/busybox3 1/1 Running 1 17m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 21d
( "READY and "Running" have different background colors )
$ echo Hello: | ccat -m y2j,j2y,base64,hexdump
00000000 53 47 56 73 62 47 38 36 49 47 35 31 62 47 77 4b |SGVsbG86IG51bGwK|
$ ccat -m zstd,base64 LICENSE
KLUv/WQwA+UUAGKyjCQQi1gA+Mu1uPH4trE1CdEhIptwP1oghhOOOP5rTRkCAKACAAdroEXGmA2Uz10inntYY97kIsI70zHae3CBb+DnAi4lAWNzxHPSRXalSceYEc4rc2FxPri8gX/QzYX9sT/32JzZHMbds2JzJmwIlmDMlYRjz/LGa8+BueftcBkb80Dn00G42FDA5RFeRujMBVvNmX8e5sjP1xLa4ftzH5ivJRriudg89+A789ibhIq4UDyyZ7G4GZni7BE2l7K96ZqlNKZ73IHNx5wltsQbeNlcc+bhPNOmS7jnE77PxeGI55jFszx3hWnuUSTcivBStqhQaFeY5xDeeOwNfGM+FiNjfC6gMx3jCoB0lwzgTGNcAoyKS/cWGWM2UL45c60B6ko+0c6WZuyo8Cl6249qdXyaqIRxSxnqfO0rw3XQV2mudYDt7dyRvdAhthvuNN3Hzc9QXbj4N6oSbktVj4U7cqWG33ycO0JVyW/+cW3JhdY0VXzqEkSWXpkcFb5Sc+VoKuOOrki4J0clqZErk0dHN3JFqbj6zQu/SrkjPUFsR9UE2b5ib2eoqYwr9VxdKXfDX6V822uiNRIAkACvUg44rlM/bm9nmm2NVNCNHtVMG7oY00eWvlK0IT8uPm4p/3HXRHKh00Ns26bZcW8vpqrkE0t/85UKoagE/XFfK/W4EtVsKQX5xFGpKh337W2MO0JVxVr2ZkuX14w7S+jhBgYFBheAAp4lSFMTyV3WqthWqJ9PlwgmAGYTiQo1Zi5cSUcnOBoEX3ev5YUMcVnvUrgx5HaCOLWhPcddUjOGZmX2yZFNAyB+ELmdEtsBPE17UsXU4fTV1jdNHpPl8KiAkC34tsZqWhxaa3RlIgn25jJkslDF+VBC8cW5mikplMUF0g==
multi-arch container images with tags libcurl,crappy,plugins
are automatically built by Github Actions and made available on Dockerhub and Github Packages.
for instance:
$ docker run --rm ghcr.io/batmac/ccat:latest -h
...
or
$ kubectl run -i --tty ccat --image=batmac/ccat:latest -- /bin/sh
...