Hacker GitHub

← All repos

bitfield/script

View on GitHub ↗ ★ 7,044 Go

Making it easy to write shell-like scripts in Go

21 mentions on Hacker News by 16 people: 12 stories, 9 comments · first 2019-06-10 · latest 2026-01-07

Mentions per year 21 mentions · busiest year 2024 (8)
20082026
  1. bitfield/script has some nice abstractions for bash builtins and coreutils https://github.com/bitfield/script
    comment by exographicskip · 2026-01-07 · in Go away Python
  2. Check https://github.com/bitfield/script for shell-like scripts in Go.
    comment by gen2brain · 2024-08-13 · in Go is my hammer, and everything is a nail
  3. …started unifying things. [0] https://github.com/casey/just [1] https://magefile.org/magefiles/ [2] https://github.com/bitfield/script
  4. That's why I plan on migrating all my shell scripts to Golang programs f.ex. using https://github.com/bitfield/script -- it already has a number of simulations of shell commands and I'd contribute others if I had the time. sh / bash / zsh…
  5. I use Go. You can run scripts with go run directly, and this package makes shell tasks easy: https://github.com/bitfield/script
  6. I believe error handling looks like this: package main import ( "github.com/bitfield/script" ) func main() { _, err := script.Stdin().Column(1).Freq().First(10).Stdout() if err != nil { log.Fatal(err) } } Errors are "remembered" by the…
    comment by simonw · 2023-08-20 · in Scripting with Go (2022)
  7. …(though it's in the script README) - what a complete program looks like. Here's the example from https://github.com/bitfield/script#a-realistic-use-case package main import ( "github.com/bitfield/script" ) func main() {…
    comment by simonw · 2023-08-20 · in Scripting with Go (2022)
  8. …from shell pipes and turning it into a Go library with syntax this clean is really impressive: https://github.com/bitfield/script
    comment by simonw · 2022-03-12 · in Scripting with Go
  9. It took me a while to find the link to the library "script" and it's repo - https://github.com/bitfield/script
    comment by mftb · 2022-03-11 · in Scripting with Go