commandry is a command line parser for Standard ML.
val cli: string Cli.parser =
Cli.app "hello" "1.0.0" "Says hello to someone"
(fn name => name)
|> Cli.positional {name = "name", help = "Someone's name"}
|> Cli.cli
fun main () =
Cli.exec (fn name => print ("Hello, " ^ name)) cli- Declarative builder pattern: Construct command line by chaining functions together
- Rich argument types: Supports flags, string/int options with defaults, and positional arguments (required, optional or variadic)
- Nested subcommands: Create hierarchical command structures
- Auto-generated help: Automatic
--helpand--versionflags with formatted usage text
The library is a single file, copy src/cli.sml into your project.
See the docs/ directory for detailed guides: