Scripts2026年7月5日·1 分钟阅读

csvlens — Interactive CSV Viewer for the Terminal

csvlens is a Rust-based command-line tool that renders CSV files as scrollable, searchable tables in the terminal with column sorting and filtering.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
csvlens Overview
直接安装命令
npx -y tokrepo@latest install b636edc5-784d-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

csvlens brings spreadsheet-like navigation to CSV files directly in the terminal. Rather than opening a heavyweight application or writing parsing scripts, you can scroll through rows, sort columns, search for values, and filter data interactively from the command line.

What csvlens Does

  • Renders CSV data as an aligned, scrollable table in the terminal
  • Supports column-based sorting in ascending or descending order
  • Provides search to locate specific values across all columns
  • Handles large files efficiently with streaming row loading
  • Supports TSV and other delimiter-separated formats

Architecture Overview

csvlens reads the CSV file incrementally, parsing rows on demand as the user scrolls. The TUI is built using the ratatui library for Rust terminal applications. Column widths are calculated from visible data, and the table view maintains a scrollable viewport over the full dataset. Search and filter operations scan rows in the background while keeping the UI responsive.

Self-Hosting & Configuration

  • Install via Cargo with cargo install csvlens
  • Also available through Homebrew and Nix package managers
  • Pass the file path as an argument or pipe CSV data through stdin
  • Use -d flag to specify a custom delimiter (e.g., -d '\t' for TSV)
  • No configuration file is needed; all options are command-line flags

Key Features

  • Vim-style navigation with j/k for rows and h/l for columns
  • Column sorting by pressing s on any column header
  • Regex-powered search with / to find matching values
  • Filter mode to show only rows matching a search query
  • Automatic column width detection and horizontal scrolling

Comparison with Similar Tools

  • xsv — Fast CSV toolkit for slicing and statistics, not interactive
  • Miller — Powerful CSV/JSON processor with its own query language
  • VisiData — Feature-rich TUI for exploring tabular data, heavier and Python-based
  • column — Basic Unix tool for aligning text, no interactivity

FAQ

Q: Can csvlens handle files with millions of rows? A: csvlens streams data incrementally, so it can open large files without loading everything into memory at once.

Q: Does it support Excel or Google Sheets formats? A: No. csvlens reads plain CSV and other delimiter-separated text files. Convert spreadsheets to CSV first.

Q: How do I change the delimiter? A: Use the -d flag followed by the delimiter character, for example -d ';' for semicolon-separated files.

Q: Can I export filtered results? A: csvlens is currently a viewer only. For filtering and exporting, pair it with tools like xsv, Miller, or awk.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产