# Run project tasks across ecosystems with OMG

Discover and run named tasks from Cargo, JavaScript, Python, Go Task, Ruby, Java, PHP, mise, and Make project files with omg run.

Canonical: https://getomg.xyz/guides/task-runner/
Updated: 2026-09-22
Author: OMG maintainers

## Run project tasks through one command

In multi-language projects and polyglot teams, developers constantly switch between different task runners: `cargo` in Rust, `npm`/`pnpm`/`bun` in JavaScript, `poetry` in Python, `go task` in Go, and `make` for legacy tooling. Remembering the specific runner syntax and configuration file for every project slows down daily development.

OMG’s task runner in `src/core/task_runner.rs` discovers supported project tasks and runs them with `omg run <task>`. It can select a runtime required by a supported task before executing the underlying command.

### Run project tasks with OMG

```sh
omg run build
omg run test
omg run dev -- --port 8080
```

Name a task when running this command. The CLI requires the task argument; if multiple ecosystems define the same task at equal priority, an attended shell prompts you to choose one.

## Ecosystem detection priority

When a repository contains multiple project files (for example, a monorepo with a `Makefile`, a `Cargo.toml`, and a `package.json`), OMG avoids ambiguity by evaluating tasks according to an explicit, compiled priority hierarchy in `src/core/task_runner.rs`:

### Task runner ecosystem priority order

| Ecosystem and priority | Manifest files and detection logic |
| --- | --- |
| 1. Rust (Priority 100) | Cargo.toml enables the built-in Cargo tasks build, test, check, run, clippy, and fmt. |
| 2. Node / Bun / Deno (Priority 90) | package.json scripts and deno.json tasks. The packageManager field or recognized lockfiles select npm, pnpm, Yarn, or Bun for package.json scripts; current bun.lock is not recognized without packageManager. |
| 3. Python (Priority 80) | pyproject.toml [tool.poetry.scripts] and Pipfile [scripts]. |
| 4. Go Task (Priority 75) | Taskfile.yml or Taskfile.yaml enables task --list and fallback execution through task. |
| 5. Ruby (Priority 70) | Rakefile enables task listing and fallback execution through rake. |
| 6. Java (Priority 60) | pom.xml (Apache Maven) or build.gradle / build.gradle.kts (Gradle). |
| 7. PHP (Priority 50) | composer.json (`scripts`) executed via composer. |
| 8. mise (Priority 45) | mise.toml or .mise.toml [tasks.*] declarations, parsed and planned without spawning the mise CLI; task scripts run through a shell. |
| 9. Make (Priority 40) | Makefile targets executed via make. |
| OMG Project Config | .omg.toml [scripts] selects a preferred ecosystem when an existing task name is ambiguous; it does not define executable tasks. |

## Argument forwarding and environment passthrough

OMG passes arguments directly to the underlying tool using the standard `--` separator. All flags following `--` are forwarded untouched to the underlying compiler, test framework, or script.

### Forwarding arguments to underlying tasks

```sh
omg run test -- --nocapture
omg run build -- --release
omg run lint -- --fix
```

## Native execution of mise.toml tasks

If you are migrating a repository from mise or working in a repository that uses `mise.toml` for task definitions (`[tasks.build]`, `[tasks.test]`), OMG runs these tasks natively in pure Rust. You do not need to install the mise binary or convert your configuration: OMG detects and executes `[tasks.*]` entries out of the box.

## Sources and verification

Source-reviewed guidance; not a claim of execution on every supported platform.

- [OMG task runner implementation (src/core/task_runner.rs)](https://getomg.xyz/docs/architecture/)

- [OMG CLI reference for omg run](https://getomg.xyz/docs/cli/)

- [OMG daily workflows guide](https://getomg.xyz/docs/workflows/)

## Related pages

- https://getomg.xyz/compare/omg-vs-mise/

- https://getomg.xyz/guides/reproducible-dev-environments/

- https://getomg.xyz/docs/runtimes/

