❯ go-clikit
v0.10.0 pkg.go.dev ↗

Go module · Apache-2.0 · v0.10.0 · API on pkg.go.dev

The runtime that GSI-HPC's command-line tools share.

A library reports its work as spans. The command decides how to show them, as a live tree, a counter, plain lines for CI, or a JSONL log for programs. Without a listener, the report costs nothing.

$go get github.com/GSI-HPC/go-clikit/progress

reinstall exe[01-12] --progress=tty
✓ fetching the base image  5.0s  2.0 GiB at 410 MiB/s
reinstall ◦ 0:10.5
╎ reinstalling the nodes  ◉◉◉◉◉◌◌◌◌◌ 6/12 ◦ 4 running ◦ 2 queued
  ╎ ◡ exe07  2.8s/30s  POST /redfish/v1/Systems/1
  ╎ ◡ exe08  2.1s/30s  POST /redfish/v1/Systems/1
  ╎ ◡ exe09  1.4s/30s  POST /redfish/v1/Systems/1
  ╎ ◡ exe10  0.7s/30s  POST /redfish/v1/Systems/1
  ╎ ✓ exe[01-06]
Recorded from progress/display on a fake clock, by a test of the kit. Pick a theme.

01 One stream of events, four views

The library sends the same events in each case. The command picks the view with one flag, --progress. The tree above is one view. These are the other three.

--progress=counter
◠ reinstalling the nodes ◦ 4/12 ◦ 4 running ◦ 4 queued ◦ 0:08.7
Counter. One line, for a small terminal.
--progress=plain
[0:00] reinstall › fetching the base image: start
[0:05] reinstall › fetching the base image: done in 5.0s: 2.0 GiB at 410 MiB/s
[0:05] reinstall › reinstalling the nodes: start, 12 targets, 4 at a time
[0:10] reinstall › reinstalling the nodes › exe07 failed (target): BMC answered 503
[0:14] reinstall › reinstalling the nodes: failed in 9.0s: 11 ok, 1 failed
reinstall: failed in 14s: 11 ok, 1 failed, 2.0 GiB at 143 MiB/s
Plain lines. One line for each change worth a line, for a CI log.
{"v":1,"run":"0123456789abcdef","trace":"4bf92f3577b34da6a3ce929d0e0e4736","seq":4,"time":"2026-09-25T12:00:00.000000000Z","type":"start","span":"#3","parent":"#1","kind":"step","name":"run","flags":["fold","show-lines"],"state":"running","total":2,"limit":1}

Event log. One JSON line for each event, for a program; this one is from the golden log of the tests. The format is an interface: version 1 adds keys and never changes them.

02 Find your way

The kit has 22 packages in four groups. An arrow goes from a package to a package that it imports. Select a package to read about it.

The packages of go-clikit in four groups. An arrow goes from a package to a package it imports.PROGRESS & OUTPUTFILESCOMMAND LINELOCAL WEBtermtextprogressdisplaycliprogressprogresstestmcpprogresseventlogfanoutfanouttestclioutdoctorfsutilcobratreecobratreetestlocalwebsessionsselocalwebtestlaunchassetspagehtmx
progress & outputfilescommand linelocal web→ imports

03 Start from your job

04 This site and pkg.go.dev

This site tells why the kit works as it does, how its parts fit together, and what a command looks like when it runs. pkg.go.dev holds each name, its doc comment and its examples. A page here ends each topic with a link to the names on pkg.go.dev. The kit is used by clusterctl, sind and brig.