logpilot

module
v0.3.1-0...-364f8ef Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2026 License: MIT

README ΒΆ

LogPilot πŸͺ΅

CI Release Go Report Card Go Reference

A multi-source structured log viewer for the terminal. Tail files, pipe from Docker/kubectl, mix JSON and logfmt and plain text β€” all in one interactive TUI.

Why LogPilot?

  • Structured-first. LogPilot parses your logs β€” JSON fields, logfmt pairs, timestamps, levels β€” not just regex-highlights keywords. That means real filtering, not cosmetic coloring.
  • Format-agnostic. Auto-detects JSON, logfmt, and plain text. Tail a JSON API log and a plain syslog side by side in one view. No config files, no format declarations.
  • Interactive, not passive. Live-scrolling TUI with search, vim keybindings, and color-coded levels. Not a pager you pipe through β€” a tool you work in.
  • Lightweight and modern. Single binary, no runtime dependencies. Built with Go and Bubble Tea β€” starts instantly, stays under 20 MB RSS.

Features

Implemented
  • πŸ” Auto-format detection β€” JSON, logfmt, plain text, no config needed
  • 🎨 Color-coded log levels β€” DEBUG (gray), INFO (blue), WARN (yellow), ERROR (red), FATAL (red bold)
  • πŸ“‚ Multi-source input β€” files, stdin/pipes, glob patterns (*.log)
  • πŸ”„ Live tailing β€” follows files with rotation handling (rename, truncate)
  • ⏱️ Flexible timestamps β€” relative (2s ago), ISO 8601, local time
  • πŸŒ— Dark & light themes β€” auto-detects terminal background
  • ⌨️ Vim-style navigation β€” j/k, G, gg, / search, n/N
  • 🚦 Backpressure handling β€” configurable: block or drop-oldest when buffer is full
Roadmap
  • ☸️ Kubernetes pod log source
  • 🐳 Docker container log source
  • πŸ” SSH remote log source
  • 🏷️ Field-based filtering (level:error service:auth)
  • πŸ”— Trace correlation (group by trace ID)
  • πŸ“Š Timeline visualization

Quick Start

# View a log file
logpilot app.log

