/TerminalGat.jl

Unofficial Julia interface for `gat` (cat alternative written in Go)

Primary LanguageDockerfileMIT LicenseMIT

TerminalGat Build Status Stable Dev

Description

Unofficial Julia interface for gat

Setup

  • Install Julia
  • Clone this repository
$ git clone https://github.com/terasakisatoshi/TerminalGat.jl.git
$ cd TerminalGat.jl
$ julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.10.3 (2024-04-30)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using Pkg; Pkg.activate(".") # activate this project
julia> ] # switch to Pkg REPL
(TerminalGat) pkg> dev --local https://github.com/terasakisatoshi/gat_jll.jl.git
(TerminalGat) pkg> # press Ctrl+C to back to julian mode
julia> exit()

How to use

Our Julia package TerminalGat.jl exports gat, and gess functions.

gat

julia> using TerminalGat
julia> gat("Project.toml")

Internally, our package uses JuliaDocs/IOCapture.jl to capture the standard output generated by the go binary gat.

If your terminal supports Sixel, you can print images.

julia> using TerminalGat
julia> using Plots; plot(sin); savefig("sin.png")
julia> gat("sin.png")

gess

gess works something like gat + less:

julia> using TerminalGat
julia> gess("Project.toml")

Internally, our package uses ronisbr/TerminalPager.jl to scroll through content that does not fit in the screen.