# script

> Making it easy to write shell-like scripts in Go

Source: https://talira.ai/catalog/script-5yaf6fxr
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [developer tools / scripting](https://talira.ai/categories/developer-tools/scripting), [languages / go](https://talira.ai/categories/languages/go)
- Licence: MIT[^1]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [John Arundel](https://talira.ai/orgs/john-arundel.md)

script is a Go library for the jobs shell scripts are good at: reading files, running subprocesses, counting lines, matching strings and fetching URLs. Like a shell pipeline, you chain operations on a stream of data, such as `script.File("log.txt").Match("Error").CountLines()`, with sources (files, stdin, arguments, commands, HTTP requests, file listings), filters (match, reject, replace, column, jq, first and last lines, unique, hashes, custom Go functions) and sinks (stdout, files, strings, slices). Its author, John Arundel, wrote it as an exercise in his book The Power of Go: Tools.

## Links

- GitHub: https://github.com/bitfield/script
- Docs: https://pkg.go.dev/github.com/bitfield/script

## Problems it solves

- my bash scripts have grown too big and I want to rewrite them in Go without losing the pipeline style
- write system administration programs in Go as easily as a shell script
- grep, count and filter lines from files or stdin in a few lines of Go
- run shell commands from Go and pipe their output through filters
- fetch a URL and filter the response with jq-style queries in Go
- type-checked, testable replacements for shell one-liners in DevOps tooling

## Features

- Chainable pipelines of sources, filters and sinks
- Sources: files, stdin, arguments, commands, HTTP requests and file listings
- Filters: Match, Reject, Replace (with regexp variants), Column, First, Last, Freq, Unique, JQ, hashing and custom Go functions
- Run commands with Exec, ExecForEach and Shell
- HTTP Get, Post and Do with a custom client
- Sinks: stdout, files (write and append), strings, slices and line counts
- Tee to send output to several places

## Trust

Overall: 0.47 out of 1.
Signals: maintenance 0.46, adoption 0.77, momentum 0.57, community 0.54, backing 0.30, extensibility 0.00.

- last commit 48 days ago
- 2 commits in the last 90 days
- 7.0k GitHub stars
- 21 contributors
- accepts sponsorship (Github)
- backed by John Arundel

## Sources

[^1]: https://github.com/bitfield/script/blob/master/LICENSE (checked 22 Nov 2026)