# Tail with live follow
logpilot -f /var/log/app/*.log

# Pipe from Docker
docker logs -f my-container 2>&1 | logpilot -

# Pipe from kubectl
kubectl logs -f deploy/api-server | logpilot -

# Mix multiple sources with glob
logpilot services/*.log /var/log/syslog

Installation

Go install (requires Go 1.22+)
go install github.com/clarabennettdev/logpilot@latest
Binary download

Grab a prebuilt binary from Releases:

# Linux (amd64)
curl -LO https://github.com/clarabennettdev/logpilot/releases/download/v0.3.0/logpilot_linux_amd64.tar.gz
tar xzf logpilot_linux_amd64.tar.gz
sudo mv logpilot /usr/local/bin/

# macOS (Apple Silicon)
curl -LO https://github.com/clarabennettdev/logpilot/releases/download/v0.3.0/logpilot_darwin_arm64.tar.gz
tar xzf logpilot_darwin_arm64.tar.gz
sudo mv logpilot /usr/local/bin/

# Windows (amd64)
# Download logpilot_windows_amd64.zip from the releases page and add to PATH
From source
git clone https://github.com/clarabennettdev/logpilot.git
cd logpilot
go build -o logpilot ./cmd/logpilot

Supported Formats

LogPilot auto-detects the format of each log line independently β€” you can mix formats in the same stream.

JSON
{"timestamp":"2026-02-19T12:00:01Z","level":"info","msg":"request handled","method":"GET","path":"/api/users","duration_ms":42}
{"timestamp":"2026-02-19T12:00:02Z","level":"error","msg":"connection refused","host":"db-primary","port":5432}
See demo JSON log demo
logfmt
ts=2026-02-19T12:00:01Z level=info msg="request handled" method=GET path=/api/users duration_ms=42
ts=2026-02-19T12:00:02Z level=warn msg="slow query" query="SELECT *" duration_ms=1250
See demo logfmt log demo
Plain text
Feb 19 12:00:01 myhost sshd[1234]: Accepted publickey for deploy
Feb 19 12:00:02 myhost nginx: 192.168.1.1 - GET /health 200
See demo Plain text log demo
Piped input
kubectl logs -f deploy/api | logpilot -
See demo Pipe demo

Keybindings

Key Action
j / ↓ Scroll down
k / ↑ Scroll up
G Jump to bottom (latest)
g g Jump to top
f / Page Down Page down
b / Page Up Page up
/ Start search
n Next search match
N Previous search match
t Toggle timestamp format
w Toggle line wrap
Tab Cycle theme
q / Ctrl+C Quit

Comparison

LogPilot lnav hl tailspin lazyjournal
Interactive TUI βœ… βœ… ❌ ❌ βœ…
Structured parsing βœ… βœ… ❌ ❌ Partial
Multi-source βœ… βœ… βœ… βœ… βœ…
Format-agnostic βœ… PartialΒΉ βœ… βœ… ❌²
Language Go C++ Rust Rust Go
Focus Structured log TUI Log file navigator Log processor/pager Highlight & tail journald/docker/k8s

ΒΉ lnav supports many formats but requires format definitions for custom structured logs. Β² lazyjournal focuses on journald, Docker, and Kubernetes sources rather than arbitrary log files.

Honest take: lnav is the most mature and feature-rich tool here. tailspin and hl are excellent if you want fast, zero-config highlighting for piped output. lazyjournal is great if your logs come from systemd/Docker/k8s. LogPilot occupies the space between β€” an interactive TUI that understands structured fields across arbitrary log sources.

Architecture

logpilot/
β”œβ”€β”€ cmd/logpilot/       # CLI entrypoint
β”œβ”€β”€ internal/
β”‚   β”œβ”€β”€ app/            # Bubble Tea application model
β”‚   β”œβ”€β”€ parser/         # Format detection + parsing (JSON, logfmt, plain)
β”‚   β”œβ”€β”€ source/         # Input sources (file, stdin, glob)
β”‚   β”œβ”€β”€ tail/           # File tailing with rotation handling
β”‚   β”œβ”€β”€ theme/          # Dark/light theme definitions
β”‚   β”œβ”€β”€ buffer/         # Ring buffer with backpressure
β”‚   └── ui/             # Lipgloss view components
β”œβ”€β”€ docs/demos/         # GIF demos
└── go.mod

Development

# Build
go build ./cmd/logpilot

# Run tests
go test ./...

# Run tests with race detector
go test -race ./...

# Benchmarks
go test -bench=. ./internal/parser/

# Lint
golangci-lint run

Contributing

Contributions are welcome! Whether it's a bug report, feature request, or pull request β€” all appreciated.

  1. Fork the repo
  2. Create a feature branch (git checkout -b feat/my-feature)
  3. Commit with clear messages
  4. Open a PR against main

Please open an issue first for large changes so we can discuss the approach.

Acknowledgments

Built on the shoulders of the Charm ecosystem:

License

MIT

Directories ΒΆ

Path Synopsis
cmd
demo command
Demo tool that showcases LogPilot's parsing and rendering capabilities.
Demo tool that showcases LogPilot's parsing and rendering capabilities.
logpilot command
internal
config
Package config provides configuration handling for LogPilot.
Package config provides configuration handling for LogPilot.
filter
Package filter provides log entry filtering and search.
Package filter provides log entry filtering and search.
merge
Package merge provides multi-source log merging by timestamp.
Package merge provides multi-source log merging by timestamp.
parser
Package parser provides log format detection and parsing.
Package parser provides log format detection and parsing.
source
Package source provides log source readers (file, stdin, k8s, docker, ssh).
Package source provides log source readers (file, stdin, k8s, docker, ssh).
tui
Package tui provides terminal UI components for LogPilot.
Package tui provides terminal UI components for LogPilot.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL