Help us shape the future of Go! Take the 2026 Go Developer Survey

cliutil

package
v1.3.104-alpha1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package cliutil cmd/skywire-cli/commands/util/foreach.go c4-vis-cli foreach` — run a templated shell command against a list of public keys (or arbitrary tokens) in parallel and print collated output with per-target headers.

Today operators dispatching the same probe / config check across the visor fleet write a shell loop:

for pk in $(cat peers.txt); do
  echo "=== $pk ==="
  skywire cli dmsg ping --dmsg $pk
done

foreach folds that into one CLI:

skywire cli util foreach @peers.txt 'skywire cli dmsg ping --dmsg {pk}'

Behaviorally equivalent to GNU parallel's most common use case — but bundled with the skywire CLI so an operator on a fresh box doesn't need to install parallel first, and we can layer skywire-aware features (skychat alias resolution, future PK validation) on top without forking parallel.

Package cliutil cmd/skywire-cli/commands/util/nc.go c4-vis-cli util nc` — a pure-Go netcat clone. Plain TCP / UDP over the kernel's stack; nothing in here touches a skywire transport. Lives under `util` for the same reason `serve` does: it's a developer convenience, not part of the visor RPC surface.

Supported flags follow the classic OpenBSD-nc letter set so muscle memory transfers:

-l   listen mode (default is dial)
-u   UDP (default TCP)
-w   timeout for dial / read-stall
-k   keep listening after the first conn EOFs (TCP listen only)
-z   zero-IO probe — TCP dial, exit 0/1 by success
-v   verbose status to stderr

Intentionally absent: `-e/--exec`. Cross-host command execution is dmsgpty's job; nc's `-e` is a well-known footgun and we'd rather users compose with shell pipes.

Package cliutil cmd/skywire-cli/commands/util/static.go c4-vis-cli

`skywire cli util serve` — a small static-file HTTP server for pairing with `cli serve add 80 --to <addr>`. Lives under `util` because it isn't part of the core visor RPC surface; the visor itself doesn't host static files.

Was top-level `cli serve <dir>` historically; the top-level name was reclaimed for port registration. Old invocations should use `cli util serve <dir>`.

Package cliutil cmd/skywire-cli/commands/util/util.go c4-vis-cli

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "util",
	Short: "Bundled utility commands",
}

RootCmd is the util command grouping standalone utilities.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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