A fast CLI tool to analyze, search, and summarize large text files and logs.
Find errors, extract timelines, count word frequencies, search with regex, and optionally get AI-powered summaries — all from your terminal.
pip install git+https://github.com/nord342/logwise.gitWith AI summarization support (uses Claude):
pip install "logwise[ai] @ git+https://github.com/nord342/logwise.git"# Full analysis of a log file
logwise analyze server.log
# Find all errors and issues
logwise errors production.log --context 3
# Search with regex
logwise search app.log 'timeout|refused' --context 2
# Extract timeline
logwise timeline server.log
# AI-powered summary (requires ANTHROPIC_API_KEY)
logwise summarize server.logFull analysis: overview stats, log level counts, error detection, word frequency, timeline, and regex matches.
logwise analyze server.log
logwise analyze app.log --top-words 30
logwise analyze app.log --regex 'status=5\d{2}'
logwise analyze server.log --export report.mdFlags:
| Flag | Description |
|---|---|
--top-words N |
Number of top words to display (default: 20) |
--regex PATTERN |
Highlight lines matching a regex pattern |
--export FILE |
Export full report to Markdown |
--encoding ENC |
File encoding (default: utf-8) |
Find and display all errors, exceptions, failures, and other issues.
logwise errors production.log
logwise errors app.log --context 5
logwise errors server.log --export errors.mdFlags:
| Flag | Description |
|---|---|
--context N |
Lines of context around each error |
--export FILE |
Export errors to Markdown |
Search files with regex patterns. Supports context lines and case sensitivity.
logwise search app.log 'connection (refused|timeout)'
logwise search data.txt 'ERROR' --case-sensitive
logwise search server.log 'user_id=\d+' --context 2 --export matches.mdFlags:
| Flag | Description |
|---|---|
--context N |
Lines of context around matches |
--case-sensitive |
Case-sensitive search (default: case-insensitive) |
--export FILE |
Export results to Markdown |
Extract and display all timestamped entries. Supports ISO 8601, syslog, Apache/Nginx, and common log formats.
logwise timeline server.log
logwise timeline app.log --limit 100Flags:
| Flag | Description |
|---|---|
--limit N |
Max entries to display (default: 50) |
AI-powered summary using Claude. Requires the anthropic package and ANTHROPIC_API_KEY environment variable.
logwise summarize server.log
logwise summarize crash.log --prompt "Focus on the root cause of failures"
logwise summarize app.log --export summary.mdFlags:
| Flag | Description |
|---|---|
--prompt TEXT |
Custom prompt for the AI |
--max-lines N |
Max lines to send to AI (default: 5000) |
--model MODEL |
Claude model to use |
--export FILE |
Export summary to Markdown |
Log levels: DEBUG, INFO, NOTICE, WARN/WARNING, ERROR, CRITICAL, FATAL, SEVERE, ALERT, EMERGENCY, TRACE
Error indicators: error, exception, traceback, failed, failure, crash, panic, abort, segfault, out of memory, killed, timeout, refused, denied, unauthorized, cannot, could not, unable to, not found, missing, broken, corrupt
Timestamp formats:
- ISO 8601:
2024-01-15T10:30:45Z - Common:
2024-01-15 10:30:45 - Syslog:
Jan 15 10:30:45 - Apache/Nginx:
15/Jan/2024:10:30:45 +0000 - Bracketed:
[2024-01-15 10:30:45]
Any command with --export flag generates a clean Markdown report:
logwise analyze server.log --export report.md
logwise errors app.log --export errors.md
logwise search data.txt 'pattern' --export matches.md
logwise summarize crash.log --export summary.md- Debugging — quickly find errors and trace timelines in application logs
- Incident response — scan production logs for failures and anomalies
- Log review — get summaries of large log files without reading every line
- Journal/notes — search and summarize long text documents
- Data exploration — find patterns in CSV, TSV, or other text data
git clone https://github.com/nord342/logwise.git
cd logwise
pip install -e ".[all]"
pytestMIT