rune

module
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2026 License: MIT

README ΒΆ

Rune logo

Rune

A shared task runner for humans and AI agents.

CI Release Go version Go Report Card Go Reference Docs

πŸ“– Read the docs: rune-task-runner.github.io/rune

Docs Β· Getting started Β· Examples Β· CLI reference

Rune runs your project's commands β€” lint, test, build, deploy β€” from one readable file, the Runefile. Humans run tasks from the CLI; AI agents and IDEs run the same tasks through the Model Context Protocol (MCP). It ships as a single static binary with no runtime dependencies.

# Build the project.
build target="release": fetch
    go build -tags {{quote(target)}} ./...

# Fetch dependencies.
fetch:
    @go mod download

# Run tests.
test: build
    go test ./...
rune              # show the version + available tasks (runs nothing)
rune build        # run the `build` task
rune test         # runs `build` (a dependency), then `test`
rune --list       # shows documented tasks

Why Rune?

If you've used make or just, Rune will feel familiar β€” with a few deliberate choices:

  • Command runner, not a build system. Tasks always run when asked. No .PHONY traps, no timestamp-based "up-to-date" skipping. Content-hash caching exists, but only as an explicit per-task [cache(...)] opt-in.
  • Errors are a feature. Undefined variables, unknown dependencies, dependency cycles, and arity mismatches are caught before anything runs, with precise file:line:col + caret-underlined diagnostics.
  • Boringly portable. One static binary. The default shell executor is a pure-Go, cross-platform shell (mvdan.cc/sh) β€” your (sh) tasks behave the same on Linux, macOS, and Windows, with no WSL or Git-Bash required.
  • AI-native and secure by default. Tasks are first-class MCP tools. Destructive tasks are refused until the operator allows them or the person approves the call in the client, [agent-allow] limits the values an agent may pass, [applies] runs a task once, with the plan a person approved, only [readonly] tasks claim to be read-only, every call is recorded in an audit log that rune log reads, a task an agent calls runs in a sandbox with no network unless it is marked [network] and with writes only inside the project (Linux, with bubblewrap), and secrets come from the environment only, never the Runefile.
  • Multi-language bodies. Write task bodies in shell, Python, Node, or drive an AI agent.
  • First-class editor support. rune lsp is a built-in language server (LSP 3.17): live diagnostics, completion, go-to-definition, hover, outline, and formatting in VS Code, Neovim, Helix, and Zed β€” reusing the same parser and analyzer, running nothing. For VS Code, install the Rune extension from the Marketplace. rune analyze reports the same diagnostics for CI. See editor setup.

Install

To let AI agents call your tasks on Linux, also install bubblewrap (apt install bubblewrap): it is the sandbox those tasks run in. Without it rune mcp refuses task calls unless you start it with --sandbox off. Running tasks yourself needs nothing else.

Install script (Linux/macOS)

Verifies the checksum.

curl -sSfL https://raw.githubusercontent.com/rune-task-runner/rune/main/scripts/install.sh | sh
Homebrew (macOS/Linux)
brew install rune-task-runner/tap/rune
Scoop (Windows)
scoop bucket add rune https://github.com/rune-task-runner/scoop-bucket && scoop install rune
From source
go install github.com/rune-task-runner/rune/cmd/rune@latest
Prebuilt binary

Download a binary from Releases.

Container
docker run --rm -v "$PWD":/work ghcr.io/rune-task-runner/rune --list

Full instructions: Installation guide.

Documentation

Start at the documentation index β€” it routes you to the right page by goal ("I want to…"). Highlights:

Guide What's inside
Docs index Find any page by what you want to do
What is Rune? The idea, the mental model, and when to use it
Getting started Zero β†’ your first task in minutes
User guide A guided tour of every capability, in order
How-to guides Task-oriented guides, one per capability
Use cases Full walkthroughs: Python, Node, AI agents (MCP)
Examples Runnable starting points for real project shapes
Installation Binary, source, and container install per OS
CLI reference Every command, flag, and exit code
Runefile language Tasks, deps, params, caching, executors, dotenv
AI agents (MCP) Expose tasks to agents; the security model
Docker Run Rune install-free in a container
Troubleshooting Errors, diagnostics, and exit codes
Grammar The formal Runefile grammar

