glint

command module
v0.11.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2026 License: GPL-3.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

glint

A modern ls for people and for AI coding agents.

Go Release License

glint showing a grid, a long listing and a tree

glint lists directories with icons, colors and git status, and goes a bit further than ls where that's useful: it can preview files, search their contents, show how a folder of projects is doing, and draw a map of what's using your disk. It also has a plain-text mode for coding agents that describes a repository in one call, using far fewer tokens than tree.

It's a single Go binary and starts in about 4 ms, so it's fine to alias over ls.

Install

go install github.com/Vaspyyy/glint@latest

You'll need Go 1.26 or newer (older versions fetch the right toolchain on their own). Icons need a Nerd Font; without one, use --icons never. Content search in the browser uses ripgrep, moving files to the trash uses gio, and media durations in --peek come from ffprobe if it's installed.

glint is developed on Linux. It also builds on macOS and the BSDs, but gets less testing there. Windows isn't supported yet.

For fish, this adds completions, a gi command that browses and then cds to wherever you quit, and an optional listing after every cd:

glint --init fish --auto-ls | source    # in ~/.config/fish/config.fish

Listing files

Plain glint prints a grid. The other views:

Command View
glint -l Long listing with permissions, sizes, relative times and git status
glint -T, glint -lT Tree, or a tree with the long columns (-L 2 limits the depth)
glint -p Adds a short description of each entry: the project type of a folder, the line count of a text file, image dimensions, media duration, archive contents
glint -lcH Adds the last commit touching each entry and how often it changes
glint -C A summary card for a project: stack, branch, languages, lines of code, TODOs
glint --thumbs Image thumbnails, using the kitty graphics protocol or half-block characters
glint -W Keeps the listing open and updates it as files change
glint --json One JSON document for scripts and agents (see JSON)

The usual filters work with every view: -a for hidden files, -D and -f for only folders or only files, -I '*.tmp' to hide by pattern, --gitignore, --changed for files with uncommitted changes, and --since 2h for recently modified ones. Sorting is natural (file2 before file10) and accent-aware; -t, -S and -X sort by time, size and extension.

glint --thumbs showing image thumbnails

Copying files

glint --copy FILE... puts files on the clipboard the way a file manager's Copy does, so you can paste them into a file manager, a chat or an upload field without opening one first. It uses wl-copy (from wl-clipboard) on Wayland and xclip on X11.

With click-to-copy, a click on a name in a listing does the same:

glint --init copy         # once: makes glint the handler of glint-copy: links
glint --hyperlink=copy    # names are links that copy the file they name

To keep it on, put hyperlink = "copy" in the config file. --hyperlink=off turns the links off for one listing, and --hyperlink=open makes a click open the file instead. A desktop notification confirms each click, since the listing that printed the link is long gone by then.

The terminal has to support OSC 8 hyperlinks and hand unknown link types to the desktop. Alacritty does with a plain click and no configuration. Other terminals may want Ctrl+click, or keep a list of allowed link types that glint-copy:// has to be added to.

A glint-copy: link can come from anywhere, so the handler does one thing only: it copies a file that exists on this machine. A link printed over SSH names the machine it came from and is refused elsewhere.

Interactive browser

glint -i opens a full-screen browser with a preview pane. Code is syntax highlighted, markdown is styled, and images, archives and binary files get previews of their own.

Browsing, searching file contents, jumping to another project and opening the disk map

From the browser you can search inside files (ripgrep runs as you type, and Enter opens your editor at the matching line), jump to recently visited folders and to other projects, open a disk map of the current folder, and do the usual file operations. Deleting moves things to the trash, and asks before deleting permanently on drives that don't have one.

Key Action
arrows, hjkl, mouse Move, open folders, go up
/ Filter names
f, ctrl+f Search inside files
P, ctrl+p Jump to a recent folder or project
M Disk map of this folder
r, d Rename, move to trash
c, x, p Copy, cut, paste
n, N New file, new folder
space, a, y Select, select all, copy paths to the clipboard
e, o Open in $EDITOR, open with the default app
., s, R Hidden files, sort order, reverse
? Show all keys

Project dashboard

If you keep your projects in one folder, glint -P shows them side by side: the stack, the branch, uncommitted changes, the last commit, commit activity over the last twelve weeks, and the size of the source. Projects are sorted by recent activity; -S sorts by size and -s name by name.

glint -P showing a dashboard of projects

Disk map

glint -M draws a treemap of disk usage, measured the same way du measures it. Build output and caches that can be regenerated, like target/, node_modules/, .godot/ or .venv/, are hatched, and a short summary below the map says how much space they take and how to get them back.

glint -M showing a disk usage treemap

glint -M -i opens the same map interactively. Select a block with the arrow keys or the mouse, press Enter to look inside it, Backspace to go up, and o to open that folder in the browser.

For coding agents

A ready-made Claude Code skill is in skill/SKILL.md. Install it with mkdir -p ~/.claude/skills/glint && cp skill/SKILL.md ~/.claude/skills/glint/.

glint -A prints a plain-text description of a directory that's meant to be read by an AI agent. The first lines say what the project is, what state git is in, what changed and what's ignored. After that comes a tree that fits a line budget (200 lines by default, set with --budget).

$ glint -A aurora --budget 40
/home/ada/projects/aurora — Rust · workspace · git main 2 uncommitted; HEAD eb6f4a3 3h ago: Shader hot reload
24 files, 76K (what git sees: tracked + untracked, excluding ignored)
changed: [M] crates/aurora-render/src/gpu.rs, [new] crates/aurora-render/src/upscale.rs
gitignored (hidden): target/
largest source files (excl. vendored/generated): crates/aurora-core/src/math.rs 125L, crates/aurora-render/src/gpu.rs 103L, …

assets/ (4 files, 37K)
  textures/ (3 files, 14K; png×3)
    ↳ checker.png marble.png sunset.png
  logo.png 96x96 24K
crates/ (13 files, 19K; newest file 1m ago) [2 changed]
  aurora-core/ (5 files, 9.6K; Rust · aurora-core)
    src/ (4 files, 9.5K)
      camera.rs 53L
      lib.rs 101L
      math.rs 125L
…

Folders with source code and documentation are expanded before media, generated data and vendored code, and shallow folders before deep ones. Runs of similar files are folded into one line, and the top level is always listed completely, so an agent can tell when something doesn't exist. In a folder that contains several repositories, each one gets a line with its stack and git state.

Given a file, glint -A lists its functions and types with line numbers, so an agent can read just the part it needs. This works for Go, Rust, Python, JavaScript and TypeScript, C and C++, Java, Kotlin, C#, GDScript, shell, Lua, Ruby and Markdown headings.

$ glint -A crates/aurora-render/src/gpu.rs
crates/aurora-render/src/gpu.rs — 103L (last commit 2mo ago: Initial path tracer) [M], modified 1m ago
  3 pub struct Context
  8 pub fn create_device(ctx: &mut Context, input: &[f32]) -> Result<f32, Error>
  20 pub fn upload_scene(ctx: &mut Context, input: &[f32]) -> Result<f32, Error>
  32 pub fn dispatch(ctx: &mut Context, input: &[f32]) -> Result<f32, Error>
  44 pub fn readback(ctx: &mut Context, input: &[f32]) -> Result<f32, Error>

The header gives the path relative to the root of the repository you run glint in (absolute for a file outside it). When a signature doesn't show a symbol's name as it is, the name comes first: 187 globSet.match func (g globSet) match(p string) bool for a method, 5 init#2 func init() for a second definition with the same name. The header path, a colon and that name make a ref (see Refs).

The map and the outline also mark what the current work changed, the way seek, recap and crux do (see context in Prism):

$ glint -A --outline internal
context: 1 changed symbol vs HEAD, 1 symbol changed on this branch since 453ae32
…
files/ (1 file, 183B; newest file 2m ago) [1 changed]
  files.go 16L [M]
    ↳ List:4 init#1:8 init#2:10 [changed] Repo:12 Repo.Open:14
render/ (1 file, 63B; newest file 5m ago) [1 branch]
  render.go 7L [branch]
    ↳ Draw:3 [branch] Clear:7
  • Files committed on this branch since it left the default branch are marked [branch], and folders count them ([1 branch]). Files with uncommitted changes keep their git status ([M], [new], …), which says more than a mark would.
  • Symbols get [changed] (uncommitted) or [branch], in glint -A <file> and with --outline. The symbols of a new, added or renamed file aren't marked: its [new], [A] or [R] already says they're all new at that path.
  • The context: line at the top says what the marks are based on, one line for the whole run. It counts against the budget: it takes a line the map leaves free, or else the place of a glance line, never of a listed file.
  • In a folder of projects that isn't a repository itself (glint -A ~/projects), the projects the map opens up, the recently active ones, are marked the same way, each with its own context, and the context: line starts with the project's name (context: aurora: 3 changed files), or with more of its path when two projects share a name. Projects shown as one line stay as they are.

