Back to browse
Command line tool for viewing files in color

Command line tool for viewing files in color

by soegaard·Apr 23, 2026·1 point·0 comments

AI Analysis

MidCozyNiche Gem

Another terminal file viewer when bat and less already dominate this space.

Strengths
  • Streaming lexer architecture shows top of large files immediately without full parse.
  • CSS color swatch rendering in terminal is a genuinely nice touch for web developers.
  • Per-language reusable lexers backed by Racket's parsing infrastructure.
Weaknesses
  • Requires Racket installation — adds dependency weight for a file viewer.
  • No clear advantage over bat, less, or highlight which are more widely adopted.
Target Audience

Terminal users, Racket developers

Similar To

bat · less · highlight

Post Description

The tool `peek` show files in color in the terminal. A wide range of popular programming language and file types are supported.

Today I added support for binary files inspired by the HN post on colors in hex editors.

Each supported programming language is backed by its own (reusable) lexer. The lexer provides a stream of tokens to the colorer. Using streams means that you will see the top of large files at once.

The idea to make `peek` came from a need to look at CSS files in the terminal. I wanted color swatches and other niceties from the browser. Also, I wanted an option to fix alignment in machine generated CSS files.

Enjoy.

Similar Projects