A task language for explicit, cross-platform workflows.
An Onlyfile describes tasks and their execution stages:
!version 0.4
!var pnpm_dir = "web"
# Internal setup task.
[fail] Preparation failed
_prepare():
| cd {{pnpm_dir}}
| pnpm install
cargo fetch
[help] Run CI
[pass] CI complete
ci()
& _prepare
& (front.check, back.check)
& (front.test, back.test)
:
[help] Frontend checks
[desc] The pnpm dir is {{pnpm_dir}}/
group front {
check():
pnpm --dir {{pnpm_dir}} lint
test():
pnpm --dir {{pnpm_dir}} test
}
[help] Backend checks
group back {
check():
cargo check
test() ? @has("cargo-nextest"):
cargo nextest run
test():
cargo test
}
& advances to the next dependency stage; tasks inside ( ... ) run in parallel.
Run only to list tasks, or run one directly:
only
only ciInspect the resolved workflow before running it:
only ci --dry-run --fullDry run: ci()
├─ stage 1
│ └─ _prepare
│ ├─ block (deno)
│ │ ├─ cd web
│ │ └─ pnpm install
│ └─ cargo fetch
├─ stage 2 (parallel)
│ ├─ front.check
│ │ └─ pnpm --dir web lint
│ └─ back.check
│ └─ cargo check
├─ stage 3 (parallel)
│ ├─ front.test
│ │ └─ pnpm --dir web test
│ └─ back.test
│ └─ cargo nextest run
└─ stage 4
└─ ci
Format the file with:
only --fmtThe workflow structure stays in the task definition instead of being hidden in shell control flow. See the usage guide for parameters, guards, shells, command blocks, and groups.
- Explicit stages —
&expresses order and( ... )expresses parallelism. - Structured tasks — parameters, guards, groups, helpers, and metadata are part of the language.
- Cross-platform commands — use the built-in shell by default, or select a host shell when needed.
- Inspectable workflows — the formatter, diagnostics, editor tooling, and
--dry-run --fullunderstand the same task graph.
just, Task, and Only can all run project commands. Only focuses on making execution stages and parallel groups explicit in the task definition.
| Tool | Model | Best fit |
|---|---|---|
just |
recipes and dependencies | command recipes and scripts |
Task |
YAML task definitions | declarative task configuration |
| Only | tasks and execution stages | explicit workflow structure |
curl -fsSL https://raw.githubusercontent.com/KercyDing/only/master/install.sh | shirm https://raw.githubusercontent.com/KercyDing/only/master/install.ps1 | iexcargo install onlyparu -S only-binFor the latest Git version:
paru -S only-gitcargo install --git https://github.com/KercyDing/only onlyonly --upgradeor:
only --update