tuitest

(★ 11)

Headless testing harness for terminal programs: real PTY, VT emulator, deterministic waits, and golden screen snapshots

File Explorer

  • .gitignore
  • api_test.go
  • bench_test.go
  • encode_test.go
  • exitcode_test.go
  • fuzz_test.go
  • go.mod
  • go.sum
  • integration_test.go
  • keys.go
  • LICENSE
  • mouse.go
  • README.md
  • screen.go
  • snapshot.go
  • state.go
  • state_test.go
  • teardown_test.go
  • terminal.go
  • vtdiff_test.go
  • wait.go

# Use via CDN

jsDelivr

jsDelivr serves any public GitHub repository as a CDN with zero setup. Pick a version and a file to get a ready-to-paste link and snippet.

Command Glossary

Commands referenced in this DOCs, explained below.

🔍

Line

View Details ▼

Manage lines.
Accessed in configuration mode.

line vty 0 15

Configure lines from 0 to 15:

line

Read input:

🔍

go build

View Details ▼

Compile Go sources.

go build {{path/to/main.go}}

Compile a 'package main' file (output will be the filename without extension):

go build -o {{path/to/binary}} {{path/to/source.go}}

Compile, specifying the output filename:

go build -o {{path/to/binary}} {{path/to/package}}

Compile a package:

🔍

go get

View Details ▼

Add a dependency package, or download packages in legacy GOPATH mode.
Note: `./...` is a Go package pattern understood by Go tooling. It matches the current package and all packages recursively under the current directory.

go get {{example.com/pkg}}

Add a specified package to `go.mod` in module-mode or install the package in GOPATH-mode:

go get {{example.com/pkg}}@{{v1.2.3}}

Modify the package with a given version in module-aware mode:

go get {{example.com/pkg}}@{{none}}

Remove a specified package:

🔍

go install

View Details ▼

Compile and install packages named by the import paths.

go install

Compile and install the current package:

go install {{path/to/package}}

Compile and install a specific local package:

go install {{golang.org/x/tools/gopls}}@{{latest}}

Install the latest version of a program, ignoring `go.mod` in the current directory:

🔍

go test

View Details ▼

Test Go packages (files have to end with `_test.go`).
Note: `./...` is a Go package pattern understood by Go tooling. It matches the current package and all packages recursively under the current directory.

go test

Test the package found in the current directory:

go test -v

[v]erbosely test the package in the current directory:

go test -v ./...

Test the packages in the current directory and all subdirectories:

🔍

go vet

View Details ▼

Check Go source code and report suspicious constructs (e.g. lint your Go source files).
Go vet returns a non-zero exit code if problems are found; returns a zero exit code if no problems are found.

go vet

Check the Go package in the current directory:

go vet {{path/to/file_or_directory}}

Check the Go package in the specified path:

go tool vet help

List available checks that can be run with go vet:

🔍

kind

View Details ▼

Run local Kubernetes clusters using Docker container "nodes".
Designed for testing Kubernetes itself, but may be used for local development or continuous integration.

kind create cluster --name {{cluster_name}}

Create a local Kubernetes cluster:

kind delete clusters {{cluster_name}}

Delete one or more clusters:

kind get {{clusters|nodes|kubeconfig}}

Get details about clusters, nodes, or the kubeconfig:

🔍

lazygit

View Details ▼

A simple terminal UI for Git commands, providing an intuitive interface for managing repositories.

lazygit

Open Lazygit in the current repository:

lazygit {{[-p|--path]}} {{path/to/repository}}

Open Lazygit for a specific Git repository:

lazygit {{status|branch|log|stash|...}}

Start Lazygit with focus on a specific panel:

🔍

regex

View Details ▼

Regular expressions (`regex`) are patterns used to match, search, and manipulate text.
Note: `regex` isn't a command, but syntax to be used with other commands.
See also: `egrep`, `glob`.

.

Match any single character:

^{{hello}}

Match the start of a line:

{{world}}$

Match the end of a line:

🔍

Screen

View Details ▼

Hold a session open on a remote server. Manage multiple windows with a single SSH connection.
See also: `tmux`, `zellij`, `herdr`.

screen

Start a new screen session:

screen -S {{session_name}}

Start a new named screen session:

screen -dmLS {{session_name}} {{command}}

Start a new daemon and log the output to `screenlog.x`:

🔍

timeout

View Details ▼

Run a command with a time limit.

timeout 3s sleep 10

Run `sleep 10` and terminate it after 3 seconds:

timeout {{[-s|--signal]}} {{INT|HUP|KILL|...}} {{5s}} {{sleep 10}}

Send a signal to the command after the time limit expires (`TERM` by default, `kill -l` to list all signals):

timeout {{[-v|--verbose]}} {{0.5s|1m|1h|1d|...}} {{command}}

Send verbose output to `stderr` showing signal sent upon timeout:

🔍

vim

View Details ▼

Vim (Vi IMproved), a command-line text editor, provides several modes for different kinds of text manipulation.
Pressing `<i>` in normal mode enters insert mode. Pressing `<Esc>` goes back to normal mode, which enables the use of Vim commands.
See also: `vimdiff`, `vimtutor`, `nvim`, `gvim`.

vim {{path/to/file}}

Open a file:

vim +{{line_number}} {{path/to/file}}

Open a file at a specified line number:

<:>help<Enter>

View Vim's help manual:

🔍

expect

View Details ▼

Script executor that interacts with other programs that require user input.

expect {{path/to/file}}

Execute an expect script from a file:

expect -c "{{commands}}"

Execute a specified expect script:

expect -i

Enter an [i]nteractive REPL (use `exit` or `<Ctrl d>` to exit):

🔍

setsid

View Details ▼

Run a program in a new session if the calling process is not a process group leader.
The created session is by default not controlled by the current terminal.

setsid {{program}}

Run a program in a new session:

setsid {{program}} > /dev/null 2>&1

Run a program in a new session discarding the resulting output and error:

setsid {{[-f|--fork]}} {{program}}

Run a program creating a new process:

🔍

snap

View Details ▼

Manage the "snap" self-contained software packages.
Similar to what `apt` is for `.deb`.

snap find {{query}}

Search for a package:

snap install {{package}}

Install a package:

snap refresh {{package}}

Update a package:

# Project Badges

// repository documentation