Documentation Index
Fetch the complete documentation index at: https://docs.mirage.strukto.ai/llms.txt
Use this file to discover all available pages before exploring further.
What A Gesture Holds Before It Moves
A Gesture is one coordinated motion, but the motion needs something to hold.cat holds a list of paths. grep holds a pattern and a list of paths. head -n 5 holds a number that shapes how it reaches. Grip is the page where we say what each gesture is allowed to hold and how.
Mirage names grip in three primitives: Option, Operand, and OperandKind. They map cleanly to the POSIX Utility Conventions, but the body framing is what tells you why they exist before the standard tells you what to call them.
Kinds Of Grip
| Grip kind | What the gesture is holding | Mirage type | Example |
|---|---|---|---|
| Empty grip | A flag, a position the gesture takes, holding nothing | Option(value_kind=NONE) | -v, -r |
| Grip on a value | A flag that carries a text or a path with it | Option(value_kind=TEXT|PATH) | -n 10, -f x |
| Fixed grip | A required positional target the gesture always holds | positional: tuple[Operand, ...] | PATTERN in grep |
| Sweeping grip | A trailing list of targets the gesture holds across many | rest: Operand | None | [FILE...] |
grep -i -n -m 5 hello /s3/x.txt /disk/y.txt is two empty grips (-i, -n), one grip on a value (-m 5), one fixed grip (hello), and a sweeping grip over two paths.
POSIX Alignment
Grip is not invented, it tracks the POSIX Utility Conventions (IEEE Std 1003.1, Chapter 12) and the GNU Argument Syntax for long options. The POSIX synopsis:| POSIX term | Grip kind | Mirage type |
|---|---|---|
| Option (no argument) | Empty grip | Option(value_kind=NONE) |
| Option with option-argument | Grip on a value | Option(value_kind=TEXT|PATH) |
| Operand (fixed) | Fixed grip | positional: tuple[Operand, ...] |
| Operand (variadic) | Sweeping grip | rest: Operand | None |
Why OperandKind.NONE Instead of takes_value: bool
POSIX does not define a separate “takes_value” concept. An option simply either has an option-argument or it doesn’t, the kind tells you both whether and what. This is consistent across major CLI frameworks:
- Python argparse: infers from
action(storevsstore_true) - Rust clap: infers from
ArgActionenum - Go cobra/pflag: infers from the Go type (
BoolVarvsStringVar)
value_kind=NONE is an empty grip; value_kind=TEXT or PATH is a grip on a value of that type.
Three Primitives
OperandKind
Option
Models a CLI option (flag). Maps to POSIX “option” + optional “option-argument”, a position the gesture takes, optionally gripping a value with it.Operand
Models a positional argument, what the gesture grips onto by position. Used inpositional (fixed) and rest (sweeping).
Full Example: grep
POSIX synopsis:grep [-civlnFEo] [-m count] pattern [file...]
Grip: ten empty grips, one grip on a value (-m count), one fixed grip (the pattern), one sweeping grip (the file list).
Path-Typed Grip
When an option grips a path (liketar -f archive.tar), setting value_kind=OperandKind.PATH tells the registry to resolve it from virtual path to backend path, the same resolution applied to positional PATH operands. The grip on the value reaches through the same resource routing as the gesture’s main targets.