mq-task is a task runner that executes code blocks in Markdown files based on section titles.
It is implemented using mq, a jq-like command-line tool for Markdown processing, to parse and extract sections from Markdown documents.
Warning
mq-task is currently under active development.
- Run the code blocks under any heading, in any language with a configured runtime
- Dependencies, parallel execution, loops,
defercleanup and shared variables - Conditions, retries and timeouts, confirmation prompts and output passing
- Named parameters, env and working directory, imports, aliases and private tasks
- Skip up-to-date tasks and
--watchmode mq-task check, dependency graph, interactive TUI and shell completions- Options for scripts and CI: see the CLI reference
curl -sSL https://task.mqlang.org/install.sh | bashor with Cargo:
cargo install --git https://github.com/harehare/mq-task.gitA task is a heading followed by code blocks. A meta block (TOML) adds options such as dependencies, parameters or conditions:
## build
Compile the project.
```bash
cargo build --release
```
## test
```meta
depends = ["build"]
sources = ["src/**/*.rs", "tests/**/*.rs"] # skipped when unchanged
retries = 2
```
```bash
cargo test
```
## deploy
```meta
params = ["env=staging", "region"] # name=default; a bare name is required
depends = ["test"]
prompt = "Deploy?"
if = 'flag("CI") || which("kubectl")'
```
```bash
./deploy.sh "$MX_PARAM_ENV" "$MX_PARAM_REGION"
```
## ci
```meta
depends = ["lint", "test", "build"]
parallel = true
```
```bash
echo "all checks passed"
```
## report
Code blocks can use any language with a runtime.
```python
print("report generated")
```mq-task # list tasks from tasks.md, else README.md
mq-task build # run a task (and its dependencies first)
mq-task deploy -- region=eu # named parameters; positional args also work
mq-task ci -j 4 # run dependencies in parallel
mq-task test --watch # re-run when sources change
mq-task -f docs/dev.md # use another file
mq-task init # write a starter tasks.md- Quick Start and Configuration (
mq-task.toml, runtimes) - Guide, meta keys, CLI and exit codes
- Coming from
justor Task
MIT
