goutil

module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 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.
Package configcmd provides the shared `config` cobra command.
Package configdir is the per-app config plumbing: the ~/.<app> directory, YAML load, atomic save, and single-key edits that preserve the rest of the file.
Package configdir is the per-app config plumbing: the ~/.<app> directory, YAML load, atomic save, and single-key edits that preserve the rest of the file.
Package envopt resolves an option a flag may set and an environment variable may default: a typed flag wins, then the variable, then the flag's default.
Package envopt resolves an option a flag may set and an environment variable may default: a typed flag wins, then the variable, then the flag's 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 checks GitHub for a newer release and installs it by running the app's own installer (install.sh, or install.ps1 in PowerShell) with BIN_DIR set to the running binary's directory.
Package selfupdate checks GitHub for a newer release and installs it by running the app's own installer (install.sh, or install.ps1 in PowerShell) with BIN_DIR set to the running binary's directory.
Package shellquote quotes strings and argument lists for a POSIX shell, and splits a quoted command line back into argv without running one.
Package shellquote quotes strings and argument lists for a POSIX shell, and splits a quoted command line back into argv without running one.
Package stream runs a subprocess and relays its output line by line to a Reporter.
Package stream runs a subprocess and relays its output line by line to a Reporter.
Package strutil holds small string and path helpers shared across the monorepo's apps.
Package strutil holds small string and path helpers shared across the monorepo's apps.
Package sysopen opens paths in the OS file manager and URLs in the browser.
Package sysopen opens paths in the OS file manager and URLs in the browser.
Package textfile reports whether a file holds text, judged by content rather than extension so files like Makefile and LICENSE count.
Package textfile reports whether a file holds text, judged by content rather than extension so files like Makefile and LICENSE count.

Jump to

Keyboard shortcuts

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