{"id":51026615,"url":"https://github.com/gitstq/loglens-cli","last_synced_at":"2026-06-21T20:02:07.608Z","repository":{"id":363080343,"uuid":"1261876443","full_name":"gitstq/loglens-cli","owner":"gitstq","description":"A lightweight, intelligent terminal log analyzer with interactive TUI","archived":false,"fork":false,"pushed_at":"2026-06-07T09:51:21.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-07T11:22:09.694Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gitstq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-07T09:17:04.000Z","updated_at":"2026-06-07T09:51:18.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/gitstq/loglens-cli","commit_stats":null,"previous_names":["gitstq/loglens-cli"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/gitstq/loglens-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitstq%2Floglens-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitstq%2Floglens-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitstq%2Floglens-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitstq%2Floglens-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gitstq","download_url":"https://codeload.github.com/gitstq/loglens-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitstq%2Floglens-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34623906,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-21T02:00:05.568Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-21T20:02:06.724Z","updated_at":"2026-06-21T20:02:07.602Z","avatar_url":"https://github.com/gitstq.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎯 LogLens-CLI\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Python-3.8%2B-blue?style=flat-square\u0026logo=python\" alt=\"Python 3.8+\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/License-MIT-green?style=flat-square\" alt=\"License MIT\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Platform-Linux%20%7C%20macOS%20%7C%20Windows-lightgrey?style=flat-square\" alt=\"Platform\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003eA lightweight, intelligent terminal log analyzer with interactive TUI\u003c/b\u003e\u003cbr\u003e\n  \u003ci\u003eParse JSON, logfmt, and plain text logs with real-time filtering and beautiful visualization\u003c/i\u003e\n\u003c/p\u003e\n\n---\n\n## 🌍 Language Switch\n\n- [English](#english)\n- [简体中文](#simplified-chinese)\n- [繁體中文](#traditional-chinese)\n\n---\n\n\u003ca id=\"english\"\u003e\u003c/a\u003e\n## English\n\n### 🎉 Introduction\n\nLogLens-CLI is a **smart terminal log viewer** designed for developers who need to quickly analyze and understand log files. Unlike traditional log viewers that require complex configuration, LogLens works **out of the box** with zero setup.\n\n**Key differentiators:**\n- 🧠 **Intelligent Format Detection** - Auto-detects JSON, logfmt, and plain text formats\n- ⚡ **Lightning Fast** - Written in Python with optimized parsing algorithms\n- 🎨 **Beautiful TUI** - Interactive terminal interface with syntax highlighting\n- 🔍 **Smart Filtering** - Real-time search across all log fields\n- 📊 **Instant Statistics** - Error/warning/info breakdown at a glance\n\n**Inspiration:** Born from the frustration of juggling multiple tools (`jq`, `grep`, `awk`, `less`) just to understand what's happening in application logs.\n\n### ✨ Core Features\n\n| Feature | Description |\n|---------|-------------|\n| 📁 **Multi-Format Support** | JSON, logfmt, and plain text logs - all handled automatically |\n| 🎛️ **Interactive TUI** | Full-screen terminal UI with keyboard navigation |\n| 🔎 **Real-Time Filtering** | Filter by level, message content, or any field |\n| 📈 **Live Statistics** | Error/warning/info counts with visual bar charts |\n| 🌈 **Syntax Highlighting** | Color-coded log levels for instant visual recognition |\n| 📤 **Export to JSON** | Convert any log format to structured JSON |\n| 🔄 **Pipe Support** | Works with `tail -f`, `kubectl logs`, `docker logs` |\n| ⌨️ **Vim-Style Keys** | Familiar navigation for terminal power users |\n\n### 🚀 Quick Start\n\n#### Requirements\n- Python 3.8 or higher\n- pip package manager\n\n#### Installation\n\n```bash\n# Install from PyPI (coming soon)\npip install loglens-cli\n\n# Or install from source\ngit clone https://github.com/gitstq/loglens-cli.git\ncd loglens-cli\npip install -e .\n```\n\n#### Basic Usage\n\n```bash\n# Launch TUI with a log file\nloglens -f app.log\n\n# Show statistics\nloglens stats -f app.log\n\n# Filter errors only\nloglens filter -f app.log --level ERROR\n\n# Search for specific text\nloglens filter -f app.log --search \"database\"\n\n# Pipe from other commands\ntail -f app.log | loglens\nkubectl logs -f my-pod | loglens\n```\n\n#### Keyboard Shortcuts (TUI Mode)\n\n| Key | Action |\n|-----|--------|\n| `q` / `Ctrl+C` | Quit |\n| `f` | Focus filter input |\n| `c` | Clear all logs |\n| `r` | Refresh |\n| `e` | Show errors only |\n| `w` | Show warnings and errors |\n| `?` | Show help |\n\n### 📖 Detailed Usage Guide\n\n#### Supported Log Formats\n\n**JSON Logs:**\n```json\n{\"timestamp\": \"2024-01-15T10:30:00Z\", \"level\": \"ERROR\", \"message\": \"Connection failed\", \"service\": \"api\"}\n```\n\n**Logfmt Logs:**\n```\ntime=2024-01-15T10:30:00Z level=info msg=\"Request processed\" duration=45ms\n```\n\n**Plain Text Logs:**\n```\n2024-01-15 10:30:00 INFO Application started successfully\n```\n\n#### CLI Commands\n\n```bash\n# Statistics overview\nloglens stats -f /var/log/app.log\n\n# Filter with multiple criteria\nloglens filter -f app.log --level ERROR --search \"timeout\" --limit 50\n\n# Export to JSON for further processing\nloglens export -f app.log \u003e output.json\n```\n\n### 💡 Design Philosophy\n\n**Why LogLens?**\n\nModern applications generate massive amounts of structured logs, but most developers still rely on primitive tools like `grep` and `tail`. Existing solutions like ELK stack or Grafana Loki are powerful but require significant infrastructure investment.\n\nLogLens fills the gap by providing:\n- **Zero-configuration** log analysis\n- **Terminal-native** workflow (no browser needed)\n- **Instant startup** (no Docker, no services)\n- **Universal format support** (works with any logging framework)\n\n**Future Roadmap:**\n- [ ] Log pattern clustering and anomaly detection\n- [ ] Integration with popular log aggregation services\n- [ ] Custom color themes and formatting rules\n- [ ] Log comparison and diff view\n- [ ] Performance metrics extraction\n\n### 📦 Packaging \u0026 Deployment\n\n```bash\n# Build distribution\nmake build\n\n# Install locally\npip install dist/loglens-cli-*.whl\n\n# Run tests\nmake test\n\n# Format code\nmake format\n```\n\n### 🤝 Contributing\n\nWe welcome contributions! Please follow these guidelines:\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feat/amazing-feature`)\n3. Commit your changes (`git commit -m 'feat: add amazing feature'`)\n4. Push to the branch (`git push origin feat/amazing-feature`)\n5. Open a Pull Request\n\n**Commit Message Convention:**\n- `feat:` New feature\n- `fix:` Bug fix\n- `docs:` Documentation changes\n- `refactor:` Code refactoring\n- `test:` Test changes\n\n### 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n---\n\n\u003ca id=\"simplified-chinese\"\u003e\u003c/a\u003e\n## 简体中文\n\n### 🎉 项目介绍\n\nLogLens-CLI 是一款**智能终端日志分析器**，专为需要快速分析和理解日志文件的开发者设计。与传统需要复杂配置的日志查看器不同，LogLens **开箱即用**，零配置即可工作。\n\n**核心差异化亮点：**\n- 🧠 **智能格式识别** - 自动识别 JSON、logfmt 和普通文本格式\n- ⚡ **极速解析** - 基于 Python 编写，采用优化的解析算法\n- 🎨 **精美 TUI** - 交互式终端界面，支持语法高亮\n- 🔍 **智能过滤** - 跨所有日志字段的实时搜索\n- 📊 **即时统计** - 错误/警告/信息一目了然\n\n**灵感来源：** 源于开发者在使用 `jq`、`grep`、`awk`、`less` 等多个工具来理解应用日志时的挫败感。\n\n### ✨ 核心特性\n\n| 特性 | 描述 |\n|------|------|\n| 📁 **多格式支持** | JSON、logfmt、纯文本日志 - 全部自动处理 |\n| 🎛️ **交互式 TUI** | 全屏终端界面，支持键盘导航 |\n| 🔎 **实时过滤** | 按级别、消息内容或任意字段过滤 |\n| 📈 **实时统计** | 错误/警告/信息计数，带可视化条形图 |\n| 🌈 **语法高亮** | 颜色编码的日志级别，即时视觉识别 |\n| 📤 **导出 JSON** | 将任意日志格式转换为结构化 JSON |\n| 🔄 **管道支持** | 与 `tail -f`、`kubectl logs`、`docker logs` 配合使用 |\n| ⌨️ **Vim 风格按键** | 终端高级用户熟悉的导航方式 |\n\n### 🚀 快速开始\n\n#### 环境要求\n- Python 3.8 或更高版本\n- pip 包管理器\n\n#### 安装\n\n```bash\n# 从 PyPI 安装（即将推出）\npip install loglens-cli\n\n# 或从源码安装\ngit clone https://github.com/gitstq/loglens-cli.git\ncd loglens-cli\npip install -e .\n```\n\n#### 基本用法\n\n```bash\n# 使用 TUI 打开日志文件\nloglens -f app.log\n\n# 显示统计信息\nloglens stats -f app.log\n\n# 仅过滤错误\nloglens filter -f app.log --level ERROR\n\n# 搜索特定文本\nloglens filter -f app.log --search \"database\"\n\n# 从其他命令管道输入\ntail -f app.log | loglens\nkubectl logs -f my-pod | loglens\n```\n\n#### 键盘快捷键（TUI 模式）\n\n| 按键 | 操作 |\n|------|------|\n| `q` / `Ctrl+C` | 退出 |\n| `f` | 聚焦过滤输入框 |\n| `c` | 清除所有日志 |\n| `r` | 刷新 |\n| `e` | 仅显示错误 |\n| `w` | 显示警告和错误 |\n| `?` | 显示帮助 |\n\n### 📖 详细使用指南\n\n#### 支持的日志格式\n\n**JSON 日志：**\n```json\n{\"timestamp\": \"2024-01-15T10:30:00Z\", \"level\": \"ERROR\", \"message\": \"Connection failed\", \"service\": \"api\"}\n```\n\n**Logfmt 日志：**\n```\ntime=2024-01-15T10:30:00Z level=info msg=\"Request processed\" duration=45ms\n```\n\n**纯文本日志：**\n```\n2024-01-15 10:30:00 INFO Application started successfully\n```\n\n#### CLI 命令\n\n```bash\n# 统计概览\nloglens stats -f /var/log/app.log\n\n# 多条件过滤\nloglens filter -f app.log --level ERROR --search \"timeout\" --limit 50\n\n# 导出为 JSON 以便进一步处理\nloglens export -f app.log \u003e output.json\n```\n\n### 💡 设计思路与迭代规划\n\n**为什么选择 LogLens？**\n\n现代应用生成大量结构化日志，但大多数开发者仍然依赖 `grep` 和 `tail` 等原始工具。ELK 堆栈或 Grafana Loki 等现有解决方案功能强大，但需要大量的基础设施投入。\n\nLogLens 填补了空白，提供：\n- **零配置**日志分析\n- **终端原生**工作流（无需浏览器）\n- **即时启动**（无需 Docker，无需服务）\n- **通用格式支持**（适用于任何日志框架）\n\n**后续迭代计划：**\n- [ ] 日志模式聚类和异常检测\n- [ ] 与主流日志聚合服务集成\n- [ ] 自定义颜色主题和格式化规则\n- [ ] 日志对比和差异视图\n- [ ] 性能指标提取\n\n### 📦 打包与部署\n\n```bash\n# 构建分发包\nmake build\n\n# 本地安装\npip install dist/loglens-cli-*.whl\n\n# 运行测试\nmake test\n\n# 格式化代码\nmake format\n```\n\n### 🤝 贡献指南\n\n欢迎贡献！请遵循以下规范：\n\n1. Fork 仓库\n2. 创建功能分支 (`git checkout -b feat/amazing-feature`)\n3. 提交更改 (`git commit -m 'feat: add amazing feature'`)\n4. 推送到分支 (`git push origin feat/amazing-feature`)\n5. 发起 Pull Request\n\n**提交信息规范：**\n- `feat:` 新功能\n- `fix:` 修复问题\n- `docs:` 文档更新\n- `refactor:` 代码重构\n- `test:` 测试变更\n\n### 📄 开源协议\n\n本项目采用 MIT 协议开源 - 详见 [LICENSE](LICENSE) 文件。\n\n---\n\n\u003ca id=\"traditional-chinese\"\u003e\u003c/a\u003e\n## 繁體中文\n\n### 🎉 專案介紹\n\nLogLens-CLI 是一款**智慧終端機日誌分析器**，專為需要快速分析和理解日誌檔案的開發者設計。與傳統需要複雜設定的日誌檢視器不同，LogLens **開箱即用**，零設定即可工作。\n\n**核心差異化亮點：**\n- 🧠 **智慧格式識別** - 自動識別 JSON、logfmt 和普通文字格式\n- ⚡ **極速解析** - 基於 Python 編寫，採用最佳化的解析演算法\n- 🎨 **精美 TUI** - 互動式終端機介面，支援語法高亮\n- 🔍 **智慧過濾** - 跨所有日誌欄位的即時搜尋\n- 📊 **即時統計** - 錯誤/警告/資訊一目瞭然\n\n**靈感來源：** 源於開發者在使用 `jq`、`grep`、`awk`、`less` 等多個工具來理解應用日誌時的挫敗感。\n\n### ✨ 核心特性\n\n| 特性 | 描述 |\n|------|------|\n| 📁 **多格式支援** | JSON、logfmt、純文字日誌 - 全部自動處理 |\n| 🎛️ **互動式 TUI** | 全螢幕終端機介面，支援鍵盤導航 |\n| 🔎 **即時過濾** | 按級別、訊息內容或任意欄位過濾 |\n| 📈 **即時統計** | 錯誤/警告/資訊計數，帶視覺化長條圖 |\n| 🌈 **語法高亮** | 顏色編碼的日誌級別，即時視覺識別 |\n| 📤 **匯出 JSON** | 將任意日誌格式轉換為結構化 JSON |\n| 🔄 **管道支援** | 與 `tail -f`、`kubectl logs`、`docker logs` 配合使用 |\n| ⌨️ **Vim 風格按鍵** | 終端機高階使用者熟悉的導航方式 |\n\n### 🚀 快速開始\n\n#### 環境要求\n- Python 3.8 或更高版本\n- pip 套件管理器\n\n#### 安裝\n\n```bash\n# 從 PyPI 安裝（即將推出）\npip install loglens-cli\n\n# 或從原始碼安裝\ngit clone https://github.com/gitstq/loglens-cli.git\ncd loglens-cli\npip install -e .\n```\n\n#### 基本用法\n\n```bash\n# 使用 TUI 開啟日誌檔案\nloglens -f app.log\n\n# 顯示統計資訊\nloglens stats -f app.log\n\n# 僅過濾錯誤\nloglens filter -f app.log --level ERROR\n\n# 搜尋特定文字\nloglens filter -f app.log --search \"database\"\n\n# 從其他命令管道輸入\ntail -f app.log | loglens\nkubectl logs -f my-pod | loglens\n```\n\n#### 鍵盤快捷鍵（TUI 模式）\n\n| 按鍵 | 操作 |\n|------|------|\n| `q` / `Ctrl+C` | 退出 |\n| `f` | 聚焦過濾輸入框 |\n| `c` | 清除所有日誌 |\n| `r` | 重新整理 |\n| `e` | 僅顯示錯誤 |\n| `w` | 顯示警告和錯誤 |\n| `?` | 顯示說明 |\n\n### 📖 詳細使用指南\n\n#### 支援的日誌格式\n\n**JSON 日誌：**\n```json\n{\"timestamp\": \"2024-01-15T10:30:00Z\", \"level\": \"ERROR\", \"message\": \"Connection failed\", \"service\": \"api\"}\n```\n\n**Logfmt 日誌：**\n```\ntime=2024-01-15T10:30:00Z level=info msg=\"Request processed\" duration=45ms\n```\n\n**純文字日誌：**\n```\n2024-01-15 10:30:00 INFO Application started successfully\n```\n\n#### CLI 命令\n\n```bash\n# 統計概覽\nloglens stats -f /var/log/app.log\n\n# 多條件過濾\nloglens filter -f app.log --level ERROR --search \"timeout\" --limit 50\n\n# 匯出為 JSON 以便進一步處理\nloglens export -f app.log \u003e output.json\n```\n\n### 💡 設計思路與迭代規劃\n\n**為什麼選擇 LogLens？**\n\n現代應用生成大量結構化日誌，但大多數開發者仍然依賴 `grep` 和 `tail` 等原始工具。ELK 堆疊或 Grafana Loki 等現有解決方案功能強大，但需要大量的基礎設施投入。\n\nLogLens 填補了空白，提供：\n- **零設定**日誌分析\n- **終端機原生**工作流（無需瀏覽器）\n- **即時啟動**（無需 Docker，無需服務）\n- **通用格式支援**（適用於任何日誌框架）\n\n**後續迭代計劃：**\n- [ ] 日誌模式聚類和異常檢測\n- [ ] 與主流日誌聚合服務整合\n- [ ] 自定義顏色主題和格式化規則\n- [ ] 日誌對比和差異檢視\n- [ ] 效能指標提取\n\n### 📦 打包與部署\n\n```bash\n# 構建分發包\nmake build\n\n# 本地安裝\npip install dist/loglens-cli-*.whl\n\n# 執行測試\nmake test\n\n# 格式化程式碼\nmake format\n```\n\n### 🤝 貢獻指南\n\n歡迎貢獻！請遵循以下規範：\n\n1. Fork 倉庫\n2. 建立功能分支 (`git checkout -b feat/amazing-feature`)\n3. 提交更改 (`git commit -m 'feat: add amazing feature'`)\n4. 推送到分支 (`git push origin feat/amazing-feature`)\n5. 發起 Pull Request\n\n**提交資訊規範：**\n- `feat:` 新功能\n- `fix:` 修復問題\n- `docs:` 文件更新\n- `refactor:` 程式碼重構\n- `test:` 測試變更\n\n### 📄 開源協議\n\n本專案採用 MIT 協議開源 - 詳見 [LICENSE](LICENSE) 檔案。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitstq%2Floglens-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgitstq%2Floglens-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitstq%2Floglens-cli/lists"}