Skip to content
This repository was archived by the owner on Nov 22, 2026. It is now read-only.

mojo-args v0.1.0

Choose a tag to compare

@amarbarosys amarbarosys released this 21 Oct 07:18
· 24 commits to main since this release

mojo-args v0.1.0

Released: 2026-10-21 · Commit: 7353d4b · Previous: first release

What it does

Command-line parsing for Mojo with Python argparse's behaviour: sub-commands, typed and repeatable options, a remainder command, prefix abbreviation, and argparse's own usage-error messages.

Highlights

  • Same parse results and the same usage-error text as Python argparse on 75 argv cases, 34 of them errors.
  • argparse's quirks included: unique-prefix abbreviation, ambiguous-prefix errors, -- kept by a remainder, --opt=value, bundled short flags.
  • 13x faster than argparse: 200k parses in 252 to 259 ms vs 3,346 to 3,367 ms; building a parser takes 0.05 ms vs 11.3 ms.

Changes

First public release, no earlier version.

Verified

Check Result
scripts/check.sh: 75 argv cases vs Python 3.14 argparse, plus api test, example and a real process (exit 2, stderr) PASS all
scripts/ci.sh on a pristine Ubuntu 24.04.5 VM (installs CPython 3.14.8) PASS all
two mutants (a changed message, a broken remainder) both fail the gate

Known limits

  • --help output is simple and not checked against argparse.
  • A sub-command usage error prints the top-level usage line, where argparse prints the sub-command's.
  • Integers are Int64, ASCII digits only.

Upgrade / run

git clone https://github.com/amarbaro/mojo-args && cd mojo-args && uv sync
mojo run -I src examples/quickstart.mojo

Commits

  • 7353d4b build: uv.lock (mojo 1.1.0)
  • 91a4661 ci(args): GitHub Actions runs scripts/ci.sh with Python 3.14 as the oracle
  • 7f610fe docs(args): README with numbers and limits, api.md, design.md, agent skill
  • 2198e6e bench(args): 200k parses of the gpu-wait parser, 13x faster than argparse
  • eeed809 feat(args): argparse-compatible parser for Mojo, 75 cases identical to Python
  • cfc3708 test(args): argparse oracle on gpu-wait's parser shape, 23 argv cases
  • 1df9997 chore: repo layout, Apache-2.0, mojo>=1.1