[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-73354":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":33,"readmeContent":34,"aiSummary":35,"trendingCount":16,"starSnapshotCount":16,"syncStatus":36,"lastSyncTime":37,"discoverSource":38},73354,"lumen","jnsahaj\u002Flumen","jnsahaj","Beautiful git diff viewer, generate commits with AI, get summary of changes, all from the CLI","",null,"Rust",2402,115,4,32,0,17,61,281,51,108.19,"MIT License",false,"main",true,[27,28,29,30,31,32],"cli","commit","git","llm","openai","rust","2026-06-12 04:01:09","\u003Cp align=\"center\">\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F896f9239-134a-4428-9bb5-50ea59cdb5c3\" alt=\"lumen\" \u002F>\u003C\u002Fp>\n\n# lumen\n\nA fast terminal diff viewer and code review TUI, written in Rust.\n\n[![Crates.io Total Downloads](https:\u002F\u002Fimg.shields.io\u002Fcrates\u002Fd\u002Flumen?label=downloads%20%40crates.io)](https:\u002F\u002Fcrates.io\u002Fcrates\u002Flumen)\n[![GitHub Releases](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fdownloads\u002Fjnsahaj\u002Flumen\u002Ftotal?label=dowloads%20%40releases)](https:\u002F\u002Fgithub.com\u002Fjnsahaj\u002Flumen\u002Freleases)\n![GitHub License](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002Fjnsahaj\u002Flumen)\n![Crates.io Size](https:\u002F\u002Fimg.shields.io\u002Fcrates\u002Fsize\u002Flumen)\n\nReview `git diff`, commits, branches, or GitHub PRs side-by-side without leaving your terminal. Ships as a single static Rust binary and stays snappy on multi-thousand-line diffs.\n\n- Side-by-side diff viewer with tree-sitter syntax highlighting\n- Review GitHub Pull Requests with `lumen diff --pr 123`\n- Annotate selections, hunks, or whole files\n- Watch mode and stacked-commit review\n- Optional AI commit messages and change explanations (10+ providers)\n- Works with Git and Jujutsu (jj)\n\n[![Demo](https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fdc425871-3826-4368-88d8-931b9403f0ec)](https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F70d07324-8394-423c-bbc3-9460ed84877b)\n\n## Special Thanks\n\u003Cdiv align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fcoderabbit.link\u002Flumen-oss\">\n    \u003Cimg width=\"2152\" height=\"313\" alt=\"image\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fa2039a9d-5c9c-4a8e-a063-753c319f2e20\" \u002F>\n  \u003C\u002Fa>\n\u003C\u002Fdiv>\n\n## Table of Contents\n- [Getting Started](#getting-started-)\n  - [Prerequisites](#prerequisites)\n  - [Installation](#installation)\n- [Usage](#usage-)\n  - [Visual Diff Viewer](#visual-diff-viewer)\n- [AI Features](#ai-features-)\n  - [Configuration](#configuration)\n  - [Generate Commit Messages](#generate-commit-messages)\n  - [Generate Git Commands](#generate-git-commands)\n  - [Explain Changes](#explain-changes)\n  - [Tips & Tricks](#tips--tricks)\n  - [AI Providers](#ai-providers)\n- [Advanced Configuration](#advanced-configuration-)\n  - [Configuration File](#configuration-file)\n  - [Configuration Precedence](#configuration-precedence)\n\n## Getting Started 🔅\n\n### Prerequisites\nBefore you begin, ensure you have:\n1. `git` installed on your system\n2. [fzf](https:\u002F\u002Fgithub.com\u002Fjunegunn\u002Ffzf) (optional) - Required for `lumen explain --list` command\n3. [mdcat](https:\u002F\u002Fgithub.com\u002Fswsnr\u002Fmdcat) (optional) - Required for pretty output formatting\n\n### Installation\n\n#### Using Homebrew (MacOS and Linux)\n```bash\nbrew install jnsahaj\u002Flumen\u002Flumen\n```\n\n#### Using Cargo\n> [!IMPORTANT]\n> `cargo` is a package manager for `rust`,\n> and is installed automatically when you install `rust`.\n> See [installation guide](https:\u002F\u002Fdoc.rust-lang.org\u002Fcargo\u002Fgetting-started\u002Finstallation.html)\n```bash\ncargo install lumen\n```\n\n## Usage 🔅\n\n### Visual Diff Viewer\n\nLaunch an interactive side-by-side diff viewer in your terminal:\n\u003Cimg width=\"3456\" height=\"2158\" alt=\"image\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fdc425871-3826-4368-88d8-931b9403f0ec\" \u002F>\n\n```bash\n# View uncommitted changes\nlumen diff\n\n# View changes for a specific commit\nlumen diff HEAD~1\n\n# View changes between branches\nlumen diff main..feature\u002FA\n\n# View changes in a GitHub Pull Request\nlumen diff --pr 123 # (--pr is optional)\nlumen diff https:\u002F\u002Fgithub.com\u002Fowner\u002Frepo\u002Fpull\u002F123\n\n# Filter to specific files\nlumen diff --file src\u002Fmain.rs --file src\u002Flib.rs\n\n# Watch mode - auto-refresh on file changes\nlumen diff --watch\n\n# Stacked mode - review commits one by one\nlumen diff main..feature --stacked\n\n# Jump to a specific file on open\nlumen diff --focus src\u002Fmain.rs\n```\n\n#### Stacked Diff Mode\n\nReview a range of commits one at a time with `--stacked`:\n\n```bash\nlumen diff main..feature --stacked\nlumen diff HEAD~5..HEAD --stacked\n```\n\nThis displays each commit individually, letting you navigate through them:\n- `ctrl+h` \u002F `ctrl+l`: Previous \u002F next commit\n- Click the `‹` \u002F `›` arrows in the header\n\nThe header shows the current commit position, SHA, and message. Viewed files are tracked per commit, so your progress is preserved when navigating.\n\nWhen viewing a PR, you can mark files as viewed (syncs with GitHub) using the `space` keybinding.\n\n#### Theme Configuration\n\nCustomize the diff viewer colors with preset themes:\n\n```bash\n# Using CLI flag\nlumen diff --theme dracula\n\n# Using environment variable\nLUMEN_THEME=catppuccin-mocha lumen diff\n\n# Or set permanently in config file (~\u002F.config\u002Flumen\u002Flumen.config.json)\n{\n  \"theme\": \"dracula\"\n}\n```\n\n**Available themes:**\n| Theme | Value |\n|-------|-------|\n| Default (auto-detect) | `dark`, `light` |\n| Catppuccin | `catppuccin-mocha`, `catppuccin-latte` |\n| Dracula | `dracula` |\n| Nord | `nord` |\n| One Dark | `one-dark` |\n| Gruvbox | `gruvbox-dark`, `gruvbox-light` |\n| Solarized | `solarized-dark`, `solarized-light` |\n\nPriority: CLI flag > config file > `LUMEN_THEME` env var > OS auto-detect.\n\n#### Selection & Annotations\n\n**Selection**: Click-drag in the content area for character-level selection, or on line numbers for line-level selection. Selected text can be copied or annotated.\n\n**Annotations**: Add review comments at three levels of granularity:\n- **Selection** — select lines with mouse, press `i` to annotate the selected range\n- **Hunk** — focus a hunk with `{`\u002F`}`, press `i` to annotate the hunk\n- **File** — press `i` with no selection or hunk focus to annotate the whole file\n\nAnnotated lines display a `▍` gutter indicator. Use `I` to view, edit, delete, copy, or export all annotations.\n\n#### Keybindings\n\n- `j\u002Fk` or arrow keys: Navigate\n- `{\u002F}`: Jump between hunks\n- `tab`: Toggle sidebar\n- `space`: Mark file as viewed\n- `e`: Open file in editor\n- `y`: Copy selection (or filename)\n- `i`: Annotate selection \u002F hunk \u002F file\n- `I`: View all annotations\n- `ctrl+h\u002Fl`: Previous\u002Fnext commit (stacked mode)\n- `?`: Show all keybindings\n\n## AI Features 🔅\n\nLumen also bundles optional AI helpers for commit messages, explanations, and natural-language git commands. These require configuring an AI provider — the diff viewer above does not.\n\n### Configuration\n\nRun `lumen configure` for interactive setup (provider, API key, model). Settings are saved to `~\u002F.config\u002Flumen\u002Flumen.config.json`.\n\n### Generate Commit Messages\n\nCreate meaningful commit messages for your staged changes:\n\n```bash\n# Basic usage - generates a commit message based on staged changes\nlumen draft\n# Output: \"feat(button.tsx): Update button color to blue\"\n\n# Add context for more meaningful messages\nlumen draft --context \"match brand guidelines\"\n# Output: \"feat(button.tsx): Update button color to align with brand identity guidelines\"\n```\n\n### Generate Git Commands\n\nAsk Lumen to generate Git commands based on a natural language query:\n\n```bash\nlumen operate \"squash the last 3 commits into 1 with the message 'squashed commit'\"\n# Output: git reset --soft HEAD~3 && git commit -m \"squashed commit\" [y\u002FN]\n```\n\nThe command will display an explanation of what the generated command does, show any warnings for potentially dangerous operations, and prompt for confirmation before execution.\n\n### Explain Changes\n\nUnderstand what changed and why:\n\n```bash\n# Working directory or staged changes\nlumen explain\nlumen explain --staged\n\n# Specific commits or ranges\nlumen explain HEAD\nlumen explain HEAD~3..HEAD\nlumen explain main..feature\u002FA\n\n# Ask specific questions\nlumen explain --query \"What's the performance impact of these changes?\"\n\n# Interactive commit selection (requires: fzf)\nlumen explain --list\n```\n\n### Tips & Tricks\n\n```bash\n# Copy commit message to clipboard (macOS \u002F Linux)\nlumen draft | pbcopy\nlumen draft | xclip -selection c\n\n# Directly commit using the generated message\nlumen draft | git commit -F -\n```\n\n[lazygit](https:\u002F\u002Fgithub.com\u002Fjesseduffield\u002Flazygit) integration is available — see the [user config docs](https:\u002F\u002Fgithub.com\u002Fjesseduffield\u002Flazygit\u002Fblob\u002Fmaster\u002Fdocs\u002FConfig.md) for binding `lumen draft` to a custom command.\n\n### AI Providers\n\nConfigure your preferred AI provider:\n\n```bash\n# Using CLI arguments\nlumen -p openai -k \"your-api-key\" -m \"gpt-5-mini\" draft\n\n# Using environment variables\nexport LUMEN_AI_PROVIDER=\"openai\"\nexport LUMEN_API_KEY=\"your-api-key\"\nexport LUMEN_AI_MODEL=\"gpt-5-mini\"\n```\n\n#### Supported Providers\n\n| Provider | API Key Required | Models |\n|----------|-----------------|---------|\n| [OpenAI](https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fmodels) `openai` (Default) | Yes | `gpt-5.2`, `gpt-5`, `gpt-5-mini`, `gpt-5-nano`, `gpt-4.1`, `gpt-4.1-mini`, `o4-mini` (default: `gpt-5-mini`) |\n| [Claude](https:\u002F\u002Fwww.anthropic.com\u002Fpricing) `claude` | Yes | `claude-sonnet-4-5-20250930`, `claude-opus-4-5-20251115`, `claude-haiku-4-5-20251015` (default: `claude-sonnet-4-5-20250930`) |\n| [Gemini](https:\u002F\u002Fai.google.dev\u002F) `gemini` | Yes (free tier) | `gemini-3-pro`, `gemini-3-flash-preview`, `gemini-2.5-pro`, `gemini-2.5-flash`, `gemini-2.5-flash-lite` (default: `gemini-2.5-flash`) |\n| [Groq](https:\u002F\u002Fconsole.groq.com\u002Fdocs\u002Fmodels) `groq` | Yes (free) | `llama-3.3-70b-versatile`, `llama-3.1-8b-instant`, `meta-llama\u002Fllama-4-maverick-17b-128e-instruct`, `openai\u002Fgpt-oss-120b` (default: `llama-3.3-70b-versatile`) |\n| [DeepSeek](https:\u002F\u002Fwww.deepseek.com\u002F) `deepseek` | Yes | `deepseek-chat` (V3.2), `deepseek-reasoner` (default: `deepseek-chat`) |\n| [xAI](https:\u002F\u002Fx.ai\u002F) `xai` | Yes | `grok-4`, `grok-4-mini`, `grok-4-mini-fast` (default: `grok-4-mini-fast`) |\n| [OpenCode Zen](https:\u002F\u002Fopencode.ai\u002Fdocs\u002Fzen) `opencode-zen` | Yes | [see list](https:\u002F\u002Fopencode.ai\u002Fdocs\u002Fzen#models) (default: `claude-sonnet-4-5`) |\n| [Ollama](https:\u002F\u002Fgithub.com\u002Follama\u002Follama) `ollama` | No (local) | [see list](https:\u002F\u002Follama.com\u002Flibrary) (default: `llama3.2`) |\n| [OpenRouter](https:\u002F\u002Fopenrouter.ai\u002F) `openrouter` | Yes | [see list](https:\u002F\u002Fopenrouter.ai\u002Fmodels) (default: `anthropic\u002Fclaude-sonnet-4.5`) |\n| [Vercel AI Gateway](https:\u002F\u002Fvercel.com\u002Fdocs\u002Fai-gateway) `vercel` | Yes | [see list](https:\u002F\u002Fvercel.com\u002Fdocs\u002Fai-gateway\u002Fsupported-models) (default: `anthropic\u002Fclaude-sonnet-4.5`) |\n\n## Advanced Configuration 🔅\n\n### Configuration File\nLumen supports configuration through a JSON file. You can place the configuration file in one of the following locations:\n\n1. Project Root: Create a lumen.config.json file in your project's root directory.\n2. Custom Path: Specify a custom path using the --config CLI option.\n3. Global Configuration (Optional): Place a lumen.config.json file in your system's default configuration directory:\n    - Linux\u002FmacOS: `~\u002F.config\u002Flumen\u002Flumen.config.json`\n    - Windows: `%USERPROFILE%\\.config\\lumen\\lumen.config.json`\n\nLumen will load configurations in the following order of priority:\n\n1. CLI arguments (highest priority)\n2. Configuration file specified by --config\n3. Project root lumen.config.json\n4. Global configuration file (lowest priority)\n\n```json\n{\n  \"provider\": \"openai\",\n  \"model\": \"gpt-5-mini\",\n  \"api_key\": \"sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\n  \"theme\": \"catppuccin-mocha\",\n  \"draft\": {\n    \"commit_types\": {\n      \"docs\": \"Documentation only changes\",\n      \"style\": \"Changes that do not affect the meaning of the code\",\n      \"refactor\": \"A code change that neither fixes a bug nor adds a feature\",\n      \"perf\": \"A code change that improves performance\",\n      \"test\": \"Adding missing tests or correcting existing tests\",\n      \"build\": \"Changes that affect the build system or external dependencies\",\n      \"ci\": \"Changes to our CI configuration files and scripts\",\n      \"chore\": \"Other changes that don't modify src or test files\",\n      \"revert\": \"Reverts a previous commit\",\n      \"feat\": \"A new feature\",\n      \"fix\": \"A bug fix\"\n    }\n  }\n}\n```\n\n### Configuration Precedence\nOptions are applied in the following order (highest to lowest priority):\n1. CLI Flags\n2. Configuration File\n3. Environment Variables\n4. Default options\n\nExample: Using different providers for different projects:\n```bash\n# Set global defaults in .zshrc\u002F.bashrc\nexport LUMEN_AI_PROVIDER=\"openai\"\nexport LUMEN_AI_MODEL=\"gpt-5-mini\"\nexport LUMEN_API_KEY=\"sk-xxxxxxxxxxxxxxxxxxxxxxxx\"\n\n# Override per project using config file\n{\n  \"provider\": \"ollama\",\n  \"model\": \"llama3.2\"\n}\n\n# Or override using CLI flags\nlumen -p \"ollama\" -m \"llama3.2\" draft\n```\n## Contributors\n\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fjnsahaj\u002Flumen\u002Fgraphs\u002Fcontributors\">\n  \u003Cimg src=\"https:\u002F\u002Fcontrib.rocks\u002Fimage?repo=jnsahaj\u002Flumen\" \u002F>\n\u003C\u002Fa>\n\nMade with [contrib.rocks](https:\u002F\u002Fcontrib.rocks).\n\n### Interested in Contributing?\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n# Star History\n\n\u003Cp align=\"center\">\n  \u003Ca target=\"_blank\" href=\"https:\u002F\u002Fstar-history.com\u002F#jnsahaj\u002Flumen&Date\">\n    \u003Cpicture>\n      \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"https:\u002F\u002Fapi.star-history.com\u002Fsvg?repos=jnsahaj\u002Flumen&type=Date&theme=dark\">\n      \u003Cimg alt=\"GitHub Star History for jnsahaj\u002Flumen\" src=\"https:\u002F\u002Fapi.star-history.com\u002Fsvg?repos=jnsahaj\u002Flumen&type=Date\">\n    \u003C\u002Fpicture>\n  \u003C\u002Fa>\n\u003C\u002Fp>\n","lumen 是一个美观的 Git 差异查看器，能够通过命令行界面生成 AI 辅助的提交信息并提供更改摘要。它使用 Rust 语言编写，具有树状语法高亮显示的并排差异查看功能，支持审查 GitHub Pull Requests，并且可以注释选择、块或整个文件。此外，lumen 还提供了多种 AI 功能，如自动生成提交信息和解释代码变更（支持超过10种AI提供商）。适合需要频繁进行代码审查和版本控制操作的开发者使用，在处理多千行差异时仍能保持高效响应。",2,"2026-06-11 03:45:09","high_star"]