explaingit

ys-l/csvlens

3,777RustAudience · ops devopsComplexity · 1/5Setup · easy

TLDR

A terminal viewer for CSV files that keeps rows and columns aligned so you can scroll, search with regex, filter, sort, and browse spreadsheet data without it turning into an unreadable mess.

Mindmap

mindmap
  root((csvlens))
    What it does
      Terminal CSV viewer
      Aligned columns
      Keyboard navigation
    Features
      Regex search
      Filter rows
      Sort by column
      Freeze columns
      Copy to clipboard
    Install
      Homebrew on Mac
      winget on Windows
      Arch Linux package
      Cargo via Rust
    As a library
      Rust crate
      Returns selected row
    Input
      File or stdin pipe
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Browse a large CSV file in the terminal with aligned columns, horizontal scrolling, and keyboard navigation.

USE CASE 2

Search and filter rows in a CSV file using regex patterns directly from the command line.

USE CASE 3

Pipe the output of another command into csvlens to explore the data interactively in the terminal.

USE CASE 4

Use csvlens as a Rust library inside another program to display a CSV file and capture the row the user selects.

Tech stack

Rust

Getting it running

Difficulty · easy Time to first run · 5min

Install via Homebrew, winget, or Cargo in under a minute, run csvlens followed by a filename.

In plain English

csvlens is a command line tool for viewing CSV files in the terminal. If you have ever used the less command to read text files in a terminal window, csvlens works on the same idea but designed specifically for CSV data: rows and columns stay aligned, and you can scroll both horizontally and vertically through the file without it turning into an unreadable mess. You run it by typing csvlens followed by a filename, or you can pipe data from another command directly into it. Once open, you navigate using keyboard shortcuts similar to other terminal tools. Arrow keys or the hjkl keys scroll through rows and columns. You can search within the file using a regex pattern, filter the visible rows down to just matches, sort by a column, resize column widths, freeze columns on the left side, and copy selected cells or rows to the clipboard. There are a handful of command line options for handling non-standard CSV files. You can specify a different delimiter if the file uses tabs or pipes instead of commas, tell it to ignore case during searches, skip treating the first row as headers, or pre-apply a column or row filter when you open the file. Installing csvlens is straightforward on most platforms. Mac users can install via Homebrew, Windows users via winget, Arch Linux users via the official package repositories, and several BSD systems have it in their package managers as well. If you have Rust installed, you can also install it through Cargo. Beyond the standalone viewer, csvlens can also be used as a Rust library inside other programs. You call a function, pass it a file path and optional configuration, and it returns whatever cell or row the user selected. The README includes short code examples and links to the full library documentation.

Copy-paste prompts

Prompt 1
I have a tab-separated file. Show me the csvlens command to open it with the correct delimiter and freeze the first two columns.
Prompt 2
How do I use csvlens to filter a CSV file to only show rows where a column contains a specific word?
Prompt 3
I want to pipe the output of a SQL query exported as CSV into csvlens to explore it interactively. What command do I use?
Prompt 4
Show me how to use csvlens as a Rust library to let the user browse a CSV file and return the row they selected.
Prompt 5
How do I sort a CSV by a specific column in csvlens using the keyboard, and how do I copy a selected row to the clipboard?
Open on GitHub → Explain another repo

← ys-l on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.