Context only marks: the same entries are listed with it or without it. It costs a few git commands, which run while glint reads the tree and look only at what's listed: glint -A <file> asks git about that file, and a map without --outline only needs to know which files changed. In a folder of projects only the opened projects are asked, and git leaves their index alone (no optional locks), as glint's own git status of them does. Plain listings (glint -l, glint -T, …) never load it, and --no-context or PRISM_NO_CONTEXT=1 turns it off, for scripts and tests that compare outputs.

On a Rust workspace with about 4,000 files, glint -A came to roughly 2,900 tokens. For comparison, tree -L 2 was about 13,000 and git ls-files about 50,000, and neither includes git state or line counts. The format was refined over several rounds of comparisons in which different models used glint alongside ls, tree, git and du on real projects.

To have your agent use it, add something like this to its instructions (for example AGENTS.md):

To explore directories, prefer `glint -A [dir]` over `ls`, `tree`, `find` or `git ls-files`.
`glint -A <file>` lists a file's symbols with line numbers.

Refs

glint, seek, recap and crux name files, symbols and locations the same way, so anything one of them prints can be handed to another as is:

  • internal/files/files.go: a file
  • internal/files/files.go:List: a symbol, by its qualified name (Repo.Open for a method, outer.inner for a nested function)
  • internal/files/files.go:73: a line (73:5 with a column, 73-107 a range); tools that take a symbol use the innermost one containing it
  • main.go:run@b681ef1: a symbol as it was in a commit; lib.cpp:parse#2: the second of two definitions with the same name

Paths are relative to the repository root. The format is specified in Prism.

JSON

