Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

lnav

$ lnav Community Low Risk
Tim Stack · Files & Search · BSD-2-Clause · macos / linux

lnav automatically detects log formats (syslog, nginx, JSON-lines, compressed archives), merges entries chronologically, and exposes virtual SQLite tables. Passing -n runs lnav headlessly with -c SQL commands and :write-json-to - for structured JSON output.

FCRS-1.0 Score
89 /100
Good
Medium Confidence
Zero-Friction Install
brew install lnav
CLI vs MCP Decision CLI Preferred vs MCP

Querying gigabytes of multi-format local logs via lnav -n SQLite queries avoids streaming raw log lines into MCP or LLM context.

Agent-Readiness Checklist

✓ JSON Output
✓ Field Filtering
✓ Non-Interactive
— Dry-Run
✓ Read-Only Mode
— NO_COLOR Clean
— Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 22 / 25

Dedicated -n headless mode combined with -c SQLite queries and :write-json-to - provides surgical JSON/CSV filtering, though bare lnav enters a TUI.

  • Supports -n headless execution and -c command pipelines
  • Emits JSON via :write-json-to - over virtual SQLite log tables
Trust & Safety 24 / 25

Log analysis is read-only unless explicitly exporting to files (:write-*-to) or saving local session bookmarks.

  • Never modifies source log files
Setup & Portability 12 / 15

Compiled C++ binary available via Homebrew, Linux distro repos, and static Linux releases; Windows requires WSL.

  • macOS and Linux builds; no native Windows binary
Utility & Efficiency 14 / 15

Uniquely parses, decompresses, and joins heterogeneous logs into SQLite tables on the fly.

  • Zero-ingestion SQLite querying across gz/bz2/json/syslog files
Maintenance & Lineage 8 / 10

Actively maintained BSD-2-Clause project (tstack/lnav) with steady releases.

  • Long-lived, actively developed GitHub repository
Docs & Verifiability 9 / 10

Extensive documentation at docs.lnav.org covering CLI flags, log formats, and SQL schema.

  • Official ReadTheDocs manual and built-in SQL reference

Security, Auth & Guardrails

Auth Modes
No Auth Config File
Credential Storage

Operates on local log files by default; optional remote SFTP/SSH log tailing uses standard ~/.ssh/ config.

Side Effects
Read-Only Local Write
Cost & Quotas

100% free, offline, and open-source (BSD-2-Clause).

Copyable Guardrail for CLAUDE.md / AGENTS.md
# lnav Agent Rules
- ALWAYS pass `-n` (headless mode) with `-c` commands; bare `lnav <file>` launches an interactive ncurses TUI that hangs non-TTY callers.
- Prefer `:write-json-to -` with `LIMIT` clauses so huge log files do not flood stdout.

Agent-Ready Command Recipes

Safe Read-Only Queries

Run a headless SQLite query over logs and emit JSON
lnav -n -c ';SELECT log_time, log_level, log_body FROM all_logs WHERE log_level = "error" LIMIT 50' -c ':write-json-to -' app.log

Executes lnav headlessly (-n) and streams SQL-filtered error records to stdout as JSON via :write-json-to -.

Summarize log counts by level headlessly
lnav -n -c ';SELECT log_level, count(*) AS cnt FROM all_logs GROUP BY log_level' -c ':write-csv-to -' app.log

Aggregates log severity counts without loading raw log lines into agent context.

Strengths for Agents

  • + Headless -n + SQLite queries + :write-json-to - turn messy logs into compact JSON answers.
  • + Decompresses .gz/.bz2 and merges multi-file timestamps automatically with zero setup.

Caveats & Pitfalls

  • ! Running lnav without -n opens an interactive ncurses UI that stalls headless agents.
  • ! No native Windows build outside WSL.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI