sou

command module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: Apache-2.0 Imports: 10 Imported by: ? 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

sou

A modern TUI tool for exploring container image layers with an intuitive interface.

The name "sou" comes from the Japanese word "層" (そう/sō) which means "layer". It can be pronounced as "so".

Demo

Features

  • Layer table with size, age and the cleaned-up build instruction, plus a live detail panel
  • File browser with a preview pane, real permissions, symlink targets and overlay deletion markers
  • File viewer with line numbers, wrapping, search, syntax highlighting and safe handling of binary and very large files
  • Manifest and config viewers with JSON highlighting, search and export
  • Instant filtering, contextual key hints and a grouped keyboard reference
  • Responsive from 200 columns down to 40, on light and dark terminals, with or without colour
  • Optional mouse support: wheel scrolling and click to select

About this fork

This is a maintained fork of knqyf263/sou, which is no longer receiving updates. The container-image logic is the original author's work; the terminal interface has since been rebuilt (see docs/tui-design.md).

🤖 Both the original project and this fork are developed with Claude, exploring the possibilities of AI-assisted development.

Installation

Using a container image

Images are published to GHCR for linux/amd64 and linux/arm64 on every release, and edge tracks the main branch.

docker run --rm -it ghcr.io/ramadhanamizudin/sou:latest nginx:latest

To explore an image held by your local Docker daemon, share the socket:

docker run --rm -it \
  -v /var/run/docker.sock:/var/run/docker.sock \
  ghcr.io/ramadhanamizudin/sou:latest nginx:latest
Using Go
go install github.com/RamadhanAmizudin/sou@latest
From a release

Download an archive for your platform from the releases page.

From source
git clone https://github.com/RamadhanAmizudin/sou.git
cd sou
go build -o sou

Usage

sou <image-name>

Example:

# Local image
sou nginx:latest

# Remote image
sou ghcr.io/ramadhanamizudin/sou:latest

Key Bindings

Press ? on any screen for a grouped reference of the shortcuts that apply there. Every binding accepts both a Vim key and a conventional one.

Everywhere
Key Action
? Keyboard reference (any key closes it)
Tab / Shift+Tab Next / previous section
1 2 3 Jump to Layers / Manifest / Config
q Quit
Ctrl+c Quit immediately, from any state
Navigation (lists and the file viewer)
Key Action
↑ / k Up
↓ / j Down
g / Home First
G / End Last
PgUp / K Page up
PgDn / J Page down
Ctrl+u / Ctrl+d Half page up / down
Layer view
Key Action
Enter / l / → Browse the layer's files
/ Filter by command, diff ID or layer number
Esc Clear the filter
o Reverse the layer order (build order by default)
yy Copy the diff ID
yc Copy the build command
File browser
Key Action
Enter / l / → Open a file or enter a directory
h / ← / Backspace Parent directory, then back to the layer list
Esc Clear the filter, otherwise go back
/ Filter the current directory
. Show or hide dotfiles
x Export the selected file to the working directory
yy Copy the full path
yn Copy the file name
File, manifest and config viewers
Key Action
/ Search the document
n / N Next / previous match
w Toggle line wrapping
# Toggle line numbers
H / L / 0 Scroll sideways / reset (with wrapping off)
x Export to the working directory
h / ← / Esc Back
Mouse

The scroll wheel scrolls, a click selects a row, and clicking the selected row opens it. Clicking a tab switches sections. Everything remains reachable from the keyboard; run sou --no-mouse <image> to leave the mouse to your terminal.

Syntax highlighting

Files are highlighted in the viewer and in the browser's preview pane. sou uses a compact lexical highlighter rather than a grammar framework, which keeps the binary small and stays fast on very large files, and covers what actually turns up inside container images:

JSON · YAML · TOML · INI and systemd units · nginx and Apache config · Dockerfile · shell · Makefile · Go · C/C++/Java/Rust/Swift/C# · JavaScript and TypeScript · Python · Ruby · SQL · XML and HTML · Markdown · diffs and patches · Lua · PEM certificates

Block comments and multi-line strings are tracked across lines, and colouring survives wrapping and horizontal scrolling. Anything unrecognised is shown as plain text rather than guessed at.

Terminal support

sou adapts to the terminal it is given. It uses true colour when available and degrades to 256 and then to 16 colours, and it stays fully readable with colour disabled entirely (NO_COLOR). Set SOU_ASCII=1 to replace the box-drawing characters with an ASCII set.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

The interface is documented in docs/tui-design.md: the layout model, the theme system and the golden screen tests under ui/testdata/screens/. Refresh those snapshots with go test ./ui -run TestScreens -update after an intentional visual change.

Continuous integration
Workflow Runs on Does
Test pushes and pull requests to main builds and tests on Linux and macOS, checks gofmt, go vet and that go.mod is tidy
Image pushes to main, v* tags, pull requests builds the multi-architecture image and pushes it to GHCR (a pull request builds it but does not push)
Release v* tags builds the archives and creates the GitHub release with GoReleaser

Everything authenticates with the token GitHub creates for each run, so there are no secrets to configure.

License

Apache License 2.0 - see LICENSE for more details.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
ui
Package ui implements sou's terminal interface.
Package ui implements sou's terminal interface.
components
Package components holds the reusable presentation primitives of the sou interface: text measurement and fitting helpers, the application shell (header, tab strip, status bar), and the standard empty, error and loading states.
Package components holds the reusable presentation primitives of the sou interface: text measurement and fitting helpers, the application shell (header, tab strip, status bar), and the standard empty, error and loading states.
theme
Package theme holds sou's design system: a semantic colour palette, the glyph set used to draw the interface and the pre-built lipgloss styles that every view renders through.
Package theme holds sou's design system: a semantic colour palette, the glyph set used to draw the interface and the pre-built lipgloss styles that every view renders through.

Jump to

Keyboard shortcuts

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