argparser — lilu API

←index

Overview

Command-line argument parser with typed options, positional arguments, subcommands, and auto-generated help. Supports boolean negation, repeatable options, choice validation, and Levenshtein-based typo suggestions.

Functions

NameSignature
format_helpformat_help(cmd) -> help
commandcommand(name, opts) -> cmd
format_errorformat_error(err) -> message

format_help(cmd) -> help

Generate markdown-formatted help text for a command

command(name, opts) -> cmd

Create a new command parser with options, arguments, and subcommands

Returns a command object with chainable builder methods:

The opts table accepts default_subcommand (string) and subcommand_required (boolean, defaults to true).

format_error(err) -> message

Format a parse error into a human-readable string