Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ jobs:
run: cargo build --release --target ${{ matrix.target }}
- name: Rename artifact
run: |
mv target/${{ matrix.target }}/release/mx${{ matrix.ext }} target/${{ matrix.target }}/release/mx-${{ matrix.asset_name}}${{ matrix.ext }}
mv target/${{ matrix.target }}/release/mq-task${{ matrix.ext }} target/${{ matrix.target }}/release/mq-task-${{ matrix.asset_name}}${{ matrix.ext }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: mx-${{ matrix.asset_name }}
name: mq-task-${{ matrix.asset_name }}
path: |
target/${{ matrix.target }}/release/mx-${{ matrix.asset_name}}${{ matrix.ext }}
target/${{ matrix.target }}/release/mq-task-${{ matrix.asset_name}}${{ matrix.ext }}
if-no-files-found: error
retention-days: 1

Expand All @@ -56,12 +56,12 @@ jobs:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: mx*
pattern: mq-task*
path: target
- name: Generate checksums
run: |
cd target
for file in mx*/*; do
for file in mq-task*/*; do
sha256sum "$file" >> checksums.txt
done
mkdir checksums
Expand Down
31 changes: 12 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 6 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
[package]
authors = ["Takahiro Sato <harehare1110@gmail.com>"]
categories = ["command-line-utilities", "text-processing"]
description = "Core language implementation for mq query language"
description = "A task runner using Markdown"
edition = "2024"
homepage = "https://mqlang.org/"
keywords = ["markdown", "jq", "task runner"]
license = "MIT"
name = "mx"
name = "mq-task"
readme = "README.md"
repository = "https://github.com/harehare/mq"
version = "0.1.1"

[[bin]]
name = "mx"
name = "mq-task"
path = "src/main.rs"

[lib]
name = "mx"
name = "mq_task"
path = "src/lib.rs"

[dependencies]
clap = {version = "4.5.48", features = ["derive"]}
colored = "2.1"
miette = {version = "7.6.0", features = ["fancy"]}
mq-lang = {git = "https://github.com/harehare/mq.git", package = "mq-lang"}
mq-markdown = {git = "https://github.com/harehare/mq.git", package = "mq-markdown"}
mq-lang = "0.5.5"
mq-markdown = "0.5.5"
serde = {version = "1.0", features = ["derive"]}
serde_json = "1.0"
thiserror = "2.0.17"
toml = "0.8.21"
which = "7.0.1"

[dev-dependencies]
mq-test = {git = "https://github.com/harehare/mq.git", package = "mq-test"}
51 changes: 27 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
<h1 align="center">mx</h1>
<h1 align="center">mq-task</h1>

Markdown Task Runner

[![ci](https://github.com/harehare/mx/actions/workflows/ci.yml/badge.svg)](https://github.com/harehare/mx/actions/workflows/ci.yml)
[![ci](https://github.com/harehare/mq-task/actions/workflows/ci.yml/badge.svg)](https://github.com/harehare/mq-task/actions/workflows/ci.yml)

`mx` is a task runner that executes code blocks in Markdown files based on section titles.
`mq-task` is a task runner that executes code blocks in Markdown files based on section titles.
It is implemented using [mq](https://github.com/harehare/mq), a jq-like command-line tool for Markdown processing, to parse and extract sections from Markdown documents.

![demo](assets/demo.gif)

> [!WARNING]
> `mx` is currently under active development.
> `mq-task` is currently under active development.

> [!NOTE]
> This project was previously named `mx` and has been renamed to `mq-task`.

## Features

Expand All @@ -25,18 +28,18 @@ It is implemented using [mq](https://github.com/harehare/mq), a jq-like command-
### Quick Install

```bash
curl -sSL https://raw.githubusercontent.com/harehare/mx/refs/heads/main/bin/install.sh | bash
curl -sSL https://raw.githubusercontent.com/harehare/mq-task/refs/heads/main/bin/install.sh | bash
```

The installer will:
- Download the latest mq binary for your platform
- Install it to `~/.mx/bin/`
- Install it to `~/.mq/bin/`
- Update your shell profile to add mq to your PATH

### Cargo

```sh
$ cargo install --git https://github.com/harehare/mx.git
$ cargo install --git https://github.com/harehare/mq-task.git
```

## Usage
Expand All @@ -45,17 +48,17 @@ $ cargo install --git https://github.com/harehare/mx.git

```bash
# Run from README.md (default)
mx "Task Name"
mq-task "Task Name"

# Run from a specific file
mx -f tasks.md "Task Name"
mq-task -f tasks.md "Task Name"
```

### Run a task (explicit)

```bash
mx run "Task Name"
mx run --file tasks.md "Task Name"
mq-task run "Task Name"
mq-task run --file tasks.md "Task Name"
```

### Pass arguments to a task
Expand All @@ -64,13 +67,13 @@ You can pass arguments to your task using `--` separator:

```bash
# Pass arguments to a task
mx "Task Name" -- arg1 arg2 arg3
mq-task "Task Name" -- arg1 arg2 arg3

# With explicit run command
mx run "Task Name" -- arg1 arg2 arg3
mq-task run "Task Name" -- arg1 arg2 arg3

# From a specific file
mx -f tasks.md "Task Name" -- arg1 arg2
mq-task -f tasks.md "Task Name" -- arg1 arg2
```

Arguments are accessible via environment variables:
Expand All @@ -93,24 +96,24 @@ echo "Second arg: $MX_ARG_1"

```bash
# List tasks from README.md (default)
mx
mq-task

# List tasks from a specific file
mx -f tasks.md
mx list --file tasks.md
mq-task -f tasks.md
mq-task list --file tasks.md
```

### Initialize configuration

```bash
mx init
mq-task init
```

This creates an `mx.toml` file with default runtime settings.
This creates an `mq-task.toml` file with default runtime settings.

## Configuration

Create an `mx.toml` file to customize runtime behavior:
Create an `mq-task.toml` file to customize runtime behavior:

```toml
# Heading level for sections (default: 2, i.e., ## headings)
Expand Down Expand Up @@ -163,14 +166,14 @@ execution_mode = "file"

```bash
# Using shorthand (from tasks.md by default)
mx Build
mq-task Build

# From a specific file
mx -f tasks.md Build
mq-task -f tasks.md Build

# Using explicit run command
mx run Build
mx run --file tasks.md Build
mq-task run Build
mq-task run --file tasks.md Build
```

## License
Expand Down
10 changes: 5 additions & 5 deletions assets/demo.tape
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ Type "clear"
Enter
Show

Type `mx`
Type `mq-task`
Enter
Sleep 1.5s

Type `mx JavaScript`
Type `mq-task JavaScript`
Enter
Sleep 1.5s

Type `mx Go`
Type `mq-task Go`
Enter
Sleep 1.5s

Type `mx Python`
Type `mq-task Python`
Enter
Sleep 1.5s

Type `mx mq`
Type `mq-task mq`
Enter
Sleep 1.5s
Loading