README.md

May 29, 2026 · View on GitHub

rex

run anything, know nothing.

Mentioned in Awesome Go CI Go Report Card Coverage Release License

InstallDemoCommandsStacksHow it works


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

Text version
$ 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

CommandWhat it does
rexShow project overview
rex testRun tests
rex runStart the app / dev server
rex buildBuild the project
rex depsInstall dependencies
rex cleanRemove build artifacts
rex freshclean → deps → build (the "I pulled and it broke" fix)
rex fmtFormat code
rex lintLint code
rex watch [verb]Watch files and re-run on change (default: test)
rex ciGenerate GitHub Actions CI workflow for your stack
rex dockerGenerate multi-stage Dockerfile for your stack
rex composeGenerate docker-compose.yml for your stack
rex statsShow project report (files, lines, size)
rex badgeGenerate README badge markdown
rex clone <url>Clone + detect + install deps (URL to ready in one command)
rex initGenerate rex.toml from detected commands (commit for your team)
rex completionGenerate shell completions (bash/zsh/fish)
rex doctorDiagnose 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

StackPackage managersDetection
Gogo modulesgo.mod
Nodenpm, pnpm, yarn, bunpackage.json + lockfile
Pythonpip, uv, poetry, pipenvpyproject.toml, requirements.txt, setup.py
RustcargoCargo.toml
PHPcomposercomposer.json (detects Laravel via artisan)
RubybundlerGemfile (detects Rails via app/ + config/)
Javamaven, gradlepom.xml, build.gradle (uses wrapper if present)
Zigzigbuild.zig
Elixirmixmix.exs (detects Phoenix via assets/)
Dockerdocker composedocker-compose.yml, compose.yml
MakeMakefile
JustJustfile

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

  1. Detect — Rex looks at your project root for known files (go.mod, package.json, Cargo.toml, etc.)
  2. Resolve — It maps standard verbs (test, run, build...) to the correct command for your stack
  3. 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 moderex watch re-runs on file change
  • .env loading — auto-loads .env before 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