Skip to content

v0.21.0

Choose a tag to compare

@mizchi mizchi released this 20 Mar 07:35
· 102 commits to main since this release

Pure MoonBit --jq Support

This release adds built-in jq filtering powered by mizchi/jq — a pure MoonBit jq implementation with no external dependencies.

--jq / -q Flag

Works on run view, run list, and run watch, matching the gh CLI interface:

# Extract specific fields from jobs
actrun run view run-1 --json jobs --jq '.jobs[] | {name, conclusion}'
# → {"name":"build","conclusion":"success"}

# Filter list results
actrun run list --json conclusion,workflowName --jq '.[] | .workflowName'
# → "ci"

# Get step names
actrun run view run-1 --json jobs --jq '.jobs[].steps[] | .name'
# → "Checkout"
# → "Test"

# Short form
actrun run view run-1 -q '.status'
# → "completed"

Combines with --json fields

--json field selection is applied first, then --jq filters the result:

actrun run view run-1 --json status,conclusion --jq '.conclusion'
# → "success"

Supported jq Features

Powered by mizchi/jq@0.1.1:

  • Field access (.field, .nested.field)
  • Array iteration (.[], .[0], .[1:3])
  • Pipe (|), Object/Array construction
  • Builtins: select(), map(), length, keys, values, sort_by, group_by, unique_by, flatten, add, any, all, join, split, test, capture, tostring, tonumber, to_entries, from_entries, with_entries, recurse, walk, env, try-catch, reduce, if-then-else, def, and more

Full Changelog

v0.21.0: Add -q/--jq <expression> to run view, run list, run watch
v0.21.1: Add 29 comprehensive jq tests (parser, pure functions, gh patterns, integration, E2E) — 651 tests total