The theme block sets the Default preset colors; custom_theme is used

July 6, 2026 ยท View on GitHub

TRX

A fast, keyboard-driven TUI package manager written in Rust.

Search 50,000+ packages in under 50ms. Install, remove, and update without leaving your terminal.


Rust License Platform

๐Ÿ“‘ Table of Contents

TRX in action

What is TRX?

TRX is a terminal UI built on top of your existing package manager. It gives you a unified, keyboard-first interface for searching, inspecting, and managing packages, whether you're on macOS with Homebrew, Arch with Pacman + AUR, or Debian/Ubuntu with APT.

No daemon required. Fully configurable via config.toml or the in-app Settings tab.


Features

  • Renderer built on ratatui with deterministic layout and minimal redraw overhead
  • Fully non-blocking event loop using OS threads and mpsc channels (no async runtime overhead)
  • Unified command model for package managers with pluggable backend architecture
  • Tiered fuzzy search โ€” five-tier scorer: exact โ†’ prefix โ†’ word-boundary โ†’ consecutive โ†’ subsequence; results ranked by relevance
  • Install and remove packages without leaving the TUI (i, x keys)
  • Settings & Themes โ€“ Configure keybindings, themes (Nord, Dracula, etc.), and UI styles in-app
  • Mouse Support โ€“ Full navigation and interaction via mouse
  • Self-updating mechanism โ€“ Checks for new releases on startup and updates automatically
  • Search result caching โ€“ Repeat queries are served instantly from an in-memory cache
  • Stateless backend operations executed via system calls with structured output parsing
  • Extensible design suitable for adding new package managers without modifying the core engine

Installation

curl -fsSL https://trx.pidev.tech/install.sh | sh

From source

git clone https://github.com/pie-314/trx.git
cd trx
cargo build --release
sudo cp target/release/trx /usr/local/bin/

Requirements: Rust 1.70+ ยท Unicode/truecolor terminal

Cargo

cargo install trx-cli

Usage

trx

Keybindings

KeyAction
eEnter search mode
โ†‘ / โ†“ or j / kNavigate list
spaceToggle package selection
iInstall selected package(s)
xRemove selected package(s)
USystem-wide upgrade
RRefresh package databases
TabSwitch tab (Search โ†’ Installed โ†’ Updates โ†’ Settings)
?Toggle help overlay (quick keybinding reference)
q / EscQuit / exit current mode

All keybindings are configurable in ~/.config/trx/config.toml.


Architecture

src/
โ”œโ”€โ”€ main.rs              # Entry point, terminal setup
โ”œโ”€โ”€ config.rs            # Configuration and Theme management
โ”œโ”€โ”€ updater.rs           # Self-update logic
โ”œโ”€โ”€ ui/
โ”‚   โ”œโ”€โ”€ app.rs           # App state, event loop, channel polling
โ”‚   โ”œโ”€โ”€ draw.rs          # UI rendering and layout
โ”‚   โ””โ”€โ”€ input.rs         # Input mode handling
โ”œโ”€โ”€ managers/
โ”‚   โ”œโ”€โ”€ mod.rs           # PackageManager trait, shared parsing
โ”‚   โ”œโ”€โ”€ arch.rs          # Parallel Pacman + AUR (RPC API) backend
โ”‚   โ”œโ”€โ”€ apt.rs           # APT backend
โ”‚   โ””โ”€โ”€ brew.rs          # Homebrew backend
โ””โ”€โ”€ fuzzy/
    โ””โ”€โ”€ mod.rs           # Substring-optimized scoring engine

PackageManager trait

pub trait PackageManager: Send + Sync {
    fn name(&self) -> &str;
    fn search(&self, query: &str) -> Vec<Package>;
    fn get_installed(&self) -> HashSet<String>;
    fn get_installed_details(&self) -> Vec<Package>;
    fn get_updates(&self) -> Vec<Package>;
    fn get_details(&self, pkg: &str, provider: &str) -> Option<HashMap<String, String>>;
    fn install(&self, terminal: &mut DefaultTerminal, pkgs: &HashSet<String>) -> Result<(), Box<dyn std::error::Error>>;
    fn remove(&self, terminal: &mut DefaultTerminal, pkgs: &HashSet<String>) -> Result<(), Box<dyn std::error::Error>>;
    fn system_upgrade(&self, terminal: &mut DefaultTerminal) -> Result<(), Box<dyn std::error::Error>>;
    fn refresh_databases(&self, terminal: &mut DefaultTerminal) -> Result<(), Box<dyn std::error::Error>>;
}

Concurrency model

Search, list loads, and detail fetches all run on OS threads communicating via std::sync::mpsc. The main loop polls keyboard/mouse input with a short timeout, redraws each frame, and non-blockingly drains result channels. Large searches (like Arch + AUR) are parallelized using Rayon.


Supported Package Managers

ManagerPlatformStatus
PacmanArch Linuxโœ… Implemented
yay (AUR)Arch Linuxโœ… Implemented
APTDebian / Ubuntuโœ… Implemented
HomebrewmacOS / Linuxโœ… Implemented
dnf / yumFedora / RHEL๐Ÿ”œ Planned
zypperopenSUSE๐Ÿ”œ Planned
winget / scoopWindows๐Ÿ”œ Planned

Configuration

TRX stores its config at ~/.config/trx/config.toml (created automatically on first run).

aur_helper = "yay"          # AUR helper used for AUR installs/removals (yay, paru, etc.)
theme_name = "Default"      # Default, Nord, Dracula, OneDark, Gruvbox, Solarized, Custom

[settings]
search_debounce_ms = 200    # Delay (ms) before triggering search after typing stops
max_search_results = 50     # Maximum number of packages shown in search results
auto_update_check = true    # Check for TRX updates on startup
auto_cleanup = false        # Remove unused package caches after operations
default_tab = "Search"      # Starting tab: Search, Installed, Updates, Settings
border_style = "Rounded"    # Border style: Plain, Rounded, Double, Thick
spinner_type = "Dots"       # Loading spinner: Dots, Bars, Pulse, Classic
enabled_managers = ["pacman", "yay", "brew", "apt"]
skipped_update_version = "" # Version string that the user chose to skip (managed automatically)

[keys]
quit = "q"
install = "i"
remove = "x"
search_edit = "e"
toggle_select = " "
tab_next = "Tab"
tab_prev = "BackTab"
system_upgrade = "U"
refresh_db = "R"
help = "?"

# The `theme` block sets the Default preset colors; `custom_theme` is used
# when theme_name = "Custom".  Only one of the two is active at a time.
[theme]
border_color = "blue"
highlight_color = "yellow"
success_color = "green"
error_color = "red"
text_primary = "white"
text_secondary = "cyan"
# Colors can be named ("blue", "cyan", etc.) or hex ("#81A1C1")

Roadmap

  • Configurable keybindings via config file
  • Pluggable themes and renderer settings
  • Settings Tab for in-app configuration
  • Mouse support
  • Package update (per-package, not just system upgrade)
  • Search result caching for repeated queries
  • AUR search via RPC API (no yay dependency for search)
  • Transaction history and rollback
  • Batch mode for scripting / CI use
  • Dependency graph visualizer
  • Plugin system for custom backends and widgets
  • Binary releases via GitHub Actions

Contributing

Contributions are welcome. If you're interested in Rust, terminal UIs, or package manager internals, pick an open issue or start a discussion.

See CONTRIBUTING.md for guidelines.


License

MIT. See LICENSE for details.