A lightweight terminal UI for displaying Go tests.
sift is a lightweight terminal UI for displaying Go test results. It allows developers to traverse verbose Go test logs in their terminal. Each test is able to be expanded and collapsed to only show the logs that matter.
go install github.com/timtatt/[email protected]
sift
works by consuming the verbose json output from the go test
command. The easiest way to use it is to pipe |
the output straight into sift
go test {your-go-package} -v -json | sift
# eg.
go test ./... -v -json | sift
Flag | Shorthand | Description |
---|---|---|
--debug |
Enable debug view | |
--non-interactive |
-n |
Skip alternate screen and show inline view only |
Example:
# Run in non-interactive mode (inline output)
go test ./... -v -json | sift -n
# Enable debug view
go test ./... -v -json | sift --debug
The keymaps are based on vim motion standard keymaps for scrolling and managing folds. Press ?
to toggle the help menu.
Key | Action |
---|---|
↑ / k |
Move up |
↓ / j |
Move down |
{ |
Jump to previous test |
} |
Jump to next test |
Key | Action |
---|---|
ctrl+y |
Scroll viewport up |
ctrl+e |
Scroll viewport down |
ctrl+u |
Scroll half page up |
ctrl+d |
Scroll half page down |
Key | Action |
---|---|
enter / space |
Toggle test output |
za |
Toggle test output (vim-style) |
zo |
Expand test output |
zc |
Collapse test output |
zA |
Toggle test recursively (includes subtests) |
zR |
Expand all tests |
zM |
Collapse all tests |
Key | Action |
---|---|
/ |
Enter search mode |
esc |
Clear search filter and show all tests |
Search Tips:
- Type to filter tests using fuzzy matching (case-insensitive)
- Press
enter
to exit search mode while keeping the filter active - Press
esc
to clear the search filter and show all tests
Key | Action |
---|---|
? |
Toggle help menu |
q / ctrl+c |
Quit |
- Filter tests by status (pass/fail/skip)
- Support for light mode
- Add animated chars
- Add responsive wrapping for the help
- When items collapsed and viewport is too large, rerender to remove whitespace
The UI design of sift
is heavily inspired by the vitest cli