// @generated by usage-cli from clap metadata
name usage-cli
bin usage
version "3.5.2"
about "CLI for working with usage-based CLIs"
usage "Usage: usage-cli [OPTIONS] [COMPLETIONS] <COMMAND>"
flag --usage-spec help="Outputs a `usage.kdl` spec for this CLI itself"
arg "[COMPLETIONS]" help="Outputs completions for the specified shell for completing the `usage` CLI itself" required=#false
cmd bash help="Execute a shell script using bash" {
    long_help #"""
Execute a shell script with the specified shell

Typically, this will be called by a script's shebang.

If using `var=#true` on args/flags, they will be joined with spaces using `shell_words::join()`
to properly escape and quote values with spaces in them.
"""#
    flag -h help="Show help"
    flag --help help="Show help"
    arg <SCRIPT>
    arg "[ARGS]…" help="Arguments to pass to script" required=#false var=#true
}
cmd complete-word help="Generate shell completion candidates for a partial command line" {
    alias cw
    long_help #"""
Generate shell completion candidates for a partial command line

This is used internally by shell completion scripts to provide intelligent completions for commands, flags, and arguments.
"""#
    flag "-f --file" help="Usage spec file or script with usage shebang, use \"-\" to read from stdin" {
        arg <FILE>
    }
    flag "-s --spec" help="Raw string spec input" {
        arg <SPEC>
    }
    flag --cword help="Current word index" {
        arg <CWORD>
    }
    flag --shell default=bash {
        arg <SHELL> {
            choices bash fish nu powershell zsh
        }
    }
    arg "[WORDS]…" help="User's input from the command line" required=#false var=#true
}
cmd exec help="Execute a script, parsing args and exposing them as environment variables" {
    alias x
    flag -h help="Show help"
    flag --help help="Show help"
    arg <COMMAND> help="command to execute after parsing usage spec"
    arg <BIN> help="path to script to execute"
    arg "[ARGS]…" help="arguments to pass to script" required=#false var=#true
}
cmd fish help="Execute a shell script using fish" {
    long_help #"""
Execute a shell script with the specified shell

Typically, this will be called by a script's shebang.

If using `var=#true` on args/flags, they will be joined with spaces using `shell_words::join()`
to properly escape and quote values with spaces in them.
"""#
    flag -h help="Show help"
    flag --help help="Show help"
    arg <SCRIPT>
    arg "[ARGS]…" help="Arguments to pass to script" required=#false var=#true
}
cmd generate subcommand_required=#true help="Generate completions, documentation, and other artifacts from usage specs" {
    alias g
    cmd completion help="Generate shell completion scripts for bash, fish, nu, powershell, or zsh" {
        alias c
        alias complete completions hide=#true
        flag "-f --file" help="A .usage.kdl spec file to use for generating completions, use \"-\" to read from stdin" {
            arg <FILE>
        }
        flag --cache-key help="A cache key to use for storing the results of calling the CLI with --usage-cmd" {
            arg <CACHE_KEY>
        }
        flag --include-bash-completion-lib help="Include https://github.com/scop/bash-completion" {
            long_help #"""
Include https://github.com/scop/bash-completion

This is required for usage completions to work in bash, but the user may already provide it
"""#
        }
        flag --usage-bin help="Override the bin used for calling back to usage-cli" default=usage {
            long_help #"""
Override the bin used for calling back to usage-cli

You may need to set this if you have a different bin named "usage"
"""#
            arg <USAGE_BIN>
        }
        flag --usage-cmd help="A command which generates a usage spec e.g.: `mycli --usage` or `mycli completion usage` Defaults to \"$bin --usage\"" {
            arg <USAGE_CMD>
        }
        arg <SHELL> help="Shell to generate completions for" {
            choices bash fish nu powershell zsh
        }
        arg <BIN> help="The CLI which we're generating completions for"
    }
    cmd completion-init help="Generate a shell init script that auto-completes any usage shebang script on $PATH" {
        alias ci
        alias init completions-init hide=#true
        long_help #"""
Generate a shell init script that auto-completes any usage shebang script on $PATH

Source the output once from your shell rc (e.g. ~/.bashrc) to enable tab-completion for any executable whose first line is a `usage` shebang — no per-script `usage g completion` step required.
"""#
        flag --usage-bin help="Override the bin used for calling back to usage-cli" default=usage {
            long_help #"""
Override the bin used for calling back to usage-cli

You may need to set this if you have a different bin named "usage"
"""#
            arg <USAGE_BIN>
        }
        arg <SHELL> help="Shell to generate the init script for" {
            choices bash fish zsh
        }
    }
    cmd fig help="Generate Fig completion spec for Amazon Q / Fig" {
        flag "-f --file" help="A usage spec taken in as a file, use \"-\" to read from stdin" {
            arg <FILE>
        }
        flag --out-file help="File path where the generated Fig spec will be saved" {
            arg <OUT_FILE>
        }
        flag --spec help="Raw string spec input" {
            arg <SPEC>
        }
    }
    cmd json help="Outputs a usage spec in json format" {
        flag "-f --file" help="A usage spec taken in as a file, use \"-\" to read from stdin" {
            arg <FILE>
        }
        flag --spec help="raw string spec input" {
            arg <SPEC>
        }
    }
    cmd manpage {
        alias man
        flag "-f --file" help="A usage spec taken in as a file, use \"-\" to read from stdin" required=#true {
            arg <FILE>
        }
        flag "-o --out-file" help="Output file path (defaults to stdout)" {
            arg <OUT_FILE>
        }
        flag "-s --section" help="Manual section number (default: 1)" default="1" {
            long_help #"""
Manual section number (default: 1)

Common sections: - 1: User commands - 5: File formats - 7: Miscellaneous - 8: System administration commands
"""#
            arg <SECTION>
        }
    }
    cmd markdown help="Generate markdown documentation from usage specs" {
        alias md
        flag "-f --file" help="A usage spec taken in as a file, use \"-\" to read from stdin" required=#true {
            arg <FILE>
        }
        flag "-m --multi" help="Render each subcommand as a separate markdown file"
        flag --html-encode help="Escape HTML in markdown"
        flag --out-dir help="Output markdown files to this directory (required when using --multi)" {
            arg <OUT_DIR>
        }
        flag --out-file help="Output file path for single-file markdown generation" {
            arg <OUT_FILE>
        }
        flag --replace-pre-with-code-fences help="Replace `<pre>` tags with markdown code fences"
        flag --url-prefix help="Prefix to add to all URLs" {
            arg <URL_PREFIX>
        }
    }
    cmd sdk help="Generate a type-safe SDK from a usage spec" {
        flag "-f --file" help="A usage spec taken in as a file" {
            arg <FILE>
        }
        flag "-l --language" help="Target language for the SDK" required=#true {
            arg <LANGUAGE> {
                choices typescript python
            }
        }
        flag "-o --output" help="Output directory for generated SDK files" required=#true {
            arg <OUTPUT>
        }
        flag "-p --package-name" help="Override the package/module name (defaults to spec bin name)" {
            arg <PACKAGE_NAME>
        }
        flag --spec help="Raw string spec input" {
            arg <SPEC>
        }
    }
}
cmd lint help="Lint a usage spec file for common issues" {
    flag "-f --format" help="Output format" default=text {
        arg <FORMAT> {
            choices text json
        }
    }
    flag "-W --warnings-as-errors" help="Treat warnings as errors"
    arg <FILE> help="A usage spec file to lint, use \"-\" to read from stdin"
}
cmd powershell help="Execute a shell script using PowerShell" {
    long_help #"""
Execute a shell script with the specified shell

Typically, this will be called by a script's shebang.

If using `var=#true` on args/flags, they will be joined with spaces using `shell_words::join()`
to properly escape and quote values with spaces in them.
"""#
    flag -h help="Show help"
    flag --help help="Show help"
    arg <SCRIPT>
    arg "[ARGS]…" help="Arguments to pass to script" required=#false var=#true
}
cmd sponsors help="Show the companies sponsoring usage and the en.dev project family"
cmd zsh help="Execute a shell script using zsh" {
    long_help #"""
Execute a shell script with the specified shell

Typically, this will be called by a script's shebang.

If using `var=#true` on args/flags, they will be joined with spaces using `shell_words::join()`
to properly escape and quote values with spaces in them.
"""#
    flag -h help="Show help"
    flag --help help="Show help"
    arg <SCRIPT>
    arg "[ARGS]…" help="Arguments to pass to script" required=#false var=#true
}

source_code_link_template "https://github.com/jdx/usage/blob/main/cli/src/cli/{{path}}.rs"
