run
Built in Rust for developers who live in multiple runtimes.
rungives you a consistent CLI, persistent REPLs, and batteries-included examples for your favorite languages.
- ✨ Highlights
- 🚀 Quickstart
- 📦 Installation
- 🧠 How it works
- 🌍 Supported languages
- 🧪 Examples
- 🔁 REPL cheat sheet
- 🧩 Extending run
- Testing & quality
- 📡 Release automation
- 📄 License
✨ Highlights
- One command, many runtimes. Switch between Python, Go, Rust, TypeScript, Zig, Haskell, and more without leaving the same shell session.
- Stateful REPLs. Every engine keeps session history, understands
:reset,:load, and language shortcuts (:py,:go, …), and auto-detects snippets when you want it to. - Inline, files, or stdin. Evaluate one-liners with
--code, run files with detection heuristics, or pipe input from another process. - Production-ready binaries. Release workflow ships signed archives, Homebrew and Scoop manifests, plus Debian packages straight from CI.
- Extensible by design. Drop in a new
LanguageEngineimplementation and wire it into the registry to makerunspeak yet another language. - Developer ergonomics. Rich metadata (
run --version), fast autocomplete-friendly subcommands, and examples for every supported runtime.
🚀 Quickstart
# Show build metadata for the current binary
# Execute a snippet explicitly
# Let run detect language from the file extension
# Drop into the interactive REPL (type :help inside)
# Pipe stdin (here: JSON) into Node.js
|
Pro tip: run aliases the first positional argument, so run py script.py works just like run --lang python script.py.
📦 Installation
All release assets are published on the GitHub Releases page, including macOS builds for both Apple Silicon (arm64) and Intel (x86_64). Pick the method that fits your platform:
Installs the
runbinary from therun-kitcrate. Updating? Runcargo install run-kit --force.
ℹ️ This formula is published as a standalone file on each release; it isn’t part of the default Homebrew taps. Installing by name (
brew install homebrew-run) will fail—always point Homebrew to the release URL above (or download the file and runbrew install ./homebrew-run.rb).
Once the latest release artifacts are published, Homebrew automatically selects the correct macOS binary for your CPU (Intel or Apple Silicon) based on this formula.
DEB_FILE=
scoop install https://github.com/Esubaalew/run/releases/latest/download/run-scoop.json
Pass --version v0.2.0, --prefix /usr/local/bin, or --repo yourname/run to customize the install.
- Grab the
tar.gz(macOS/Linux) orzip(Windows) from the latest release. - Extract it and copy
run/run.exeonto yourPATH. - Optionally execute the bundled
install.shto handle the copy for you.
The project targets Rust 1.70+. Installing from crates.io gives you the same run binary that CI publishes; use --force when upgrading to a newer release.
🧠 How it works
run shells out to real toolchains under the hood. Each LanguageEngine implements a small trait that knows how to:
- Detect whether the toolchain is available (e.g.
python3,go,rustc). - Prepare a temporary workspace (compilation for compiled languages, transient scripts for interpreters).
- Execute snippets, files, or stdin streams and surface stdout/stderr consistently.
- Manage session state for the interactive REPL (persistent modules, stateful scripts, or regenerated translation units).
This architecture keeps the core lightweight while making it easy to add new runtimes or swap implementations.
🌍 Supported languages
run ships with 25+ batteries-included engines. Grouped by flavor:
| Category | Languages & aliases | Toolchain expectations |
|---|---|---|
| Scripting & shells | Bash (bash), Python (py, python), Ruby (rb, ruby), PHP (php), Perl (perl), Lua (lua), R (r), Elixir (ex, elixir) |
Matching interpreter on PATH |
| Web & typed scripting | JavaScript (js, node), TypeScript (ts, deno), Dart (dart), Swift (swift), Kotlin (kt, kotlin) |
node, deno, dart, swift, kotlinc + JRE |
| Systems & compiled | C (c), C++ (cpp, cxx), Rust (rs, rust), Go (go), Zig (zig), Nim (nim), Haskell (hs, haskell), Crystal (cr, crystal), C# (cs, csharp), Java (java), Julia (jl, julia) |
Respective compiler / toolchain |
Auto-detection heuristics consider file extensions and can fall back to the last language you used. Run run :languages inside the REPL to see the full list with availability checks.
🧪 Examples
Real programs live under the examples/ tree—each language has a hello and a progress scenario. The headers document expected output so you can diff your toolchain.
Use these as smoke tests or as a starting point for sharing snippets with your team.
🔁 REPL cheat sheet
| Command | Purpose |
|---|---|
:help |
List available meta commands |
:languages |
Show detected engines and status |
:lang <id> or :<alias> |
Switch the active language (:py, :go, …) |
:detect on/off/toggle |
Control snippet language auto-detection |
:load path/to/file |
Execute a file inside the current session |
:reset |
Clear the accumulated session state |
:exit / :quit |
Leave the REPL |
Language-specific tips (persistence model, auto-print behavior, etc.) are summarised in the built-in :help prompt.
🧩 Extending run
- Add a new file in
src/engine/implementing theLanguageEnginetrait. - Register it inside
LanguageRegistry::bootstrap()and provide aliases inlanguage::ALIASES. - Add detection hints if the language benefits from extra heuristics.
- Document usage with new examples and include integration tests.
Use the Python or Go engines as a template—they cover both scripting and compiled workflows.
Testing & quality
Tests will automatically skip engines if their toolchain is missing. For release parity, also run cargo fmt, cargo clippy -- -D warnings, and try a spot check via run examples/python/counter.py.
📡 Release automation
GitHub Actions builds signed binaries for macOS, Linux, and Windows, creates Homebrew/Scoop manifests, publishes Debian packages, and generates changelog entries with git-cliff. Tagging v* is all it takes to cut a release.
📄 License
Apache 2.0. See LICENSE for details.
Built with ❤️ in Rust. If run unblocks your workflow, star the repo and share it with other polyglot hackers.