script is a Go library for writing shell-like scripts that operate on data pipelines.
The library addresses the friction of writing system administration programs in Go by providing an API modeled on Unix shell pipelines. Rather than manually handling file I/O, subprocess execution, and data transformation, developers compose operations sequentially on streams of data. Each stage in the pipeline can read files, execute external commands, filter through HTTP requests, apply transformations via Go functions or JQ queries, and write results to files or standard output. Errors encountered at any stage propagate through the pipeline and can be checked at the end.
The tool suits developers who want to write administrative utilities in Go with the conciseness of shell scripts. It works well for tasks like reading and filtering files, counting lines, matching patterns, executing subprocesses, and making HTTP requests. The library handles both simple operations and more complex scenarios such as custom HTTP clients, request headers, and JSON data interrogation. Anyone building system tools in Go who finds shell scripting more natural than traditional Go I/O patterns should consider it.
The maintainers respond to new issues and pull requests within hours.