[{"name":"Cli.Option","comment":" Build command-line options as string values, with validation and transformation.\n\nThis module treats all CLI input as strings. Use [`validateMap`](#validateMap) to parse\nstrings into typed values, [`oneOf`](#oneOf) for enumerated values, and\n[`validate`](#validate) for custom validation.\n\nFor typed options with JSON schema generation, see [`Cli.Option.Typed`](Cli-Option-Typed).\n\nHere is the terminology used for building up Command-Line parsers with this library.\n\n![Terminology Legend](https://raw.githubusercontent.com/dillonkearns/elm-cli-options-parser/master/terminology.png)\n\nSee the README and the [`examples`](https://github.com/dillonkearns/elm-cli-options-parser/tree/master/examples/src) folder for more in-depth examples of building\nand using `Cli.Option`s.\n\n\n## Positional Arguments\n\n@docs requiredPositionalArg\n\n\n## Keyword Arguments\n\n@docs optionalKeywordArg, requiredKeywordArg, keywordArgList\n\n\n## Flags\n\n@docs flag\n\n\n## Ending Options\n\nSee note in `Cli.OptionsParser` docs.\n\n@docs optionalPositionalArg, restArgs\n\n\n## Transformations\n\n\n### Mutually Exclusive Values\n\n@docs oneOf\n\n\n### Validation\n\nValidations allow you to guarantee that if you receive the data in Elm, it\nmeets a set of preconditions. If it doesn't, the User will see an error message\ndescribing the validation error, which option it came from, and the value the\noption had.\n\nNote that failing a validation will not cause the next `OptionsParser` in\nyour `Cli.Program.Config` to be run. Instead,\nif the OptionsParser is a match except for validation errors, you will get an\nerror message regardless.\n\nExample:\n\n\n    capitalizedNameRegex =\n        \"[A-Z][A-Za-z]*\"\n\n    validateParser =\n        OptionsParser.build (\\a b -> ( a, b ))\n            |> with\n                (Option.requiredKeywordArg \"name\"\n                    |> Option.validate (Cli.Validate.regex capitalizedNameRegex)\n                )\n            |> with\n                (Option.optionalKeywordArg \"age\"\n                    |> Option.validateMapIfPresent String.toInt\n                )\n\n    {-\n       $ ./validation --name Mozart --age 262\n       Mozart is 262 years old\n\n       $ ./validation --name Mozart --age \"Two-hundred and sixty-two\"\n       Validation errors:\n\n       `age` failed a validation. could not convert string 'Two-hundred and sixty-two' to an Int\n       Value was:\n       Just \"Two-hundred and sixty-two\"\n    -}\n\nSee `Cli.Validate` for some validation helpers that can be used in conjunction\nwith the following functions.\n\n@docs validate, validateIfPresent, validateMap, validateMapIfPresent\n\n\n### Mapping/Defaults\n\n@docs map, mapFlag, withDefault\n\n\n### Metadata\n\n@docs withDescription, withDisplayName, withMissingMessage\n\n\n## Types\n\n@docs Option, BeginningOption, OptionalPositionalArgOption, RestArgsOption\n\n","unions":[{"name":"BeginningOption","comment":" Phantom type marker for beginning options.\n\n`BeginningOption`s can only be used with `OptionsParser.with`.\n\n","args":[],"cases":[]},{"name":"OptionalPositionalArgOption","comment":" Phantom type marker for optional positional arg options.\n\n`OptionalPositionalArgOption`s can only be used with `OptionsParser.withOptionalPositionalArg`.\n\n","args":[],"cases":[]},{"name":"RestArgsOption","comment":" Phantom type marker for rest args options.\n\n`RestArgsOption`s can only be used with `OptionsParser.withRestArgs`.\n\n","args":[],"cases":[]}],"aliases":[{"name":"Option","comment":" The type returned by the builder functions below. Use with `OptionsParser.with`.\n","args":["from","to","middleOrEnding"],"type":"Cli.Option.Internal.Option from to middleOrEnding"}],"values":[{"name":"flag","comment":" A flag with no argument.\n\nExample: `--debug` in `elm make --debug`\nParses to: `True` (or `False` if omitted)\n\n    Option.flag \"debug\"\n\n","type":"String.String -> Cli.Option.Option Basics.Bool Basics.Bool { position : Cli.Option.BeginningOption }"},{"name":"keywordArgList","comment":" A keyword argument that can be provided multiple times.\n\nExample: `--header \"Auth: token\" --header \"Accept: json\"`\nParses to: `[\"Auth: token\", \"Accept: json\"]`\n\n    Option.keywordArgList \"header\"\n\n","type":"String.String -> Cli.Option.Option (List.List String.String) (List.List String.String) { position : Cli.Option.BeginningOption }"},{"name":"map","comment":" Transform an option's value. Use this for infallible transformations.\nFor transformations that can fail, use [`validateMap`](#validateMap) instead\nso the user gets a helpful error message.\n\n    Option.requiredKeywordArg \"name\"\n        |> Option.map String.toUpper\n\n    Option.requiredKeywordArg \"output\"\n        |> Option.map (\\path -> path ++ \"/index.html\")\n\n","type":"(toRaw -> toMapped) -> Cli.Option.Option from toRaw builderState -> Cli.Option.Option from toMapped builderState"},{"name":"mapFlag","comment":" Useful for using a custom union type for a flag instead of a `Bool`.\n\n    import Cli.Option as Option\n    import Cli.OptionsParser as OptionsParser\n    import Cli.Program as Program\n\n    type Verbosity\n        = Quiet\n        | Verbose\n\n    type alias CliOptions =\n        { verbosity : Verbosity\n        }\n\n    programConfig : Program.Config CliOptions\n    programConfig =\n        Program.config\n            |> Program.add\n                (OptionsParser.build CliOptions\n                    |> OptionsParser.with\n                        (Option.flag \"verbose\"\n                            |> Option.mapFlag\n                                { present = Verbose\n                                , absent = Quiet\n                                }\n                        )\n                )\n\n","type":"{ present : union, absent : union } -> Cli.Option.Option from Basics.Bool builderState -> Cli.Option.Option from union builderState"},{"name":"oneOf","comment":" Mutually exclusive option values.\n\n    type ReportFormat\n        = Json\n        | Junit\n        | Console\n\n    type alias CliOptions =\n        { reportFormat : ReportFormat\n        , testFiles : List String\n        }\n\n    program : Program.Config CliOptions\n    program =\n        Program.config\n            |> Program.add\n                (OptionsParser.build CliOptions\n                    |> with\n                        (Option.optionalKeywordArg \"report\"\n                            |> Option.withDefault \"console\"\n                            |> Option.oneOf\n                                [ \"json\" => Json\n                                , \"junit\" => Junit\n                                , \"console\" => Console\n                                ]\n                        )\n                    |> OptionsParser.withRestArgs (Option.restArgs \"TESTFILES\")\n                )\n\nNow when you run it, you get the following in your help text:\n\n```shell\n$ ./elm-test --help\nelm-test [--report <json|junit|console>] <TESTFILES>...\n```\n\nAnd if you run it with an unrecognized value, you get a validation error:\n\n```shell\n$ ./elm-test --report xml\nValidation errors:\n\n`report` failed a validation. Must be one of [json, junit, console]\nValue was:\n\"xml\"\n```\n\n","type":"List.List ( String.String, value ) -> Cli.Option.Option from String.String builderState -> Cli.Option.Option from value builderState"},{"name":"optionalKeywordArg","comment":" A keyword argument that may be omitted.\n\nExample: `--output main.js` or `--output=main.js`\nParses to: `Just \"main.js\"` (or `Nothing` if omitted)\n\n    Option.optionalKeywordArg \"output\"\n\n","type":"String.String -> Cli.Option.Option (Maybe.Maybe String.String) (Maybe.Maybe String.String) { position : Cli.Option.BeginningOption }"},{"name":"optionalPositionalArg","comment":" An optional positional argument.\n\nMust be used with [`OptionsParser.withOptionalPositionalArg`](Cli-OptionsParser#withOptionalPositionalArg)\n(not `OptionsParser.with`).\n\nExample: `<revision>` in `git log [<revision>]`\nParses to: `Just \"abc123\"` (or `Nothing` if omitted)\n\n    Option.optionalPositionalArg \"revision\"\n\n","type":"String.String -> Cli.Option.Option (Maybe.Maybe String.String) (Maybe.Maybe String.String) { position : Cli.Option.OptionalPositionalArgOption }"},{"name":"requiredKeywordArg","comment":" A keyword argument that must be provided.\n\nExample: `--name my-app` or `--name=my-app`\nParses to: `\"my-app\"`\n\n    Option.requiredKeywordArg \"name\"\n\n","type":"String.String -> Cli.Option.Option String.String String.String { position : Cli.Option.BeginningOption, canAddMissingMessage : () }"},{"name":"requiredPositionalArg","comment":" A positional argument that must be provided.\n\nExample: `src/Main.elm` in `elm make src/Main.elm`\nParses to: `\"src/Main.elm\"`\n\n    Option.requiredPositionalArg \"input\"\n\n","type":"String.String -> Cli.Option.Option String.String String.String { position : Cli.Option.BeginningOption, canAddMissingMessage : () }"},{"name":"restArgs","comment":" Collect all remaining positional arguments as a list.\n\nMust be used with [`OptionsParser.withRestArgs`](Cli-OptionsParser#withRestArgs)\n(not `OptionsParser.with`), and must be the last option in the pipeline.\n\nExample: `<files>...` in `elm-test [<files>...]`\nParses to: `[\"tests/First.elm\", \"tests/Second.elm\"]` (or `[]` if none provided)\n\n    Option.restArgs \"files\"\n\n","type":"String.String -> Cli.Option.Option (List.List String.String) (List.List String.String) { position : Cli.Option.RestArgsOption }"},{"name":"validate","comment":" Run a validation. (See an example in the Validation section above, or\nin the [`examples`](https://github.com/dillonkearns/elm-cli-options-parser/tree/master/examples/src) folder).\n","type":"(to -> Cli.Validate.ValidationResult) -> Cli.Option.Option from to builderState -> Cli.Option.Option from to builderState"},{"name":"validateIfPresent","comment":" Run a validation if the value is `Just someValue`. Or do nothing if the value is `Nothing`.\n(See an example in the Validation section above, or in the [`examples`](https://github.com/dillonkearns/elm-cli-options-parser/tree/master/examples/src) folder).\n","type":"(to -> Cli.Validate.ValidationResult) -> Cli.Option.Option from (Maybe.Maybe to) builderState -> Cli.Option.Option from (Maybe.Maybe to) builderState"},{"name":"validateMap","comment":" Transform the value through a map function. If it returns `Ok someValue` then\nthe `Option` will be transformed into `someValue`. If it returns `Err someError`\nthen the User of the Command-Line Interface will see `someError` with details\nabout the `Option` that had the validation error.\n\n(See an example in the Validation section above, or\nin the [`examples`](https://github.com/dillonkearns/elm-cli-options-parser/tree/master/examples/src) folder).\n\n","type":"(to -> Result.Result String.String toMapped) -> Cli.Option.Option from to builderState -> Cli.Option.Option from toMapped builderState"},{"name":"validateMapIfPresent","comment":" Same as `validateMap` if the value is `Just someValue`. Does nothing if\nthe value is `Nothing`.\n\n(See an example in the Validation section above, or\nin the [`examples`](https://github.com/dillonkearns/elm-cli-options-parser/tree/master/examples/src) folder).\n\n","type":"(to -> Result.Result String.String toMapped) -> Cli.Option.Option (Maybe.Maybe from) (Maybe.Maybe to) builderState -> Cli.Option.Option (Maybe.Maybe from) (Maybe.Maybe toMapped) builderState"},{"name":"withDefault","comment":" Provide a default value for an optional `Option`. Turns a `Maybe value`\ninto a plain `value`.\n\n    Option.optionalKeywordArg \"greeting\"\n        |> Option.withDefault \"Hello\"\n\nIf `--greeting` is omitted, the option's value will be `\"Hello\"` instead of `Nothing`.\n\n","type":"to -> Cli.Option.Option from (Maybe.Maybe to) builderState -> Cli.Option.Option from to builderState"},{"name":"withDescription","comment":" Add a description to an option. This will be shown in help text.\n\n    Option.requiredKeywordArg \"name\"\n        |> Option.withDescription \"Your name for the greeting\"\n\n","type":"String.String -> Cli.Option.Option from to builderState -> Cli.Option.Option from to builderState"},{"name":"withDisplayName","comment":" Set a custom display name (metavar) for a keyword argument's value placeholder\nin help text and usage synopsis.\n\nBy default, the keyword arg name is uppercased (e.g., `--output-dir <OUTPUT_DIR>`).\nUse this to provide a more descriptive placeholder.\n\n    Option.requiredKeywordArg \"output-dir\"\n        |> Option.withDisplayName \"PATH\"\n    -- Shows as: --output-dir <PATH>\n\n","type":"String.String -> Cli.Option.Option from to builderState -> Cli.Option.Option from to builderState"},{"name":"withMissingMessage","comment":" Add a custom error message for when a required option is missing.\n\nThis only works on required options (requiredPositionalArg, requiredKeywordArg).\n\n    Option.requiredPositionalArg \"repository\"\n        |> Option.withMissingMessage \"You must specify a repository to clone.\"\n\n","type":"String.String -> Cli.Option.Option from to { c | canAddMissingMessage : () } -> Cli.Option.Option from to { c | canAddMissingMessage : () }"}],"binops":[]},{"name":"Cli.Option.Typed","comment":" Build a command-line options parser to validate and map a CLI command into a structured Elm type.\n\nThis is an alternative to [`Cli.Option`](Cli-Option) that is designed to\ngenerate a JSON schema describing the valid ways to invoke the CLI command, but with more precise type information.\n`Cli.Option` still generates a JSON schema, but [`Cli.Option.Typed.customDecoder`](#customDecoder) lets you pass in an\n[`elm-ts-json` `Decoder`](https://package.elm-lang.org/packages/dillonkearns/elm-ts-json/latest/TsJson-Decode)\nwith arbitrary and fully typed JSON values, and the primitive `Option`s\nlike [`int`](#int) carry more precise type information instead of just `String`\nin the JSON Schema output.\n\nThe vast majority of users will use `elm-cli-options-parser` through [`elm-pages`](https://elm-pages.com/)\nwhen they build [`elm-pages` scripts](https://elm-pages.com/docs/elm-pages-scripts).\nWhen you define an `elm-pages` script using [`Script.withSchema`](https://package.elm-lang.org/packages/dillonkearns/elm-pages/latest/Pages-Script#withCliOptions),\nyou pass in an [`elm-ts-json` `Encoder`](https://package.elm-lang.org/packages/dillonkearns/elm-ts-json/latest/TsJson-Encode)\nand return a matching Elm type that the script will output as JSON,\nand `elm-pages introspect` will automatically show all of the type information for your\nCLI options and the output JSON as part of the introspection output.\n\n\n## When to Use `Cli.Option.Typed`\n\nAll CLIs built with `elm-cli-options-parser` can be invoked either with traditional CLI arguments, or\nwith a single JSON string CLI argument, allowing for easier consumption by\nLLM agents and programmatic invocation of your CLI. That, along with\nthe precise type information in the JSON Schema describing your CLI options, makes `Cli.Option.Typed`\na good choice for CLIs when they may be invoked programmatically or by LLM agents.\n\nYou can use [`Cli.Option`](Cli-Option) for a slightly simpler API that\ntreats all values as strings if automated tool access isn't a priority for your CLI.\n\nBoth modules produce the same `Option` type and work with the same\n[`OptionsParser.with`](Cli-OptionsParser#with) pipeline, so they can be interwoven freely.\n\n\n## Terminology\n\nHere is the terminology used for building up Command-Line parsers with this library.\n\n![Terminology Legend](https://raw.githubusercontent.com/dillonkearns/elm-cli-options-parser/master/terminology.png)\n\nSee the [`examples`](https://github.com/dillonkearns/elm-cli-options-parser/tree/master/examples/src)\nfolder for end-to-end examples (including `TypedGreet.elm` which uses this module).\n\n\n## Example\n\n    import Cli.Option.Typed as Option\n    import Cli.OptionsParser as OptionsParser exposing (with)\n    import Cli.Program as Program\n\n    type alias Options =\n        { name : String\n        , count : Int\n        , verbose : Bool\n        }\n\n    programConfig : Program.Config Options\n    programConfig =\n        Program.config\n            |> Program.add\n                (OptionsParser.build Options\n                    |> with\n                        (Option.requiredKeywordArg\n                            \"name\"\n                            Option.string\n                        )\n                    |> with\n                        (Option.requiredKeywordArg\n                            \"count\"\n                            Option.int\n                        )\n                    |> with\n                        (Option.flag\n                            \"verbose\"\n                        )\n                )\n\nThis parser handles both CLI and JSON input:\n\n  - **CLI**: `mytool --name hello --count 3 --verbose`\n  - **JSON**: `{ \"name\": \"hello\", \"count\": 3, \"verbose\": true, \"$cli\": {} }`\n\nAnd `Program.toJsonSchema \"mytool\" programConfig` generates a JSON Schema with\nproper types (`\"type\": \"string\"`, `\"type\": \"integer\"`, etc.).\n\n\n## Types\n\n@docs Option, CliDecoder\n\n\n## Decoders\n\n@docs string, int, float, customDecoder\n\n\n## Positional Arguments\n\n@docs requiredPositionalArg\n\n\n## Keyword Arguments\n\n@docs requiredKeywordArg, optionalKeywordArg, keywordArgList\n\n\n## Flags\n\n@docs flag\n\n\n## Ending Options\n\nThese must be added with their corresponding `OptionsParser.with...` function,\nnot the regular `OptionsParser.with`. See the [`Cli.OptionsParser.BuilderState`](Cli-OptionsParser-BuilderState)\ndocs for why.\n\n@docs optionalPositionalArg, restArgs\n\n\n## Mutually Exclusive Values\n\n@docs oneOf\n\n\n## Validation\n\nValidations allow you to guarantee that if you receive the data in Elm, it\nmeets a set of preconditions. If it doesn't, the user will see an error message\ndescribing the validation error, which option it came from, and the value the\noption had.\n\nNote that failing a validation will not cause the next `OptionsParser` in\nyour `Cli.Program.Config` to be run. Instead,\nif the OptionsParser is a match except for validation errors, you will get an\nerror message regardless.\n\nExample:\n\n\n    capitalizedNameRegex : String\n    capitalizedNameRegex =\n        \"[A-Z][A-Za-z]*\"\n\n    validateParser : OptionsParser.OptionsParser ( String, Maybe Int ) BuilderState.NoMoreOptions\n    validateParser =\n        OptionsParser.build (\\a b -> ( a, b ))\n            |> OptionsParser.with\n                (Option.requiredKeywordArg \"name\" Option.string\n                    |> Option.validate (Cli.Validate.regex capitalizedNameRegex)\n                )\n            |> OptionsParser.with\n                (Option.optionalKeywordArg \"age\" Option.int)\n\n    {-\n       $ ./validation --name Mozart --age 262\n       Mozart is 262 years old\n\n       $ ./validation --name mozart\n       Validation errors:\n\n       `name` failed a validation. Must be of form /[A-Z][A-Za-z]*/\n       Value was:\n       \"mozart\"\n    -}\n\nSee [`Cli.Validate`](Cli-Validate) for some validation helpers that can be used\nin conjunction with the following functions.\n\n@docs validate, validateIfPresent, validateMap, validateMapIfPresent\n\n\n## Mapping and Defaults\n\n@docs map, mapFlag, withDefault\n\n\n## Builder Position Types\n\n@docs BeginningOption, OptionalPositionalArgOption, RestArgsOption\n\n\n## Metadata\n\n@docs withDescription, withDisplayName, withMissingMessage\n\n","unions":[{"name":"CliDecoder","comment":" A decoder that knows how to parse values from both CLI args and JSON input.\n\nUse `string`, `int`, `float` for primitives, or `customDecoder` for\ncustom types (objects, arrays, etc.) where the CLI input is a JSON string.\n\n","args":["value"],"cases":[]}],"aliases":[{"name":"BeginningOption","comment":" Phantom type marker for options that can be used with\n[`OptionsParser.with`](Cli-OptionsParser#with). Most option constructors\nproduce this type.\n","args":[],"type":"Cli.Option.BeginningOption"},{"name":"Option","comment":" The type for an option in the pipeline. Use with\n[`OptionsParser.with`](Cli-OptionsParser#with).\n","args":["from","to","builderState"],"type":"Cli.Option.Internal.Option from to builderState"},{"name":"OptionalPositionalArgOption","comment":" Phantom type marker for optional positional args. Must be used with\n[`OptionsParser.withOptionalPositionalArg`](Cli-OptionsParser#withOptionalPositionalArg).\n","args":[],"type":"Cli.Option.OptionalPositionalArgOption"},{"name":"RestArgsOption","comment":" Phantom type marker for rest args. Must be used with\n[`OptionsParser.withRestArgs`](Cli-OptionsParser#withRestArgs).\n","args":[],"type":"Cli.Option.RestArgsOption"}],"values":[{"name":"customDecoder","comment":" Create a `CliDecoder` from a [`TsDecode.Decoder`](https://package.elm-lang.org/packages/dillonkearns/elm-ts-json/latest/TsJson-Decode).\nIn CLI mode, the string value is parsed as a JSON value. This means the CLI user must pass valid JSON.\n\nFor strings, this means the CLI value must be quoted: `--name '\"hello\"'`.\nIf you want bare string values, use [`string`](#string) instead.\n\n`customDecoder` is especially useful for decoding complex structured values like JSON objects or arrays.\n\n    import TsJson.Decode as TsDecode\n\n    pointDecoder : TsDecode.Decoder { x : Int, y : Int }\n    pointDecoder =\n        TsDecode.succeed (\\x y -> { x = x, y = y })\n            |> TsDecode.andMap (TsDecode.field \"x\" TsDecode.int)\n            |> TsDecode.andMap (TsDecode.field \"y\" TsDecode.int)\n\n    pointOption : Option String { x : Int, y : Int } { position : BeginningOption, canAddMissingMessage : () }\n    pointOption =\n        Option.requiredKeywordArg \"point\" (Option.customDecoder pointDecoder)\n\n    -- CLI: --point '{\"x\":1,\"y\":2}'\n    -- JSON: {\"point\": {\"x\": 1, \"y\": 2}}\n\n","type":"TsJson.Decode.Decoder value -> Cli.Option.Typed.CliDecoder value"},{"name":"flag","comment":" A flag with no argument. Always `Bool` — no decoder needed.\n\nExample: `--debug` in `elm make --debug`\n\n    Option.flag \"verbose\"\n    -- CLI: --verbose → True, omitted → False\n    -- JSON: {\"verbose\": true} → True, absent → False\n\n","type":"String.String -> Cli.Option.Typed.Option Basics.Bool Basics.Bool { position : Cli.Option.Typed.BeginningOption }"},{"name":"float","comment":" A float value. In CLI mode, the string is parsed as a JSON number.\nIn JSON mode, a JSON number field is decoded.\n\n    Option.requiredKeywordArg \"rate\" Option.float\n    -- CLI: --rate 3.14 → 3.14\n    -- JSON: {\"rate\": 3.14} → 3.14\n\n","type":"Cli.Option.Typed.CliDecoder Basics.Float"},{"name":"int","comment":" An integer value. In CLI mode, the string is parsed as a JSON integer.\nIn JSON mode, a JSON integer field is decoded.\n\n    Option.requiredKeywordArg \"count\" Option.int\n    -- CLI: --count 42 → 42\n    -- JSON: {\"count\": 42} → 42\n\n","type":"Cli.Option.Typed.CliDecoder Basics.Int"},{"name":"keywordArgList","comment":" A keyword argument that can be provided multiple times.\n\nExample: `--header \"Auth: token\" --header \"Accept: json\"`\n\n    Option.keywordArgList \"header\" Option.string\n    -- CLI: --header \"X-A: 1\" --header \"X-B: 2\" → [\"X-A: 1\", \"X-B: 2\"]\n\n","type":"String.String -> Cli.Option.Typed.CliDecoder value -> Cli.Option.Typed.Option (List.List String.String) (List.List value) { position : Cli.Option.Typed.BeginningOption }"},{"name":"map","comment":" Transform an option's value. Use this for infallible transformations.\nFor transformations that can fail, use [`validateMap`](#validateMap) instead\nso the user gets a helpful error message.\n\n    Option.requiredKeywordArg \"name\" Option.string\n        |> Option.map String.toUpper\n\n    Option.requiredKeywordArg \"output\" Option.string\n        |> Option.map (\\path -> path ++ \"/index.html\")\n\n","type":"(toRaw -> toMapped) -> Cli.Option.Typed.Option from toRaw builderState -> Cli.Option.Typed.Option from toMapped builderState"},{"name":"mapFlag","comment":" Transform a flag's `Bool` into a custom type.\n\n    type Verbosity\n        = Quiet\n        | Verbose\n\n    verbosityOption : Option Bool Verbosity { position : BeginningOption }\n    verbosityOption =\n        Option.flag \"verbose\"\n            |> Option.mapFlag { present = Verbose, absent = Quiet }\n\n","type":"{ present : union, absent : union } -> Cli.Option.Typed.Option from Basics.Bool builderState -> Cli.Option.Typed.Option from union builderState"},{"name":"oneOf","comment":" Mutually exclusive option values. Restricts the option to a fixed set of\nstring values, each mapped to an Elm value.\n\n    type ReportFormat\n        = Json\n        | Junit\n        | Console\n\n    reportOption : Option String ReportFormat { position : BeginningOption, canAddMissingMessage : () }\n    reportOption =\n        Option.requiredKeywordArg \"report\" Option.string\n            |> Option.oneOf\n                [ ( \"json\", Json )\n                , ( \"junit\", Junit )\n                , ( \"console\", Console )\n                ]\n\nThe help text will show the allowed values:\n\n```shell\n$ ./elm-test --help\nelm-test [--report <json|junit|console>] <TESTFILES>...\n```\n\nAnd if you run it with an unrecognized value, you get a validation error:\n\n```shell\n$ ./elm-test --report xml\nValidation errors:\n\n`report` failed a validation. Must be one of [json, junit, console]\nValue was:\n\"xml\"\n```\n\nThe JSON schema will include an `enum` constraint with the allowed values.\n\n","type":"List.List ( String.String, value ) -> Cli.Option.Typed.Option from String.String builderState -> Cli.Option.Typed.Option from value builderState"},{"name":"optionalKeywordArg","comment":" A keyword argument that may be omitted.\n\nExample: `--output main.js` or `--output=main.js`\n\n    Option.optionalKeywordArg \"greeting\" Option.string\n    -- CLI: --greeting hi → Just \"hi\", omitted → Nothing\n    -- JSON: {\"greeting\": \"hi\"} → Just \"hi\", absent → Nothing\n\n","type":"String.String -> Cli.Option.Typed.CliDecoder value -> Cli.Option.Typed.Option (Maybe.Maybe String.String) (Maybe.Maybe value) { position : Cli.Option.Typed.BeginningOption }"},{"name":"optionalPositionalArg","comment":" An optional positional argument.\n\nMust be used with [`OptionsParser.withOptionalPositionalArg`](Cli-OptionsParser#withOptionalPositionalArg)\n(not `OptionsParser.with`).\n\nExample: `<revision>` in `git log [<revision>]`\nParses to: `Just \"abc123\"` (or `Nothing` if omitted)\n\n    Option.optionalPositionalArg \"revision\" Option.string\n\n","type":"String.String -> Cli.Option.Typed.CliDecoder value -> Cli.Option.Typed.Option (Maybe.Maybe String.String) (Maybe.Maybe value) { position : Cli.Option.Typed.OptionalPositionalArgOption }"},{"name":"requiredKeywordArg","comment":" A keyword argument that must be provided.\n\nExample: `--name my-app` or `--name=my-app`\n\n    Option.requiredKeywordArg \"count\" Option.int\n    -- CLI: --count 42 → 42\n    -- JSON: {\"count\": 42} → 42\n    -- Schema: {\"type\": \"integer\"}\n\n","type":"String.String -> Cli.Option.Typed.CliDecoder value -> Cli.Option.Typed.Option String.String value { position : Cli.Option.Typed.BeginningOption, canAddMissingMessage : () }"},{"name":"requiredPositionalArg","comment":" A positional argument that must be provided.\n\nExample: `src/Main.elm` in `elm make src/Main.elm`\n\n    Option.requiredPositionalArg \"port\" Option.int\n    -- CLI: mytool 8080 → 8080\n    -- JSON: {\"port\": 8080} → 8080\n\n","type":"String.String -> Cli.Option.Typed.CliDecoder value -> Cli.Option.Typed.Option String.String value { position : Cli.Option.Typed.BeginningOption, canAddMissingMessage : () }"},{"name":"restArgs","comment":" Collect all remaining positional arguments as a list.\n\nMust be used with [`OptionsParser.withRestArgs`](Cli-OptionsParser#withRestArgs)\n(not `OptionsParser.with`), and must be the last option in the pipeline.\n\nExample: `<files>...` in `elm-test [<files>...]`\nParses to: `[\"tests/First.elm\", \"tests/Second.elm\"]` (or `[]` if none provided)\n\n    Option.restArgs \"files\"\n    -- CLI: mytool a.txt b.txt → [\"a.txt\", \"b.txt\"]\n\n","type":"String.String -> Cli.Option.Typed.Option (List.List String.String) (List.List String.String) { position : Cli.Option.Typed.RestArgsOption }"},{"name":"string","comment":" A string value. In CLI mode, the raw string is passed through as-is.\nIn JSON mode, a JSON string field is decoded.\n\n    Option.requiredKeywordArg \"name\" Option.string\n    -- CLI: --name hello → \"hello\"\n    -- JSON: {\"name\": \"hello\"} → \"hello\"\n\n","type":"Cli.Option.Typed.CliDecoder String.String"},{"name":"validate","comment":" Run a validation on the parsed value. If validation fails, the user sees\nthe error message.\n\n    Option.requiredKeywordArg \"name\" Option.string\n        |> Option.validate\n            (Cli.Validate.regex \"^[A-Z][A-Za-z]*\")\n\n","type":"(to -> Cli.Validate.ValidationResult) -> Cli.Option.Typed.Option from to builderState -> Cli.Option.Typed.Option from to builderState"},{"name":"validateIfPresent","comment":" Like [`validate`](#validate), but only runs when the value is `Just`.\nDoes nothing for `Nothing`.\n","type":"(to -> Cli.Validate.ValidationResult) -> Cli.Option.Typed.Option from (Maybe.Maybe to) builderState -> Cli.Option.Typed.Option from (Maybe.Maybe to) builderState"},{"name":"validateMap","comment":" Transform the option value, or fail with a validation error.\n\nIf the function returns `Err`, the error message is shown to the user.\n\n    Option.requiredKeywordArg \"count\" Option.string\n        |> Option.validateMap String.toInt\n\n","type":"(to -> Result.Result String.String toMapped) -> Cli.Option.Typed.Option from to builderState -> Cli.Option.Typed.Option from toMapped builderState"},{"name":"validateMapIfPresent","comment":" Like [`validateMap`](#validateMap), but only runs when the value is `Just`.\nDoes nothing for `Nothing`.\n\n    Option.optionalKeywordArg \"count\" Option.string\n        |> Option.validateMapIfPresent String.toInt\n\n","type":"(to -> Result.Result String.String toMapped) -> Cli.Option.Typed.Option (Maybe.Maybe from) (Maybe.Maybe to) builderState -> Cli.Option.Typed.Option (Maybe.Maybe from) (Maybe.Maybe toMapped) builderState"},{"name":"withDefault","comment":" Provide a default value for an optional option. Turns a `Maybe value`\ninto a plain `value`.\n\n    Option.optionalKeywordArg \"greeting\" Option.string\n        |> Option.withDefault \"Hello\"\n\n","type":"to -> Cli.Option.Typed.Option from (Maybe.Maybe to) builderState -> Cli.Option.Typed.Option from to builderState"},{"name":"withDescription","comment":" Add a description shown in help text and JSON schema.\n\n    Option.requiredKeywordArg \"name\" Option.string\n        |> Option.withDescription \"Your name for the greeting\"\n\n","type":"String.String -> Cli.Option.Typed.Option from to builderState -> Cli.Option.Typed.Option from to builderState"},{"name":"withDisplayName","comment":" Set a custom display name (metavar) for a keyword argument's value placeholder\nin help text and usage synopsis.\n\nBy default, the keyword arg name is uppercased (e.g., `--output-dir <OUTPUT_DIR>`).\nUse this to provide a more descriptive placeholder.\n\n    Option.requiredKeywordArg \"output-dir\" Option.string\n        |> Option.withDisplayName \"PATH\"\n    -- Shows as: --output-dir <PATH>\n\n","type":"String.String -> Cli.Option.Typed.Option from to builderState -> Cli.Option.Typed.Option from to builderState"},{"name":"withMissingMessage","comment":" Add a custom error message for when a required option is missing.\n\nThis only works on required options (`requiredPositionalArg`, `requiredKeywordArg`).\n\n    Option.requiredKeywordArg \"repository\" Option.string\n        |> Option.withMissingMessage \"You must specify a repository to clone.\"\n\n","type":"String.String -> Cli.Option.Typed.Option from to { c | canAddMissingMessage : () } -> Cli.Option.Typed.Option from to { c | canAddMissingMessage : () }"}],"binops":[]},{"name":"Cli.OptionsParser","comment":"\n\n\n## Types\n\n@docs OptionsParser\n\n\n## Start the Pipeline\n\nYou build up an `OptionsParser` similarly to the way you build a decoder using the\n[elm-decode-pipeline](http://package.elm-lang.org/packages/NoRedInk/elm-decode-pipeline/latest)\npattern. That is, you start the pipeline by giving it a constructor function,\nand then for each argument of your constructor function, you have a corresponding\n\n    |> with (Option.someKindOfOption)\n\nin the exact same order.\n\nFor example, if we define a type alias for a record with two attributes,\nElm generates a 2-argument constructor function for that record type. Here\nElm gives us a `GreetOptions` function of the type `String -> Maybe String -> GreetOptions`\n(this is just a core Elm language feature). That is, if we pass in a `String` and\na `Maybe String` as the 1st and 2nd arguments to the `GreetOptions` function,\nit will build up a record of that type.\n\nSo in this example, we call `OptionsParser.build` with our `GreetOptions`\nconstructor function. Then we chain on `with` once for each of those two arguments.\nNote that the first `with` will give us a `String`, and the second will give us\na `Maybe String`, so it matches up perfectly with the order of our constructor's\narguments.\n\n    import Cli.Option as Option\n    import Cli.OptionsParser as OptionsParser exposing (with)\n    import Cli.Program as Program\n\n    type alias GreetOptions =\n        { name : String\n        , maybeGreeting : Maybe String\n        }\n\n    programConfig : Program.Config GreetOptions\n    programConfig =\n        Program.config\n            |> Program.add\n                (OptionsParser.build GreetOptions\n                    |> with (Option.requiredKeywordArg \"name\")\n                    |> with (Option.optionalKeywordArg \"greeting\")\n                )\n\n@docs build, buildSubCommand\n\n\n## Adding `Cli.Option.Option`s To The Pipeline\n\nMost options can be chained on using `with`. There are two exceptions,\n`restArgs` and `optionalPositionalArg`s. `elm-cli-options-parser` enforces that\nthey are added in an unambiguous order (see the `Cli.OptionsParser.BuilderState` docs).\nSo instead of using `with`, you add them with their corresponding `with...`\nfunctions.\n\n    import Cli.Option\n    import Cli.OptionsParser as OptionsParser exposing (with)\n\n    type GitOptionsParser\n        = Init\n        | Log LogOptions -- ...\n\n    type alias LogOptions =\n        { maybeAuthorPattern : Maybe String\n        , maybeNumberToDisplay : Maybe Int\n        }\n\n    logOptionsParser =\n        OptionsParser.buildSubCommand \"log\" LogOptions\n            |> with (Option.optionalKeywordArg \"author\")\n            |> with\n                (Option.optionalKeywordArg \"max-count\"\n                    |> Option.validateMapIfPresent String.toInt\n                )\n            |> with (Option.flag \"stat\")\n            |> OptionsParser.withOptionalPositionalArg\n                (Option.optionalPositionalArg \"revision range\")\n            |> OptionsParser.withRestArgs\n                (Option.restArgs \"rest args\")\n\n\n### User Error Message on Invalid Number of Positional Args\n\nThe User of the Command-Line Interface will get an error message if there is no\n`OptionsParser` that succeeds. And an `OptionsParser` will only succeed if\na valid number of positional arguments is passed in, as defined by these rules:\n\n  - At least the number of required arguments\n  - Can be any number greater than that if there are `restArgs`\n  - Could be up to as many as (the number of required arguments) + (the number of optional arguments) if there are no rest args\n\n@docs with\n@docs withOptionalPositionalArg, withRestArgs\n\n@docs expectFlag\n\n\n## Mapping and Transforming\n\n@docs map\n@docs hardcoded\n\n\n## Meta-Data\n\n@docs withDescription\n\n\n## Finalizing\n\n@docs end\n\n\n## Internal\n\nThese functions are exposed for internal use and testing. They are not part of the public API.\n\n@docs getSubCommand, getUsageSpecs, tryMatch, synopsis, detailedHelp\n\n","unions":[],"aliases":[{"name":"OptionsParser","comment":" An `OptionsParser` represents one possible way to interpret command line arguments.\nA `Cli.Program.Config` can be built up using one or more `OptionsParser`s. It will\ntry each parser in order until one succeeds. If none succeed, it will print\nan error message with information for the user of the Command-Line Interface.\n","args":["cliOptions","builderState"],"type":"Internal.OptionsParser.OptionsParser cliOptions builderState"}],"values":[{"name":"build","comment":" Start an `OptionsParser` pipeline with no sub-command (see\n[the OptionsParser terminology legend](https://github.com/dillonkearns/elm-cli-options-parser#options-parser-terminology)).\n","type":"cliOptions -> Cli.OptionsParser.OptionsParser cliOptions Cli.OptionsParser.BuilderState.AnyOptions"},{"name":"buildSubCommand","comment":" Start an `OptionsParser` pipeline with a sub-command (see\n[the OptionsParser terminology legend](https://github.com/dillonkearns/elm-cli-options-parser#options-parser-terminology)).\n","type":"String.String -> cliOptions -> Cli.OptionsParser.OptionsParser cliOptions Cli.OptionsParser.BuilderState.AnyOptions"},{"name":"detailedHelp","comment":" Low-level function, for internal use.\nGenerate detailed help text with Usage line and Options section.\n","type":"Basics.Bool -> String.String -> Cli.OptionsParser.OptionsParser decodesTo builderState -> String.String"},{"name":"end","comment":" Low-level function, for internal use.\n","type":"Cli.OptionsParser.OptionsParser cliOptions builderState -> Cli.OptionsParser.OptionsParser cliOptions Cli.OptionsParser.BuilderState.NoMoreOptions"},{"name":"expectFlag","comment":" The `OptionsParser` will only match if the given flag is present. Often its\nbest to use a subcommand in these cases.\n","type":"String.String -> Cli.OptionsParser.OptionsParser cliOptions Cli.OptionsParser.BuilderState.AnyOptions -> Cli.OptionsParser.OptionsParser cliOptions Cli.OptionsParser.BuilderState.AnyOptions"},{"name":"getSubCommand","comment":" Low-level function, for internal use.\n","type":"Cli.OptionsParser.OptionsParser cliOptions builderState -> Maybe.Maybe String.String"},{"name":"getUsageSpecs","comment":" Low-level function, for internal use.\n","type":"Cli.OptionsParser.OptionsParser decodesTo builderState -> List.List Cli.UsageSpec.UsageSpec"},{"name":"hardcoded","comment":" Use a fixed value for the next step in the pipeline. This doesn't use\nany input from the user, it just passes the supplied value through in the chain.\n\n    import Cli.Option as Option\n    import Cli.OptionsParser as OptionsParser\n    import Cli.Program as Program\n\n    type alias GreetOptions =\n        { name : String\n        , maybeGreeting : Maybe String\n        , hardcodedValue : String\n        }\n\n    programConfig : Program.Config GreetOptions\n    programConfig =\n        Program.config\n            |> Program.add\n                (OptionsParser.build GreetOptions\n                    |> OptionsParser.with (Option.requiredKeywordArg \"name\")\n                    |> OptionsParser.with (Option.optionalKeywordArg \"greeting\")\n                    |> OptionsParser.hardcoded \"any hardcoded value\"\n                )\n\n","type":"value -> Cli.OptionsParser.OptionsParser (value -> cliOptions) Cli.OptionsParser.BuilderState.AnyOptions -> Cli.OptionsParser.OptionsParser cliOptions Cli.OptionsParser.BuilderState.AnyOptions"},{"name":"map","comment":" Map the CLI options returned in the `OptionsParser` using the supplied map function.\n\nThis is very handy when you want a type alias for a record with options for a\na given `OptionsParser`, but you need all of your `OptionsParser` to map into\na single union type.\n\n    import Cli.Option as Option\n    import Cli.OptionsParser as OptionsParser\n    import Cli.Program as Program\n    import Ports\n\n    type CliOptions\n        = Hello HelloOptions\n        | Goodbye GoodbyeOptions\n\n    type alias HelloOptions =\n        { name : String\n        , maybeHello : Maybe String\n        }\n\n    type alias GoodbyeOptions =\n        { name : String\n        , maybeGoodbye : Maybe String\n        }\n\n    programConfig : Program.Config CliOptions\n    programConfig =\n        Program.config\n            |> Program.add\n                (OptionsParser.buildSubCommand \"hello\" HelloOptions\n                    |> OptionsParser.with (Option.requiredKeywordArg \"name\")\n                    |> OptionsParser.with (Option.optionalKeywordArg \"greeting\")\n                    |> OptionsParser.map Hello\n                )\n            |> Program.add\n                (OptionsParser.buildSubCommand \"goodbye\" GoodbyeOptions\n                    |> OptionsParser.with (Option.requiredKeywordArg \"name\")\n                    |> OptionsParser.with (Option.optionalKeywordArg \"goodbye\")\n                    |> OptionsParser.map Goodbye\n                )\n\n","type":"(cliOptions -> mappedCliOptions) -> Cli.OptionsParser.OptionsParser cliOptions builderState -> Cli.OptionsParser.OptionsParser mappedCliOptions builderState"},{"name":"synopsis","comment":" Low-level function, for internal use.\n","type":"Basics.Bool -> String.String -> Cli.OptionsParser.OptionsParser decodesTo builderState -> String.String"},{"name":"tryMatch","comment":" Low-level function, for internal use.\n","type":"List.List String.String -> Cli.OptionsParser.OptionsParser cliOptions builderState -> Cli.OptionsParser.MatchResult.MatchResult cliOptions"},{"name":"with","comment":" For chaining on any `Cli.Option.Option` besides a `restArg` or an `optionalPositionalArg`.\nSee the `Cli.Option` module.\n","type":"Cli.Option.Option from to { c | position : Cli.Option.BeginningOption } -> Cli.OptionsParser.OptionsParser (to -> cliOptions) Cli.OptionsParser.BuilderState.AnyOptions -> Cli.OptionsParser.OptionsParser cliOptions Cli.OptionsParser.BuilderState.AnyOptions"},{"name":"withDescription","comment":" Add a description to an `OptionsParser`. This description appears in help output\nand error messages.\n\n    import Cli.OptionsParser as OptionsParser exposing (OptionsParser, with)\n\n    type GitCommand\n        = Init\n        | Clone String\n\n    gitInitParser : OptionsParser GitCommand\n    gitInitParser =\n        OptionsParser.buildSubCommand \"init\" Init\n            |> OptionsParser.withDescription \"initialize a git repository\"\n\nIn error messages, the description appears after `#` in the usage line:\n\n    git init # initialize a git repository\n\nWhen using subcommand-specific help (`git init --help`), the description\nappears below the usage line.\n\n","type":"String.String -> Cli.OptionsParser.OptionsParser cliOptions anything -> Cli.OptionsParser.OptionsParser cliOptions anything"},{"name":"withOptionalPositionalArg","comment":" For chaining on `Cli.Option.optionalPositionalArg`s.\n","type":"Cli.Option.Option from to { c | position : Cli.Option.OptionalPositionalArgOption } -> Cli.OptionsParser.OptionsParser (to -> cliOptions) Cli.OptionsParser.BuilderState.AnyOptions -> Cli.OptionsParser.OptionsParser cliOptions Cli.OptionsParser.BuilderState.NoBeginningOptions"},{"name":"withRestArgs","comment":" For chaining on `Cli.Option.restArgs`.\n","type":"Cli.Option.Option from to { c | position : Cli.Option.RestArgsOption } -> Cli.OptionsParser.OptionsParser (to -> cliOptions) startingBuilderState -> Cli.OptionsParser.OptionsParser cliOptions Cli.OptionsParser.BuilderState.NoMoreOptions"}],"binops":[]},{"name":"Cli.OptionsParser.BuilderState","comment":" A BuilderState is used to ensure that no ambiguous OptionsParsers are built.\nFor example, if you were to build an OptionsParser that had optional positional\narguments after required positional arguments, it would be ambiguous.\n\n```bash\ngreet <greeting1> [name1][name2] <greeting2> [farewell]\n\ngreet Hi Hello Goodbye\n```\n\nShould `\"Goodbye\"` be set as `[name1]` or `[farewell]`? You could certainly come\nup with some rules, but they're not obvious, and you'd have to think really hard!\nSo we just completely eliminate those confusing corner cases by making it impossible\nto express!\n\nThe `BuilderState` guarantees that nothing will come after rest args (i.e. `[args]...`,\nor 0 or more args that you get as a `List` of values).\nAnd it also guarantees that Optional Positional Arguments will come after everything\nbut rest args.\n\nIf you're interested in the low-level details of how this Elm type trick is done,\ntake a look at\n[this article on Phantom Types](https://medium.com/@ckoster22/advanced-types-in-elm-phantom-types-808044c5946d).\n\n@docs AnyOptions, NoBeginningOptions, NoMoreOptions\n\n","unions":[{"name":"AnyOptions","comment":" A state where you can add any options (beginning, middle, or terminal)\n","args":[],"cases":[]},{"name":"NoBeginningOptions","comment":" A state where you can add anything but beginning options (i.e. middle or terminal)\n","args":[],"cases":[]},{"name":"NoMoreOptions","comment":" A state where you can no longer add any options\n","args":[],"cases":[]}],"aliases":[],"values":[],"binops":[]},{"name":"Cli.Program","comment":"\n\n\n## Building a Config\n\nA `Cli.Program.Config` is created with `Cli.Program.config`. Then `OptionsParser`s are added\nto it with `Cli.Program.add`. Finally, you create a `Cli.Program.StatelessProgram`\nusing `stateless` or a `Cli.Program.StatefulProgram` using `stateful`.\n\n    import Cli.Option as Option\n    import Cli.OptionsParser as OptionsParser\n    import Cli.Program as Program\n    import Ports\n\n    programConfig : Program.Config GreetOptions\n    programConfig =\n        Program.config\n            |> Program.add\n                (OptionsParser.build GreetOptions\n                    |> OptionsParser.with (Option.requiredKeywordArg \"name\")\n                    |> OptionsParser.with (Option.optionalKeywordArg \"greeting\")\n                )\n\n    type alias GreetOptions =\n        { name : String\n        , maybeGreeting : Maybe String\n        }\n\n    init : Flags -> GreetOptions -> Cmd Never\n    init flags { name, maybeGreeting } =\n        maybeGreeting\n            |> Maybe.withDefault \"Hello\"\n            |> (\\greeting -> greeting ++ \" \" ++ name ++ \"!\")\n            |> Ports.print\n\n    type alias Flags =\n        Program.FlagsIncludingArgv {}\n\n    main : Program.StatelessProgram Never\n    main =\n        Program.stateless\n            { printAndExitFailure = Ports.printAndExitFailure\n            , printAndExitSuccess = Ports.printAndExitSuccess\n            , init = init\n            , config = programConfig\n            }\n\nSee the [`examples`](https://github.com/dillonkearns/elm-cli-options-parser/tree/master/examples/src) for some end-to-end examples.\n\n@docs config, Config, add\n\n\n## `Program`s\n\n@docs stateless, ProgramOptions, stateful, StatefulOptions\n@docs StatelessProgram, StatefulProgram\n@docs FlagsIncludingArgv\n@docs mapConfig\n\n\n## Help Text and JSON Schema\n\nGenerate help text for terminal display, or a [JSON Schema](https://json-schema.org/)\nfor use as an [MCP tool](https://modelcontextprotocol.io/specification/draft/server/tools)\n`inputSchema` definition. JSON schemas are generated from the types provided by\n[`Cli.Option.Typed`](Cli-Option-Typed) constructors.\n\n@docs helpText\n@docs toJsonSchema\n\n\n## Low-Level / Testing\n\n@docs run, RunResult, ExitStatus, ColorMode\n\n","unions":[{"name":"ColorMode","comment":" Control whether ANSI color codes are included in output.\n\n  - `WithColor` - Include ANSI color codes for styled terminal output\n  - `WithoutColor` - Plain text output without any ANSI codes\n\nUsed with `run` for testing, and internally by the CLI infrastructure.\n\n","args":[],"cases":[["WithColor",[]],["WithoutColor",[]]]},{"name":"Config","comment":" A `Cli.Program.Config` is used to build up a set of `OptionsParser`s for your\nCommand-Line Interface, as well as its meta-data such as version number.\n","args":["msg"],"cases":[]},{"name":"ExitStatus","comment":" Exit status for CLI programs. `Failure` means exit code 1, `Success` means exit code 0.\n","args":[],"cases":[["Success",[]],["Failure",[]]]},{"name":"RunResult","comment":" The result of running the CLI parser. Useful for testing.\n\n  - `SystemMessage exitStatus message` - A system message (help, version, or error) with exit status\n  - `CustomMatch match` - Successfully matched and parsed the CLI options\n\n","args":["match"],"cases":[["SystemMessage",["Cli.Program.ExitStatus","String.String"]],["CustomMatch",["match"]]]}],"aliases":[{"name":"FlagsIncludingArgv","comment":" Flags in Cli Programs can contain any data as long as it is a record\nat the top-level which contains the required fields.\nIn other words, it must be a record of type `FlagsIncludingArgv`\n(if you aren't familiar with them, you can [read more about extensible records here](https://medium.com/@ckoster22/advanced-types-in-elm-extensible-records-67e9d804030d)).\n\nYou pass in the flags like this (see the [`examples`](https://github.com/dillonkearns/elm-cli-options-parser/tree/master/examples/src) folder for more):\n\n```javascript\n#!/usr/bin/env node\n\nconst useColor = process.stdout.isTTY && !process.env.NO_COLOR;\n\nlet program = require(\"./elm.js\").Elm.Main.init({\n  flags: {\n    argv: process.argv,\n    versionMessage: \"1.2.3\",\n    colorMode: useColor\n  }\n});\n```\n\n","args":["flagsRecord"],"type":"{ flagsRecord | argv : List.List String.String, versionMessage : String.String, colorMode : Basics.Bool }"},{"name":"ProgramOptions","comment":" Configuration for a stateless CLI program. Pass this record to [`stateless`](#stateless).\n\nStateless programs run once and exit - there is no persistent model or update loop.\nYour `init` receives the parsed CLI options and returns a `Cmd` that performs the\nprogram's work, then the program is done.\n\n  - `printAndExitFailure` - Port to print a message and exit with a non-zero status code\n  - `printAndExitSuccess` - Port to print a message and exit with status code 0\n  - `init` - Receives parsed CLI options and returns a `Cmd` to perform the program's work\n  - `config` - The CLI configuration built with [`config`](#config) and [`add`](#add)\n\n","args":["decodesTo","options","flags"],"type":"{ printAndExitFailure : String.String -> Platform.Cmd.Cmd decodesTo, printAndExitSuccess : String.String -> Platform.Cmd.Cmd decodesTo, init : Cli.Program.FlagsIncludingArgv flags -> options -> Platform.Cmd.Cmd decodesTo, config : Cli.Program.Config options }"},{"name":"StatefulOptions","comment":" Configuration for a stateful CLI program. Pass this record to [`stateful`](#stateful).\n\nStateful programs work like standard Elm programs with a model, update loop, and\nsubscriptions. Use this when your CLI needs to wait for responses (e.g., HTTP requests)\nor maintain state across multiple events. The parsed CLI options are passed to both\n`init` and `update`.\n\n  - `printAndExitFailure` - Port to print a message and exit with a non-zero status code\n  - `printAndExitSuccess` - Port to print a message and exit with status code 0\n  - `init` - Initialize your model with the parsed CLI options\n  - `update` - Handle messages and update your model (also receives CLI options)\n  - `subscriptions` - Subscribe to external events\n  - `config` - The CLI configuration built with [`config`](#config) and [`add`](#add)\n\n","args":["msg","model","cliOptions","flags"],"type":"{ printAndExitFailure : String.String -> Platform.Cmd.Cmd msg, printAndExitSuccess : String.String -> Platform.Cmd.Cmd msg, init : Cli.Program.FlagsIncludingArgv flags -> cliOptions -> ( model, Platform.Cmd.Cmd msg ), update : cliOptions -> msg -> model -> ( model, Platform.Cmd.Cmd msg ), subscriptions : cliOptions -> model -> Platform.Sub.Sub msg, config : Cli.Program.Config cliOptions }"},{"name":"StatefulProgram","comment":" A program with a model and update loop. Use with `stateful`.\n","args":["model","msg","cliOptions","flags"],"type":"Platform.Program (Cli.Program.FlagsIncludingArgv flags) (Cli.Program.StatefulProgramModel model cliOptions) msg"},{"name":"StatelessProgram","comment":" A program that processes arguments and exits. Use with `stateless`.\n","args":["msg","flags"],"type":"Platform.Program (Cli.Program.FlagsIncludingArgv flags) () msg"}],"values":[{"name":"add","comment":" Add an `OptionsParser` to your `Cli.Program.Config`.\n","type":"Cli.OptionsParser.OptionsParser msg anything -> Cli.Program.Config msg -> Cli.Program.Config msg"},{"name":"config","comment":" Create a `Config` with no `OptionsParser`s. Use `Cli.Program.add` to add\n`OptionsParser`s.\n","type":"Cli.Program.Config decodesTo"},{"name":"helpText","comment":" Generate plain-text help for a `Config`, suitable for including in machine-readable introspection output.\n\nUses no ANSI color codes. The `programName` argument is used as the prefix in the usage synopsis.\n\n    import Cli.Option as Option\n    import Cli.OptionsParser as OptionsParser\n    import Cli.Program as Program\n\n    Program.config\n        |> Program.add\n            (OptionsParser.build identity\n                |> OptionsParser.with (Option.requiredKeywordArg \"name\")\n                |> OptionsParser.with (Option.flag \"verbose\")\n            )\n        |> Program.helpText \"my-script\"\n    --> \"my-script --name <NAME> [--verbose]\"\n\n","type":"String.String -> Cli.Program.Config msg -> String.String"},{"name":"mapConfig","comment":" Transform the return type for all of the registered `OptionsParser`'s in the `Config`.\n","type":"(a -> b) -> Cli.Program.Config a -> Cli.Program.Config b"},{"name":"run","comment":" Run the CLI parser directly and get back a `RunResult`. This is useful for testing\nyour CLI configuration without needing to set up the full Platform.Program infrastructure.\n\n    import Cli.Program as Program\n\n    -- Test that missing required arg shows error (use WithoutColor for tests)\n    case Program.run myConfig [ \"node\", \"myprog\" ] \"1.0.0\" Program.WithoutColor of\n        Program.SystemMessage Program.Failure message ->\n            -- Assert on the error message\n            String.contains \"Missing\" message\n\n        _ ->\n            False\n\nNote: `argv` should include the node path and script path as the first two elements,\njust like `process.argv` in Node.js.\n\n","type":"Cli.Program.Config msg -> List.List String.String -> String.String -> Cli.Program.ColorMode -> Cli.Program.RunResult msg"},{"name":"stateful","comment":" A `stateful` program can have a model that it creates and updates via `init`\nand `update`. It also has `subscriptions`. See\n[the `Curl.elm` example](https://github.com/dillonkearns/elm-cli-options-parser/blob/master/examples/src/Curl.elm).\n","type":"Cli.Program.StatefulOptions msg model cliOptions flags -> Platform.Program (Cli.Program.FlagsIncludingArgv flags) (Cli.Program.StatefulProgramModel model cliOptions) msg"},{"name":"stateless","comment":" Create a CLI that processes arguments and exits immediately.\nUse `stateful` instead if you need to perform `Cmd`s (HTTP, etc.).\n","type":"Cli.Program.ProgramOptions msg options flags -> Cli.Program.StatelessProgram msg flags"},{"name":"toJsonSchema","comment":" Generate a JSON Schema describing the inputs of this CLI configuration.\n\nThe schema follows the [JSON Schema](https://json-schema.org/) format. Named options\n(keyword args, flags, keyword lists) are top-level properties with an `x-cli-kind`\nannotation indicating their CLI invocation form. Positional arguments and subcommands\ngo inside a `$cli` object.\n\nThe schema's `description` field includes a usage synopsis and instructions for\nhow to invoke the command via JSON or traditional CLI flags.\n\nSuitable for use as an [MCP tool](https://modelcontextprotocol.io/specification/draft/server/tools)\n`inputSchema` definition.\n\n    import Cli.Option as Option\n    import Cli.OptionsParser as OptionsParser\n    import Cli.Program as Program\n\n    programConfig =\n        Program.config\n            |> Program.add\n                (OptionsParser.build identity\n                    |> OptionsParser.with (Option.requiredKeywordArg \"name\")\n                )\n\n    schema =\n        Program.toJsonSchema \"my-script\" programConfig\n\nThe resulting schema has `name` as a top-level property with\n`\"x-cli-kind\": \"keyword\"`, and a required `$cli` object as the sentinel\nfor JSON input mode.\n\n","type":"String.String -> Cli.Program.Config msg -> Json.Encode.Value"}],"binops":[]},{"name":"Cli.Validate","comment":" This module contains helper functions for performing validations (see the\n\"validate...\" functions in `Cli.Option`).\n\n@docs predicate, ValidationResult, regex, regexWithMessage\n\n","unions":[{"name":"ValidationResult","comment":" Used with [`Option.validate`](Cli-Option#validate) to check a parsed value.\n\n    Option.requiredKeywordArg \"name\"\n        |> Option.validate\n            (\\name ->\n                if String.length name >= 2 then\n                    Validate.Valid\n\n                else\n                    Validate.Invalid \"Name must be at least 2 characters\"\n            )\n\n","args":[],"cases":[["Valid",[]],["Invalid",["String.String"]]]}],"aliases":[],"values":[{"name":"predicate","comment":" Turns a predicate function into a validate function.\n\n    import Cli.Option as Option\n    import Cli.Validate as Validate\n\n    isEven : Int -> Bool\n    isEven n =\n        modBy 2 n == 0\n\n    pairsOption : Option.Option (Maybe String) (Maybe Int)\n    pairsOption =\n        Option.optionalKeywordArg \"pair-programmers\"\n            |> Option.validateMapIfPresent String.toInt\n            |> Option.validateIfPresent\n                (Validate.predicate \"Must be even\" isEven)\n\n","type":"String.String -> (a -> Basics.Bool) -> a -> Cli.Validate.ValidationResult"},{"name":"regex","comment":" A helper for regex validations.\n\n    programConfig : Program.Config String\n    programConfig =\n        Program.config\n            |> Program.add\n                (OptionsParser.build identity\n                    |> OptionsParser.with\n                        (Option.requiredKeywordArg \"name\"\n                            |> Option.validate\n                                (Cli.Validate.regex \"^[A-Z][A-Za-z_]*\")\n                        )\n                )\n\nIf the validation fails, the user gets output like this:\n\n```shell\n$ ./greet --name john\nValidation errors:\n\n`name` failed a validation. Must be of form /^[A-Z][A-Za-z_]*/\nValue was:\n\"john\"\n```\n\n","type":"String.String -> String.String -> Cli.Validate.ValidationResult"},{"name":"regexWithMessage","comment":" A helper for regex validations with an additional message.\n\n    programConfig : Program.Config String\n    programConfig =\n        Program.config\n            |> Program.add\n                (OptionsParser.build identity\n                    |> OptionsParser.with\n                        (Option.requiredKeywordArg \"name\"\n                            |> Option.validate\n                                (Cli.Validate.regexWithMessage \"I expected this to be\" \"^[A-Z][A-Za-z_]*\")\n                        )\n                )\n\nIf the validation fails, the user gets output like this:\n\n```shell\n$ ./greet --name john\nValidation errors:\n\n`name` failed a validation. I expected this to be matching \"^[A-Z][A-Za-z_]*\" but got 'john'\nValue was:\n\"john\"\n```\n\n","type":"String.String -> String.String -> String.String -> Cli.Validate.ValidationResult"}],"binops":[]}]