A Go library for writing shell-like scripts with a pipeline API for file reading, subprocess execution, string matching, and more.
Script is a Go library that enables developers to write shell-like scripts for automation and system administration tasks. It provides a pipeline-based API for operations like reading files, executing subprocesses, filtering text, and handling HTTP requests, making it easy to compose complex data processing workflows in Go.
Go developers and system administrators who need to write automation scripts, process logs, manage files, or perform command-line tasks with the reliability and type safety of Go.
Developers choose Script because it combines the expressiveness of shell pipelines with Go's static typing, error handling, and concurrency, eliminating the need for brittle shell scripts while offering built-in equivalents to common Unix tools.
Making it easy to write shell-like scripts in Go
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Enables chaining operations like File(), Match(), and Stdout() in a shell-like manner, making complex data transformations concise and readable, as demonstrated in the Apache log example.
Provides direct methods for common shell commands such as grep (Match), cut (Column), and jq (JQ), reducing the need to call external binaries and improving integration.
Filters and Exec run concurrently, allowing pipelines to stream output without blocking on full input, which is ideal for long-running processes like ping.
Includes Get, Post, and JQ methods for HTTP requests and JSON processing, eliminating dependencies on tools like curl for simple API interactions.
Requires Go installation and compilation, adding overhead compared to interpreted shell scripts for quick, one-off tasks or environments without Go.
While it covers many common commands, advanced shell features like process substitution, signal handling, or interactive prompts are not natively supported, often requiring custom Go code.
Users must manually check errors after each pipeline stage with methods like String() or Stdout(), leading to more boilerplate code than shell scripts, which often fail fast.