Awesome Go

rummage

CategoryCommand Line
SubcategoryAdvanced Console UIs
Stars0

Cross-platform terminal file/folder picker with fuzzy search, multi-select, and a preview pane

About rummage

rummage

A TUI file picker, file explorer, and fuzzy finder for Go! Browse, search, and select files or folders from the terminal like the ultimate superuser you are.

CI Go Reference Go Report Card codecov

A cross-platform, terminal-based (TUI) file and folder picker, explorer, and fuzzy finder for Go. Works consistently across Windows, macOS, Linux, BSD, WSL, and Git Bash with zero OS-specific dependencies.

path, err := finder.PickFile()   // one import, one line

Most Go terminal pickers are components you wire into your own Bubble Tea update/view loop. rummage is the batteries-included alternative: a single call that returns the selected path — with fuzzy search, multi-select, a preview pane, and interactive create/delete built in — yet it still embeds as a Bubble Tea sub-model when you want full control.

Why rummage?

rummagebubbles/filepickerhuh file fieldgo-fuzzyfinder
One-line standalone API✅❌❌✅
Embeddable Bubble Tea sub-model✅✅➖ form field❌
Directory tree navigation✅✅✅❌ list only
Fuzzy search + highlight✅❌❌✅
Multi-select✅❌❌✅
File-or-folder (ModeAny)✅➖❌❌
Interactive create / delete✅❌❌❌
Preview pane✅❌❌✅
Custom io/fs.FS backend✅❌❌➖

See docs/POSITIONING.md for the full landscape analysis.

See it in action

Preview pane — a file's head, a directory's listing, or metadata, beside the cursor:

Multi-select across directories — toggle with space/tab; selections persist as you navigate in and out of folders:

Interactive create / delete — make files and folders (or delete entries) without leaving the picker (n / N / d):

All recordings are reproducible — run make demos to regenerate them (see docs/demo/).

Features

  • Four picker modes: single file, single folder, any (file or folder), and multi-select
  • Fuzzy search filtering: press / to filter entries in real time, ranked best-match-first with matched characters highlighted (opt out with WithFuzzySearch(false) for plain substring matching)
  • Interactive mode: create files/folders and delete entries without leaving the picker
  • Glob-based file filtering (*.go, *.txt, etc.)
  • Hidden file support: toggle at runtime, or force-show with distinct dim styling
  • Symlink expansion: optionally resolve symlinks to real paths
  • Pluggable filesystem: browse any io/fs.FS (e.g. embed.FS, fstest.MapFS) via WithFS — defaults to the host OS
  • Preview pane: optional side pane (WithPreview) showing a file's head, a directory's listing, or metadata; customizable via WithPreviewFunc
  • Standalone or embeddable: one-line PickFile() etc., or embed the picker as a Bubble Tea sub-model with New (reports completion via DoneMsg)
  • Smart truncation: long paths and filenames are truncated with … to fit the terminal
  • Fully customizable: override any keybinding or visual style
  • Vim-style navigation (h/j/k/l) plus standard arrow keys
  • WSL path conversion utilities (/mnt/c/... ↔ C:\...)
  • Alt-screen mode: restores terminal on exit
  • No cgo, no external dependencies beyond pure-Go TUI libraries

Install

go get github.com/rummage-dev/rummage@latest

Quick Start

package main

import (
    "fmt"
    finder "github.com/rummage-dev/rummage"
)

func main() {
    path, err := finder.PickFile(
        finder.WithStartDir("~/projects"),
        finder.WithFilter("*.go"),
    )
    if err != nil {
        panic(err)
    }
    fmt.Println("Selected:", path)
}

Pick a folder

dir, err := finder.PickFolder()

Pick a file or folder

path, err := finder.PickAny()

Multi-select

paths, err := finder.PickMultiple(
    finder.WithFilter("*.log", "*.txt"),
    finder.WithHidden(true),
)

Restrict to document types

WithExtensions limits the picker to a set of extensions, matched case-insensitively (so Report.PDF is included). Use it instead of WithFilter("*.pdf") when you want the common "only allow these file types" behavior without worrying about case:

path, err := finder.PickFile(
    finder.WithExtensions("pdf", "docx", "doc"),
)

Interactive mode (create/delete)

path, err := finder.PickFile(
    finder.WithInteractive(true),
)

