An open API service indexing awesome lists of open source software.

https://github.com/kyoto7250/gview

TUI app for viewing files managed with git
https://github.com/kyoto7250/gview

cli git ratatui rust tui

Last synced: 10 months ago
JSON representation

TUI app for viewing files managed with git

Awesome Lists containing this project

README

          

# gview - A TUI Viewer for Specific Git Commit IDs

![gview image](resources/gview.png)

gview is a TUI application that lets you inspect files or search for files by traversing Git commit IDs.

Currently, gview displays the repository located in the user's current working directory.

Please note that this application is a personal hobby project and is not in a finished state. It works reliably for medium-sized repositories with a few hundred commits. However, performance may degrade when working with large repositories containing tens of thousands of commits.

# install

```bash
cargo install gview
```

# default keymap

## Global Keys
| Key | Description |
| --- | ----------- |
| ? | Show help modal with all key bindings |
| Tab | Switch focus between panels |
| Ctrl+C | Exit gview |
| < | Decrease left panel width |
| > | Increase left panel width |
| ESC | Close help modal (when open) |

## Filter Panel
| Key | Description |
| --- | ----------- |
| Enter | Apply filter |
| Ctrl+A | Select all text |

## File List Panel
| Key | Description |
| --- | ----------- |
| , , j, k | Navigate through files |
| Enter | Select file |

## Commit Panel
| Key | Description |
| --- | ----------- |
| o | Open commit modal |

## Content Viewer
| Key | Description |
| --- | ----------- |
| , , j, k | Scroll content vertically |
| , , h, l | Scroll content horizontally |
| b | Toggle blame view |
| n | Toggle line numbers |
| g | Open current file in browser at current commit and line |

## Help Modal

Press ? at any time to open an interactive help modal that displays all available key bindings. The help modal:

- Shows context-sensitive help organized by panel
- Works in any terminal size (responsive design)
- Features a clean double-line border design
- Can be closed by pressing ESC

This makes it easy to learn and remember all the keyboard shortcuts without leaving the application.

## Browser Integration

When viewing a file, press g to open the current file in your web browser. This feature:

- Opens the file at the exact commit ID you're viewing in gview
- Highlights the line that's currently at the top of your view
- Works with GitHub, GitHub Enterprise, and other Git hosting services
- Supports both SSH and HTTPS remote URLs
- Works cross-platform (macOS, Linux, Windows)

**Example**: If you're viewing `src/main.rs` at commit `abc123f` with line 42 at the top of the screen, pressing g will open:
```
https://github.com/owner/repo/blob/abc123f/src/main.rs#L42
```

# contribution

Contributions are always welcome! Please note that responses may not be immediate, as this is maintained on a best-effort basis.
There are still several implementation tasks that would improve usability and are relatively easy to tackle. Check the Issues page for more details.

# LICENSE
This project is licensed under the MIT License.