--json prints one JSON document per run: the envelope glint shares with seek, recap and crux, specified in Prism. It has schema, tool, version, args and repo (root, branch, HEAD, uncommitted changes), then result, or error when the run failed.

  • glint --json [paths] puts the listing in result.items (always present, [] for an empty folder): each entry's name, path (as listed, relative to result.dir, the working directory, like ls), type, kind, size, mode, modification time, owner, git status and a symlink's link_target, plus the description, last commit or folder size with -p, -c and --du. With -T, folders hold their contents in children. A file given without -A is listed as one entry.
  • glint -A --json <file> puts one file in result.file: its path (relative to the repository root, absolute outside it, like the text header), lines, size, modified, mode, kind (image, binary, vendored or generated; left out for plain text), image (an image's size), link_target, git (modified, untracked, ignored, …; left out when the file is clean), last_commit, marks (changed or branch when the current work changed the file) and symbols. Each symbol has a ref that seek, recap and crux accept (internal/files/files.go:globSet.match), and marks when it changed. The envelope's context says what the marks are based on, counting that file's changes; it's null with --no-context or --no-git, and for listings, which don't load context. The commits count in last_commit is only counted with -H, in listings too.
  • Failures are an envelope too, with error.code usage (bad arguments) or failed (anything else, such as a missing path), and glint exits with the same code as without --json. A missing path fails the whole run instead of listing the other paths.
  • Views that show more than a listing (-P, -C, -M, --thumbs, -i, -W, and -A with a directory) have no JSON output and fail with a usage error. --help, --version and --init still print text.
  • Lists are capped at 10,000 entries, and truncated says when that cut something.

Breaking change: up to glint 0.7.0, glint --json printed a bare array of entries. That array is gone: the entries are now result.items inside the envelope, so a script that read the array needs .result.items (for example glint --json | jq '.result.items[]'). A symlink's target, which was target, is now link_target, since target holds refs in every tool's JSON.

$ glint -A --json internal/textw/textw.go
{
  "schema": "prism/1",
  "tool": "glint",
  "version": "0.7.0",
  "args": ["-A", "--json", "internal/textw/textw.go"],
  "repo": { "root": "/home/ada/projects/glint", "git": true, "branch": "main", "dirty": false, … },
  "context": { "applied": [], "changed": { "base": "HEAD", "files": 0, "uncommitted": 0, "branch": 0 } },
  "result": {
    "file": {
      "path": "internal/textw/textw.go",
      "lines": 111,
      "size": 2122,
      "modified": "2026-11-03T05:32:30+01:00",
      "mode": "-rw-r--r--",
      "last_commit": { "hash": "e06701b", "subject": "Add text width helpers", "author": "Ada", "time": "2026-11-03T05:32:30+01:00", "commits": 1 },
      "symbols": [
        {
          "ref": "internal/textw/textw.go:Width",
          "path": "internal/textw/textw.go",
          "name": "Width",
          "kind": "func",
          "line": 15,
          "end": 25,
          "sig": "func Width(s string) int"
        },
        …
      ]
    }
  },
  "links": [],
  "next": [],
  "truncated": null
}

Configuration

glint reads ~/.config/glint/config.toml if it exists; glint --init config writes a commented starting point. Each key is the long name of a flag, and [themes.NAME] sections define color schemes:

theme = "midnight"
classify = true
ignore = ["__pycache__", "*.pyc"]

[themes.midnight]
extends = "tokyonight"
blue = "#7aa2f7"
purple = "#bb9af7"

The built-in themes are catppuccin (the default), tokyonight, gruvbox, nord, and wal, which follows pywal. Default flags can also be set in the GLINT_OPTS environment variable. glint --help lists every option.

How it works

Most of glint's speed comes from doing little at startup. It avoids dependencies with expensive initialization, which is why the terminal UI, the color handling and the syntax highlighter are written by hand rather than using Bubble Tea, Lip Gloss or Chroma. Each listing runs git status once and derives folder status from it, file metadata is read in parallel, and thumbnails reuse the cache your file manager has already built.

internal/
  agent/    glint -A
  cli/      flags, help, watch mode, shell integration
  clip/     the clipboard and click-to-copy links
  config/   config file and custom themes
  dash/     project dashboard
  fsx/      reading, sorting and measuring files
  git/      status and history
  icons/    file icons and types
  img/      image decoding and thumbnails
  peek/     short descriptions of file contents
  project/  project type detection
  render/   the different views
  textw/    text width handling
  theme/    colors
  tui/      interactive browser

License

GPL-3.0-or-later. See LICENSE.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
agent
Package agent renders glint for AI coding agents: no color, no padding, no icons, just the facts an agent needs to orient itself, packed into a predictable line budget.
Package agent renders glint for AI coding agents: no color, no padding, no icons, just the facts an agent needs to orient itself, packed into a predictable line budget.
cli
Package cli wires flags, loading and rendering together.
Package cli wires flags, loading and rendering together.
clip
Package clip puts files on the desktop clipboard the way a file manager's Copy does, so they can be pasted into a file manager, a chat or an upload field.
Package clip puts files on the desktop clipboard the way a file manager's Copy does, so they can be pasted into a file manager, a chat or an upload field.
config
Package config loads ~/.config/glint/config.toml.
Package config loads ~/.config/glint/config.toml.
dash
Package dash scans a folder of projects: one row per project with its stack, git state, recent activity and source size.
Package dash scans a folder of projects: one row per project with its stack, git state, recent activity and source size.
fsx
Package fsx loads directory entries with everything the renderers need.
Package fsx loads directory entries with everything the renderers need.
git
Package git reads repository status with a single `git status` call.
Package git reads repository status with a single `git status` call.
icons
Package icons maps files to Nerd Font glyphs and semantic kinds.
Package icons maps files to Nerd Font glyphs and semantic kinds.
img
Package img decodes images and draws them in the terminal, either with Unicode half blocks (works in any truecolor terminal) or the kitty graphics protocol (kitty, WezTerm, Ghostty, lumen).
Package img decodes images and draws them in the terminal, either with Unicode half blocks (works in any truecolor terminal) or the kitty graphics protocol (kitty, WezTerm, Ghostty, lumen).
peek
Package peek describes what's inside files and folders in a few words.
Package peek describes what's inside files and folders in a few words.
project
Package project recognises what kind of project a directory is.
Package project recognises what kind of project a directory is.
regfile
Package regfile reads regular files, and nothing else.
Package regfile reads regular files, and nothing else.
regfile/pipetest
Package pipetest is for tests of code that must not read a named pipe: it makes pipes, and runs a read with a time limit, because a reader that opens a pipe never comes back.
Package pipetest is for tests of code that must not read a named pipe: it makes pipes, and runs a read with a time limit, because a reader that opens a pipe never comes back.
render
Package render turns entries into pretty terminal output.
Package render turns entries into pretty terminal output.
textw
Package textw measures the display width of styled terminal text.
Package textw measures the display width of styled terminal text.
theme
Package theme holds color palettes and a tiny, allocation-light ANSI styler.
Package theme holds color palettes and a tiny, allocation-light ANSI styler.
tui
Package tui is glint's interactive browser (glint -i).
Package tui is glint's interactive browser (glint -i).
Package outline moved to github.com/Vaspyyy/prism/outline, which glint, seek and recap now share.
Package outline moved to github.com/Vaspyyy/prism/outline, which glint, seek and recap now share.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL