<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Yuna</title>
    <description>The latest articles on DEV Community by Yuna (@yunar-r).</description>
    <link>https://dev.to/yunar-r</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4069422%2F0496686e-bf2c-4cd0-8922-d90974c1352a.png</url>
      <title>DEV Community: Yuna</title>
      <link>https://dev.to/yunar-r</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yunar-r"/>
    <language>en</language>
    <item>
      <title>I built RepoTrek: a terminal-first GitHub source browser in Rust</title>
      <dc:creator>Yuna</dc:creator>
      <pubDate>Sun, 09 Aug 2026 03:05:58 +0000</pubDate>
      <link>https://dev.to/yunar-r/i-built-repotrek-a-terminal-first-github-source-browser-in-rust-326d</link>
      <guid>https://dev.to/yunar-r/i-built-repotrek-a-terminal-first-github-source-browser-in-rust-326d</guid>
      <description>&lt;p&gt;I built &lt;strong&gt;RepoTrek&lt;/strong&gt;, a terminal-first GitHub source browser written in Rust.&lt;/p&gt;

&lt;p&gt;GitHub:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/yuna-r/repotrek" rel="noopener noreferrer"&gt;https://github.com/yuna-r/repotrek&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;crates.io:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://crates.io/crates/repotrek" rel="noopener noreferrer"&gt;https://crates.io/crates/repotrek&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The basic idea is simple:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I wanted a comfortable way to deeply explore GitHub repositories without constantly switching between the browser, terminal, and editor.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;RepoTrek is not intended to replace Git clients such as &lt;code&gt;git&lt;/code&gt;, &lt;code&gt;lazygit&lt;/code&gt;, &lt;code&gt;tig&lt;/code&gt;, or &lt;code&gt;gitui&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Its focus is different:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Git client
    ↓
operate on a repository

RepoTrek
    ↓
explore and read a repository
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Why I built it
&lt;/h2&gt;

&lt;p&gt;When reading open-source projects on GitHub, I often move through a sequence like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Code
 ↓
Blame
 ↓
Commit
 ↓
Diff
 ↓
File history
 ↓
Another file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;GitHub's web interface is excellent, but when I spend a long time reading source code, I prefer staying in the terminal and using the keyboard.&lt;/p&gt;

&lt;p&gt;So I started building a TUI specifically around &lt;strong&gt;source code exploration&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  No clone required
&lt;/h2&gt;

&lt;p&gt;You can open a repository directly from GitHub.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rust-lang/rust
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;torvalds/linux
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;RepoTrek retrieves the repository information through GitHub APIs, so you don't need to clone the entire repository just to inspect it.&lt;/p&gt;

&lt;p&gt;This is especially convenient for quickly looking through large projects.&lt;/p&gt;




&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;p&gt;RepoTrek currently includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Repository tree browsing&lt;/li&gt;
&lt;li&gt;Source code viewer with line numbers&lt;/li&gt;
&lt;li&gt;Syntax highlighting&lt;/li&gt;
&lt;li&gt;Dark / Light themes&lt;/li&gt;
&lt;li&gt;Commit history&lt;/li&gt;
&lt;li&gt;Commit diffs&lt;/li&gt;
&lt;li&gt;File history&lt;/li&gt;
&lt;li&gt;Git blame&lt;/li&gt;
&lt;li&gt;Branch switching&lt;/li&gt;
&lt;li&gt;File search&lt;/li&gt;
&lt;li&gt;Repository-wide code search&lt;/li&gt;
&lt;li&gt;Symbol navigation&lt;/li&gt;
&lt;li&gt;Definition search&lt;/li&gt;
&lt;li&gt;Pull Requests&lt;/li&gt;
&lt;li&gt;Issues&lt;/li&gt;
&lt;li&gt;GitHub Actions&lt;/li&gt;
&lt;li&gt;Releases&lt;/li&gt;
&lt;li&gt;Keyboard-based text selection and copy&lt;/li&gt;
&lt;li&gt;Source/diff wrapping&lt;/li&gt;
&lt;li&gt;HTML export for printing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The interface is designed to make moving between these views fast without leaving the terminal.&lt;/p&gt;




