goutil

module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT

README

goutil

Packages

  • configcmd — the shared opt-in Cobra config command: materialize an app's defaults, edit its config through $EDITOR/$VISUAL (falling back to Notepad on Windows), or open the config directory with config --dir.
  • configdir — resolve the monorepo's ~/.<app> config directories, load optional YAML, and save it atomically.
  • executil — build argv-based subprocesses portably, including Windows .cmd and .bat launchers that must cross the cmd.exe boundary.
  • selfupdate — check GitHub for a newer release (via the /releases/latest redirect, no API) and install it by running the repo's own installer — install.sh under sh, or an in-memory Invoke-RestMethod/PowerShell flow on Windows — against the running binary's directory. Includes NewUpdateCommand, the shared cobra update command used by the apps.
  • stream — run a subprocess and relay its stdout+stderr to a Reporter one line at a time as it arrives (splitting on \r as well as \n, so progress bars stream), folding the last line into the error on a non-zero exit. The command-streaming machinery behind gitstack's GitStream and golaunch's script runner.
  • sysopen — open a path, reveal a file, or launch a URL with native platform behavior (including ShellExecuteW on Windows), without taking a dependency on Cobra, Bubble Tea, or an app domain.

Docs

  • docs/install.md — the shared install/update reference for the apps: every option install.sh and install.ps1 take, how each decides about PATH, and how <binary> update works. The app READMEs link here rather than restating it.

Directories

Path Synopsis
Package configcmd provides the shared `config` Cobra command used by the CLI applications.
Package configcmd provides the shared `config` Cobra command used by the CLI applications.
Package configdir is the small layer of per-app config plumbing the monorepo apps kept duplicating: the hidden ~/.<app> directory convention, YAML load where a missing file is not an error, an atomic save that can't truncate a working config on failure, and a surgical single-key edit that leaves the rest of the user's file alone.
Package configdir is the small layer of per-app config plumbing the monorepo apps kept duplicating: the hidden ~/.<app> directory convention, YAML load where a missing file is not an error, an atomic save that can't truncate a working config on failure, and a surgical single-key edit that leaves the rest of the user's file alone.
Package envopt resolves a command-line option that a flag may set and an environment variable may default.
Package envopt resolves a command-line option that a flag may set and an environment variable may default.
Package executil builds subprocesses with the same argv-oriented interface as os/exec while also handling Windows batch-file launchers.
Package executil builds subprocesses with the same argv-oriented interface as os/exec while also handling Windows batch-file launchers.
Package selfupdate implements the shared self-update mechanism for the brohd11 Go apps: check GitHub for a newer release and, when one exists, install it by running the same installer the READMEs tell users to fetch — install.sh under sh on Unix, or the documented Invoke-RestMethod flow under PowerShell on Windows — with BIN_DIR pointed at the running binary's directory so the update lands in place, and --no-modify-path so an installed binary is never asked about PATH again.
Package selfupdate implements the shared self-update mechanism for the brohd11 Go apps: check GitHub for a newer release and, when one exists, install it by running the same installer the READMEs tell users to fetch — install.sh under sh on Unix, or the documented Invoke-RestMethod flow under PowerShell on Windows — with BIN_DIR pointed at the running binary's directory so the update lands in place, and --no-modify-path so an installed binary is never asked about PATH again.
Package shellquote renders strings and argument lists for a POSIX shell.
Package shellquote renders strings and argument lists for a POSIX shell.
Package stream runs a subprocess and relays its output to a caller-supplied reporter one line at a time as it arrives.
Package stream runs a subprocess and relays its output to a caller-supplied reporter one line at a time as it arrives.
Package strutil holds the tiny string and path helpers that every app in the monorepo ended up hand-rolling for itself — plural selection, home-dir expansion, path depth — so the next app doesn't roll a fourth copy.
Package strutil holds the tiny string and path helpers that every app in the monorepo ended up hand-rolling for itself — plural selection, home-dir expansion, path depth — so the next app doesn't roll a fourth copy.
Package sysopen hands filesystem paths to the operating system's file manager, and URLs to its browser.
Package sysopen hands filesystem paths to the operating system's file manager, and URLs to its browser.
Package textfile answers one question about a path: does it hold text, or bytes no editor should be pointed at?
Package textfile answers one question about a path: does it hold text, or bytes no editor should be pointed at?

Jump to

Keyboard shortcuts

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