Skip to content

Releases: goncharovart/runlet

v0.1.0 — first tagged release

21 May 19:31

Choose a tag to compare

First tagged release. The CLI, parser, runner, and content-addressed cache all land together so v0.1.0 is "everything you need to write a single-file Go script with third-party deps and run it with one command."

Quickstart

go install github.com/goncharovart/runlet/cmd/runlet@v0.1.0

Write a script:

// runlet:dep github.com/charmbracelet/lipgloss v1.0.0
package main

import (
    "fmt"
    "github.com/charmbracelet/lipgloss"
)

func main() {
    style := lipgloss.NewStyle().
        Bold(true).
        Foreground(lipgloss.Color("#FAFAFA")).
        Background(lipgloss.Color("#7D56F4")).
        Padding(0, 1)
    fmt.Println(style.Render("hello from a single file"))
}

Run it:

runlet hello.go

What's in

  • CLI — `runlet <script.go> [args...]`. The `-` form reads from stdin. Anything after the script path is forwarded as arguments to the script itself.
  • Magic-comment grammar — `// runlet:dep `. Module versions follow Go module syntax (`v1.2.3`, pseudo-versions, `latest`). Multiple lines compile into one synthesised `require (...)` block.
  • Two shebang formats — traditional `#!/usr/bin/env runlet` and the Go-friendly `//usr/bin/env runlet "$0" "$@"; exit` trick that keeps the file `go fmt`-clean.
  • Content-addressed cache — SHA-256 of `(source, sorted deps)` is the directory name under `$XDG_CACHE_HOME/runlet/`. Reordering deps does not invalidate the cache; identical scripts skip the `go mod tidy` roundtrip on every run after the first.
  • `go build` + exec, not `go run` — this is the part that matters most for tooling. `go run` wraps non-zero exit codes from the script into its own `exit-1 + "exit status N"` stderr, hiding the real code from callers. runlet builds to a cached binary and execs it, so `runlet myscript.go && echo ok` behaves as you'd expect.

Tests

13 unit tests; CI matrix covers Go 1.22 + 1.25 × ubuntu-latest + macos-latest + windows-latest. The runner integration tests auto-skip when no `go` is on `PATH`.

Not yet

  • `runlet cache info` / `runlet cache clear` subcommands (#1)
  • Multi-file scripts: `runlet ./scripts/` (#2)
  • `runlet --version` via `debug.ReadBuildInfo` (#3)
  • Pre-run trust signal on `runlet:dep` modules (#4)
  • Homebrew tap + apt repo distribution (#5)

Each is tracked as a good-first-issue with scope and files-to-touch in the body — first-time contributors welcome.

Full notes: CHANGELOG.md.