rex
Zero-config universal project runner. Detects your stack (Go, Node, Python, Rust, PHP, Zig, Elixir) and runs the right command
About rex
rex detects your project's stack and runs the right command. No config file. No README reading. No memorizing.
git clone https://github.com/someone/unknown-project
cd unknown-project
rex test
That's it. Works for Go, Node, Python, Rust, Java, Ruby, PHP, Zig, Elixir, Docker, Make, and Just projects.
Demo
https://github.com/rexrun-dev/rex/releases/download/v0.2.0/demo.mp4
$ cd some-go-project/
$ rex
š¦ some-go-project
stack go
commands
rex test ā go test ./...
rex run ā go run ./cmd/server
rex build ā go build ./...
rex deps ā go mod download
rex fmt ā gofmt -w .
rex lint ā go vet ./...
rex clean ā go clean -cache
$ rex test
ā go test ./...
ok github.com/example/app 1.2s
$ cd some-node-project/
$ rex
š¦ some-node-project
stack node + pnpm
commands
rex test ā pnpm test
rex run ā pnpm run dev
rex build ā pnpm run build
rex deps ā pnpm install
rex clean ā rm -rf node_modules dist .next .nuxt build out
Install
# Homebrew (macOS/Linux)
brew tap rexrun-dev/tap && brew install rex
# Go
go install rexrun.dev/rex/cmd/rex@latest
Or download a binary from Releases.
Commands
| Command | What it does |
|---|---|
rex | Show project overview |
rex test | Run tests |
rex run | Start the app / dev server |
rex build | Build the project |
rex deps | Install dependencies |
rex clean | Remove build artifacts |
rex fresh | clean ā deps ā build (the "I pulled and it broke" fix) |
rex fmt | Format code |
rex lint | Lint code |
rex watch [verb] | Watch files and re-run on change (default: test) |
rex ci | Generate GitHub Actions CI workflow for your stack |
rex docker | Generate multi-stage Dockerfile for your stack |
rex compose | Generate docker-compose.yml for your stack |
rex stats | Show project report (files, lines, size) |
rex badge | Generate README badge markdown |
rex clone <url> | Clone + detect + install deps (URL to ready in one command) |
rex init | Generate rex.toml from detected commands (commit for your team) |
rex completion | Generate shell completions (bash/zsh/fish) |
rex doctor | Diagnose environment issues |
Flags
rex --list # show all detected commands
rex --dry-run test # show what would run without executing
rex test -- -v -run TestFoo # pass extra args to underlying command
Supported Stacks
| Stack | Package managers | Detection |
|---|---|---|
| Go | go modules | go.mod |
| Node | npm, pnpm, yarn, bun | package.json + lockfile |
| Python | pip, uv, poetry, pipenv | pyproject.toml, requirements.txt, setup.py |
| Rust | cargo | Cargo.toml |
| PHP | composer | composer.json (detects Laravel via artisan) |
| Ruby | bundler | Gemfile (detects Rails via app/ + config/) |
| Java | maven, gradle | pom.xml, build.gradle (uses wrapper if present) |
| Zig | zig | build.zig |
| Elixir | mix | mix.exs (detects Phoenix via assets/) |
| Docker | docker compose | docker-compose.yml, compose.yml |
| Make | ā | Makefile |
| Just | ā | Justfile |
Rex reads existing task runners first. If your project has a Makefile, Justfile, or Taskfile, those take priority.
Monorepo support
Rex auto-detects monorepos (packages/, apps/, services/ etc.) and shows all sub-projects:
$ rex
š¦ my-monorepo (monorepo)
workspace 3 sub-projects detected
packages/api ā node + pnpm
packages/web ā node + pnpm
services/auth ā go
hint: cd into a sub-project, then use rex test
How It Works
- Detect ā Rex looks at your project root for known files (
go.mod,package.json,Cargo.toml, etc.) - Resolve ā It maps standard verbs (test, run, build...) to the correct command for your stack
- Execute ā It runs the command with full stdio passthrough and correct exit codes
No config needed. No lock-in. No magic.
Priority chain
1. Justfile / Makefile (task runner overrides)
2. package.json scripts / Cargo.toml / go.mod (ecosystem)
3. Language heuristics (fallback)
If a Makefile defines a test target, rex test runs make test ā even in a Go project. Rex respects what's already there.
Philosophy
- Zero config ā works out of the box, in any repo
- Transparent ā always shows what it will run (the
āline) - Fast ā single binary, <50ms startup, no network calls
- Composable ā correct exit codes, works in CI pipelines
- Non-invasive ā creates no files, modifies nothing
- Watch mode ā
rex watchre-runs on file change .envloading ā auto-loads.envbefore commands
Optional: rex.toml
For repos that want to pin commands explicitly:
[commands]
test = "go test -race -count=1 ./..."
run = "air"
build = "goreleaser build --snapshot"
Generate one automatically:
rex init
# ā created rex.toml (go project)
# hint: edit commands to customize, then commit for your team
Rex uses this first when present. Your team always gets the right command.
CI Usage
# GitHub Actions
- run: rex test
# That's it. Works for any stack.
Contributing
git clone https://github.com/rexrun-dev/rex
cd rex
rex test # yes, rex tests itself š¦
License
Apache 2.0
Frequently Asked Questions
What is rex?
rex is a Build Automation library for the Go programming language. Zero-config universal project runner. Detects your stack (Go, Node, Python, Rust, PHP, Zig, Elixir) and runs the right command
How do I install rex?
Install rex with the Go module system using `go get rexrun-dev/rex`. Check the repository for the current installation instructions.
What category does rex belong to?
rex is listed under Build Automation, specifically Build Automation.