&lt;h2&gt;
  
  
  Source code browsing
&lt;/h2&gt;

&lt;p&gt;The main view works like a terminal-native repository browser.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;src/
├── app.rs
├── auth.rs
├── export.rs
├── highlight.rs
├── provider/
└── ui/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open a file and RepoTrek displays it with line numbers and syntax highlighting.&lt;/p&gt;

&lt;p&gt;Common languages such as Rust, Python, JavaScript, TypeScript, C/C++, Go, Java, YAML, TOML, JSON, Shell, HTML, CSS, and Markdown are recognized.&lt;/p&gt;

&lt;p&gt;Unknown formats simply fall back to plain text.&lt;/p&gt;




&lt;h2&gt;
  
  
  Blame and file history
&lt;/h2&gt;

&lt;p&gt;One feature I especially wanted was the ability to move naturally between:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;source line
    ↓
blame
    ↓
commit
    ↓
diff
    ↓
history
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The current source code often tells you &lt;strong&gt;what&lt;/strong&gt; the program does.&lt;/p&gt;

&lt;p&gt;History often tells you &lt;strong&gt;why&lt;/strong&gt; it became that way.&lt;/p&gt;

&lt;p&gt;That makes blame and file history important parts of RepoTrek rather than secondary features.&lt;/p&gt;




&lt;h2&gt;
  
  
  Commit diffs
&lt;/h2&gt;

&lt;p&gt;Commit diffs include both old and new line numbers.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  81   81     fn example() {
  82          - old_code();
       82     + new_code();
  83   83     }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Added and removed lines also have separate highlighting.&lt;/p&gt;

&lt;p&gt;Long source lines and diffs can be wrapped directly inside the TUI.&lt;/p&gt;




&lt;h2&gt;
  
  
  Search and navigation
&lt;/h2&gt;

&lt;p&gt;RepoTrek provides several ways to move around a repository.&lt;/p&gt;

&lt;h3&gt;
  
  
  File search
&lt;/h3&gt;

&lt;p&gt;Search files by name and quickly jump to a result.&lt;/p&gt;

&lt;h3&gt;
  
  
  Code search
&lt;/h3&gt;

&lt;p&gt;Search repository contents and open matching files directly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Symbol navigation
&lt;/h3&gt;

&lt;p&gt;Inside a source file, &lt;code&gt;@&lt;/code&gt; opens a symbol picker.&lt;/p&gt;

&lt;p&gt;For Rust, for example, RepoTrek can identify things such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;struct
enum
trait
impl
fn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Definition search
&lt;/h3&gt;

&lt;p&gt;Pressing &lt;code&gt;d&lt;/code&gt; searches for likely definitions of the identifier around the current cursor position.&lt;/p&gt;

&lt;p&gt;This is currently heuristic-based rather than a full LSP implementation.&lt;/p&gt;




&lt;h2&gt;
  
  
  GitHub information inside the TUI
&lt;/h2&gt;

&lt;p&gt;RepoTrek is gradually bringing more of the GitHub repository experience into the terminal.&lt;/p&gt;

&lt;p&gt;It can display information for:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Code
Commits
Pull Requests
Issues
Actions
Releases
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When the web interface is still useful, pressing &lt;code&gt;o&lt;/code&gt; opens the corresponding GitHub page.&lt;/p&gt;

&lt;p&gt;The goal isn't to eliminate the browser completely.&lt;/p&gt;

&lt;p&gt;The goal is to make it optional during normal source exploration.&lt;/p&gt;




&lt;h2&gt;
  
  
  Keyboard-first
&lt;/h2&gt;

&lt;p&gt;I wanted the application to remain usable almost entirely from the keyboard.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Shift+J    extend selection downward
Shift+K    extend selection upward
Shift+A    select all
Shift+C    copy

v          Vim-style selection
y          copy selection

Esc        clear selection / go back
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are also shortcuts for searching, switching branches, toggling themes, wrapping lines, and opening external GitHub pages.&lt;/p&gt;




&lt;h2&gt;
  
  
  Dark and Light themes
&lt;/h2&gt;

&lt;p&gt;RepoTrek supports both Dark and Light themes.&lt;/p&gt;

&lt;p&gt;The Light theme is not just an inverted Dark theme.&lt;/p&gt;

&lt;p&gt;Syntax colors, selected lines, active lines, and diff colors are defined separately so source code remains readable in both modes.&lt;/p&gt;

&lt;p&gt;The selected theme is persisted between sessions.&lt;/p&gt;




&lt;h2&gt;
  
  
  Printing source code from a TUI
&lt;/h2&gt;

&lt;p&gt;One slightly unusual feature is HTML export.&lt;/p&gt;

&lt;p&gt;RepoTrek can generate printable HTML for source files and diffs.&lt;/p&gt;

&lt;p&gt;Exports include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Syntax highlighting&lt;/li&gt;
&lt;li&gt;Line numbers&lt;/li&gt;
&lt;li&gt;Old/new diff line numbers&lt;/li&gt;
&lt;li&gt;Added/removed line backgrounds&lt;/li&gt;
&lt;li&gt;Print-oriented layout&lt;/li&gt;
&lt;li&gt;A4 landscape CSS&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Files are automatically written to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;exports/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;with timestamped filenames.&lt;/p&gt;

&lt;p&gt;I sometimes like reading larger pieces of source code away from the editor, so I wanted RepoTrek to treat printing as a real output format rather than an afterthought.&lt;/p&gt;




&lt;h2&gt;
  
  
  Built with Rust and Ratatui
&lt;/h2&gt;

&lt;p&gt;RepoTrek is written in Rust and uses Ratatui for the terminal UI.&lt;/p&gt;

&lt;p&gt;At a high level, the architecture looks roughly like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GitHub API
    ↓
Provider
    ↓
RepoTrek models
    ↓
Application state
    ↓
Ratatui UI
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I intentionally keep GitHub-specific API structures away from most of the UI.&lt;/p&gt;

&lt;p&gt;The idea is to make support for other Git forges possible later.&lt;/p&gt;

&lt;p&gt;Potential future providers could include:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GitLab
Gitea
Forgejo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Cross-platform releases
&lt;/h2&gt;

&lt;p&gt;RepoTrek is built for:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Linux
  x86_64
  ARM64

macOS
  Apple Silicon
  Intel

Windows
  x86_64
  ARM64
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Release builds are automated with GitHub Actions.&lt;/p&gt;

&lt;p&gt;The project is also available through crates.io:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo &lt;span class="nb"&gt;install &lt;/span&gt;repotrek
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  What's next?
&lt;/h2&gt;

&lt;p&gt;RepoTrek is still a v0.x project, so there are many things I want to improve.&lt;/p&gt;

&lt;p&gt;Some ideas include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Better symbol analysis&lt;/li&gt;
&lt;li&gt;LSP integration&lt;/li&gt;
&lt;li&gt;Improved commit graphs&lt;/li&gt;
&lt;li&gt;Better PR review navigation&lt;/li&gt;
&lt;li&gt;More GitHub Actions information&lt;/li&gt;
&lt;li&gt;Smarter caching&lt;/li&gt;
&lt;li&gt;Performance improvements for very large repositories&lt;/li&gt;
&lt;li&gt;GitLab / Gitea / Forgejo support&lt;/li&gt;
&lt;li&gt;Better terminal capability detection&lt;/li&gt;
&lt;li&gt;Mouse support where useful&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But the main goal will stay the same:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Make exploring source code from the terminal enjoyable.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;GitHub:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/yuna-r/repotrek" rel="noopener noreferrer"&gt;https://github.com/yuna-r/repotrek&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;crates.io:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://crates.io/crates/repotrek" rel="noopener noreferrer"&gt;https://crates.io/crates/repotrek&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Install with Cargo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo &lt;span class="nb"&gt;install &lt;/span&gt;repotrek
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you enjoy Rust, TUIs, open source, or simply reading other people's code, I'd love for you to try it.&lt;/p&gt;

&lt;p&gt;Feedback, issues, and pull requests are welcome 🐻🦀&lt;/p&gt;

</description>
      <category>rust</category>
      <category>opensource</category>
      <category>showdev</category>
      <category>cli</category>
    </item>
  </channel>
</rss>