Custom keybindings and styles

km := finder.DefaultKeyMap()
km.Cancel = key.NewBinding(key.WithKeys("x"), key.WithHelp("x", "exit"))

s := finder.DefaultStyles()
s.Directory = lipgloss.NewStyle().Foreground(lipgloss.Color("82")).Bold(true)

path, err := finder.PickFile(
    finder.WithKeyMap(km),
    finder.WithStyles(s),
)

Embed in your own Bubble Tea app

The Pick* functions run a standalone program. To embed the picker as a sub-model in an existing Bubble Tea program, use New, which returns a model in embedded mode: it never quits your program and reports completion via finder.DoneMsg.

type parent struct{ picker finder.Model }

func (m parent) Init() tea.Cmd { return m.picker.Init() }

func (m parent) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
    if done, ok := msg.(finder.DoneMsg); ok {
        if done.State == finder.StateSelected {
            // use done.Paths
        }
        return m, tea.Quit // or switch to another view
    }
    updated, cmd := m.picker.Update(msg)
    m.picker = updated.(finder.Model)
    return m, cmd
}

func (m parent) View() string { return m.picker.View() }

// finder.New(finder.WithMode(finder.ModeFile), finder.WithPreview(true))

See examples/embedded for a complete program.

Keybindings

Navigation

KeyAction
up / kMove cursor up
down / jMove cursor down
pgup / ctrl+uPage up
pgdn / ctrl+dPage down
g / homeJump to top
G / endJump to bottom
right / lOpen directory
backspace / left / h / escGo to parent directory

Selection

KeyActionModes
enterSelect file / open directoryAll modes
space / tabToggle selection / select itemMulti-select, Any
ctrl+aToggle all selectionsMulti-select
sSelect current directoryFolder, Any

Other

KeyAction
/Search / filter entries (live)
.Toggle hidden files
nNew file (interactive mode)
NNew folder (interactive mode)
d / deleteDelete entry (interactive mode)
q / ctrl+cCancel and exit

Search mode

KeyAction
Type charactersFilter entries live (fuzzy, ranked, matches highlighted)
backspaceRemove last character (widens results)
enterAccept filtered results
escCancel search, restore full list

Interactive input (new file/folder)

KeyAction
Type charactersEnter name
enterCreate the file or folder
escCancel

Typing a name ending with / when creating a file (e.g. mydir/) creates a directory instead.

Examples

# File picker (all flags)
go run ./examples/basic

# Folder picker
go run ./examples/folder

# Multi-select with filters
go run ./examples/multi

# Restrict to file extensions (case-insensitive, opt-in)
go run ./examples/extensions

# Interactive mode (create/delete)
go run ./examples/interactive

# Custom keybindings and styles
go run ./examples/custom

# Preview pane (built-in or custom)
go run ./examples/preview

# Embedded as a Bubble Tea sub-model
go run ./examples/embedded

The basic example supports flags for all options:

go run ./examples/basic -mode folder
go run ./examples/basic -mode multi -filter "*.go"
go run ./examples/basic -hidden
go run ./examples/basic -interactive
go run ./examples/basic -dir /tmp
go run ./examples/basic -expand -dir ~/symlink

Documentation

Requirements

  • Go 1.25+
  • A terminal with ANSI escape code support (virtually all modern terminals)

Acknowledgments

rummage stands on the shoulders of the excellent Charm ecosystem and a few other great libraries:

  • Bubble Tea — the Elm-style TUI framework rummage is built on.
  • Lip Gloss — all styling and layout.
  • Bubbles — its key package powers the overridable keybindings.
  • sahilm/fuzzy — scored fuzzy matching and match highlighting for search (the same matcher bubbles/list uses).
  • golang.org/x/term — terminal size and capability detection.

A huge thank-you to Charm for making terminal UIs in Go a joy.

License

MIT - see LICENSE for details.

Frequently Asked Questions

What is rummage?

rummage is a Command Line library for the Go programming language. Cross-platform terminal file/folder picker with fuzzy search, multi-select, and a preview pane

How do I install rummage?

Install rummage with the Go module system using `go get rummage-dev/rummage`. Check the repository for the current installation instructions.

What category does rummage belong to?

rummage is listed under Command Line, specifically Advanced Console UIs.

← Back to Advanced Console UIs