Contributing

See CONTRIBUTING.md. In short: tests run inside Docker (docker-compose run --rm test go test ./...), and every change must pass the CI gates (format, lint, cross-platform race tests, fuzz smoke, golden consistency, build). Rune dogfoods itself β€” run rune --list in the repo to see the development tasks.

Security

Found a vulnerability? Please follow the process in SECURITY.md.

License

MIT Β© The Rune Authors.

Directories ΒΆ

Path Synopsis
cmd
docsite command
Command docsite generates the Astro + Starlight content tree in website/ from the canonical documentation in docs/.
Command docsite generates the Astro + Starlight content tree in website/ from the canonical documentation in docs/.
rune command
Command rune is a shared task runner for humans and AI agents.
Command rune is a shared task runner for humans and AI agents.
internal
analysis
Package analysis is the reusable analysis service that wraps Rune's parse β†’ compose β†’ analyze pipeline behind a source-overlay abstraction.
Package analysis is the reusable analysis service that wraps Rune's parse β†’ compose β†’ analyze pipeline behind a source-overlay abstraction.
analyzer
Package analyzer is the whole-file semantic analyzer.
Package analyzer is the whole-file semantic analyzer.
ast
Package ast defines the Runefile abstract syntax tree produced by the parser and consumed by the analyzer, evaluator, scheduler, cache, and MCP server.
Package ast defines the Runefile abstract syntax tree produced by the parser and consumed by the analyzer, evaluator, scheduler, cache, and MCP server.
audit
Package audit keeps the audit log of one project: what agents asked Rune's MCP servers to do.
Package audit keeps the audit log of one project: what agents asked Rune's MCP servers to do.
cache
Package cache implements opt-in, per-task content-hash caching for tasks carrying [cache(inputs=[...], outputs=[...])].
Package cache implements opt-in, per-task content-hash caching for tasks carrying [cache(inputs=[...], outputs=[...])].
cli
Package cli wires the command-line surface: Runefile resolution, the parse β†’ analyze β†’ run pipeline, task dispatch, and exit-code mapping.
Package cli wires the command-line surface: Runefile resolution, the parse β†’ analyze β†’ run pipeline, task dispatch, and exit-code mapping.
config
Package config handles Runefile discovery and settings resolution.
Package config handles Runefile discovery and settings resolution.
diag
Package diag is the diagnostic model and renderer.
Package diag is the diagnostic model and renderer.
docsite
Package docsite transforms the canonical Markdown documentation under docs/ into the content tree the Astro + Starlight site in website/ builds from.
Package docsite transforms the canonical Markdown documentation under docs/ into the content tree the Astro + Starlight site in website/ builds from.
dotenv
Package dotenv loads .env files into KEY=VALUE environment pairs for tasks (set dotenv).
Package dotenv loads .env files into KEY=VALUE environment pairs for tasks (set dotenv).
eval
Package eval is the total tree-walking evaluator for the Runefile expression sublanguage: it turns an ast.Expr into a string Value.
Package eval is the total tree-walking evaluator for the Runefile expression sublanguage: it turns an ast.Expr into a string Value.
formatter
Package formatter renders a parsed Runefile back into its canonical source form.
Package formatter renders a parsed Runefile back into its canonical source form.
language
Package language provides language intelligence over an analysis Snapshot: the symbol index (by name, qualified name, and document), scope lookup, context-aware completion, definition resolution, hover content, and the single structured registry of Rune built-ins, settings, and attributes (spec FR-026, FR-027).
Package language provides language intelligence over an analysis Snapshot: the symbol index (by name, qualified name, and document), scope lookup, context-aware completion, definition resolution, hover content, and the single structured registry of Rune built-ins, settings, and attributes (spec FR-026, FR-027).
lexer
Package lexer is a hand-written, state-function lexer (Pike style) for the Runefile language.
Package lexer is a hand-written, state-function lexer (Pike style) for the Runefile language.
lsp
Package lsp is the protocol glue for `rune lsp`: a JSON-RPC 2.0 server over stdio speaking a minimal typed subset of LSP 3.17.
Package lsp is the protocol glue for `rune lsp`: a JSON-RPC 2.0 server over stdio speaking a minimal typed subset of LSP 3.17.
mask
Package mask provides emission-time masking of secret values in Rune's output streams, so credentials never reach a terminal transcript or an agent's chat history (spec 013-secret-masking).
Package mask provides emission-time masking of secret values in Rune's output streams, so credentials never reach a terminal transcript or an agent's chat history (spec 013-secret-masking).
parser
Package parser is a hand-written recursive-descent parser for the Runefile declarative grammar, with a Pratt sub-parser (expr.go) for the expression sublanguage.
Package parser is a hand-written recursive-descent parser for the Runefile declarative grammar, with a Pratt sub-parser (expr.go) for the expression sublanguage.
planstore
Package planstore keeps the plans a task captured until an apply task takes one of them, exactly once.
Package planstore keeps the plans a task captured until an apply task takes one of them, exactly once.
runtime
Package runtime selects and drives the executor for a task body: the default pure-Go shell (internal/runtime/shell), a temp-file interpreter for python/node/custom or a `set shell` override (internal/runtime/interp), or the AI-agent driver (internal/runtime/agent).
Package runtime selects and drives the executor for a task body: the default pure-Go shell (internal/runtime/shell), a temp-file interpreter for python/node/custom or a `set shell` override (internal/runtime/interp), or the AI-agent driver (internal/runtime/agent).
runtime/agent
Package agent runs (agent) task bodies by driving an installed agent CLI (claude/codex/copilot/…) behind a vendor-neutral Provider interface (Principle VII / FR-030).
Package agent runs (agent) task bodies by driving an installed agent CLI (claude/codex/copilot/…) behind a vendor-neutral Provider interface (Principle VII / FR-030).
runtime/interp
Package interp runs python/node/custom (and `set shell`-override) task bodies by writing the interpolated body to a temp file and exec-ing the configured interpreter against it (the just shebang/[script] model).
Package interp runs python/node/custom (and `set shell`-override) task bodies by writing the interpolated body to a temp file and exec-ing the configured interpreter against it (the just shebang/[script] model).
runtime/scheduler
Package scheduler builds and runs the task dependency DAG.
Package scheduler builds and runs the task dependency DAG.
runtime/shell
Package shell runs (sh) task bodies through the pure-Go mvdan/sh interpreter.
Package shell runs (sh) task bodies through the pure-Go mvdan/sh interpreter.
sandbox
Package sandbox confines a command with what the operating system offers: no network unless asked for, a read-only view of the host, and one writable directory.
Package sandbox confines a command with what the operating system offers: no network unless asked for, a read-only view of the host, and one writable directory.
selfupgrade
Package selfupgrade replaces the running rune binary with the latest stable release.
Package selfupgrade replaces the running rune binary with the latest stable release.
selfupgrade/upgradetest
Package upgradetest builds a signed fixture release on a local TLS server, in the layout a real Rune release has.
Package upgradetest builds a signed fixture release on a local TLS server, in the layout a real Rune release has.
semver
Package semver is a small, dependency-free Semantic Versioning 2.0.0 parser and comparator, sufficient for Rune's `minimum_version` requirement gate.
Package semver is a small, dependency-free Semantic Versioning 2.0.0 parser and comparator, sufficient for Rune's `minimum_version` requirement gate.
style
Package style is the single source of truth for Rune's non-interactive terminal styling.
Package style is the single source of truth for Rune's non-interactive terminal styling.
styletest
Package styletest provides shared test helpers for asserting terminal styling.
Package styletest provides shared test helpers for asserting terminal styling.
suggest
Package suggest finds the closest name for did-you-mean hints.
Package suggest finds the closest name for did-you-mean hints.
token
Package token defines the lexical tokens of the Runefile language and the source-position types that every token and AST node carries.
Package token defines the lexical tokens of the Runefile language and the source-position types that every token and AST node carries.
tui
Package tui implements Rune's interactive task picker (the `--choose` experience) as a Bubble Tea program.
Package tui implements Rune's interactive task picker (the `--choose` experience) as a Bubble Tea program.
Package mcpserver exposes a Runefile's non-private tasks to AI agents and IDEs as Model Context Protocol tools.
Package mcpserver exposes a Runefile's non-private tasks to AI agents and IDEs as Model Context Protocol tools.
test
docs
Package docs holds the documentation verification harness.
Package docs holds the documentation verification harness.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL