awesome-repositories.com
博客
awesome-repositories.com

通过 AI 驱动的搜索,发现最优秀的开源仓库。

探索精选搜索开源替代品自托管软件博客网站地图
项目关于排名机制媒体报道MCP 服务器
法律隐私政策服务条款
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
CLIUtils avatar

CLIUtils/CLI11

0
View on GitHub↗
4,322 星标·451 分支·C++·2 次浏览cliutils.github.io/CLI11/book↗

CLI11

CLI11 是一个仅包含头文件的 C++ 库,用于解析命令行参数和管理配置文件。它将 shell 输入映射到类型化变量,并支持创建复杂的命令层级。

该库的特色在于支持无限深度的嵌套子命令和前缀匹配。它通过允许从 TOML 或 INI 文件加载应用程序设置来集成配置管理,并支持回退到环境变量。

该项目提供了一套完整的参数解析工具,包括标志和位置参数,以及用于强制执行强制选项和相互依赖关系的验证框架。它还包括带有可自定义格式的自动帮助文档生成功能,以及在特定解析阶段触发自定义逻辑的回调系统。

该库无依赖,专为 C++11 及更高版本设计。

Features

  • C++ CLI Frameworks - Provides a comprehensive framework for building complex C++ command-line interfaces with nested hierarchies and automated help.
  • Command Line Argument Parsing - Provides the core capability of reading raw command line strings and assigning them to typed variables.
  • Configuration File Integration - Merges settings from INI or TOML files directly into the command line state for flexible application configuration.
  • Automated Help Generators - Automatically produces detailed usage instructions and descriptions for options and subcommands upon user request.
  • C++ Configuration Management - Enables loading and saving application settings using INI or TOML files with environment variable overrides.
  • CLI Argument Parsers - Functions as a primary utility for mapping shell input to typed variables and managing command hierarchies.
  • Nested Command Structures - Supports the organization of subcommands into a nested hierarchy allowing for infinite depth.
  • CLI Configuration Files - Provides a system for reading application settings from configuration files using custom or default paths.
  • Positional Argument Configurations - Assigns values to options based on their order of appearance when no flag name is provided.
  • Command Line Argument Parsers - Provides a header-only implementation for parsing raw shell input strings into structured C++ objects.
  • Typed Variable Bindings - Connects command-line options to existing variables using internal wrappers to avoid the need for custom typed classes.
  • Command Line Flag Definitions - Supports the creation of options that trigger based on presence for boolean toggles or occurrence counters.
  • Mandatory Parameter Enforcement - Enforces that specific command-line options are provided, causing the program to exit if they are missing.
  • Configuration File Parsers - Provides utilities for reading INI and TOML configuration files and mapping them to internal data structures.
  • Help Text Generators - Automatically constructs and formats instructional documentation to inform users about available options and usage patterns.
  • Configuration File Loading - Reads settings from files or environment variables to provide default or override values for the application.
  • Input Validation Frameworks - Passes parsed values through a chain of validator functions to enforce numeric ranges, file existence, or custom formats.
  • Command-Line Type Mapping - Maps command line flags to specific C++ data types to ensure inputs are correctly typed and stored.
  • CLI Argument Validators - Validates that input values meet specific criteria, such as valid file paths or numeric ranges.
  • Input Validation Rules - Checks provided arguments against a set of declarative rules to ensure they meet specific criteria.
  • Terminal Input Validation - Runs checks and transformations on parsed values to ensure they meet specific operational criteria.
  • CLI Input Validation - Enforces data constraints and custom rules on command line arguments to ensure program stability.
  • Input Format Validations - Checks and transforms user entries using predefined rules to ensure numeric constraints or required formats.
  • Argument Grouping - Collects related options into groups to manage mutual exclusivity or organize help output.
  • Multi-Value Argument Capture - Captures one or more arguments into a single container by supporting repeated flags or space-separated lists.
  • CLI Type Converters - Provides utilities for mapping raw command-line strings into native C++ types via custom conversion logic.
  • Default Value Assignment - Assigns fallback values to options when they are omitted by the user and displays them in help text.
  • Configuration-Driven Command Execution - Executes subcommands based on blocks within a configuration file to allow the config to act as a script.
  • Command Callbacks - Provides callbacks that run at specific stages of the parsing process to perform setup or teardown actions.
  • Positional Argument Validation - Tests command line tokens against validators to determine if they are positional options or extra arguments.
  • Environment Variable Configuration - Includes logic for reading command-line argument values directly from specified environment variables.
  • Flag Detection Callbacks - Executes specific functions immediately when a flag is detected during the parsing process.
  • Environment Fallbacks - Implements a fallback mechanism that retrieves values from environment variables when a command-line option is not provided.
  • Option Callbacks - Allows triggering user-defined functions when specific options are parsed to handle complex data types.
  • Cross-Platform Console Tooling - Ensures consistent command-line tool behavior and Unicode support across different operating systems.
  • Command Help Customization - Allows replacing the default help generation with custom programmable functions or classes for bespoke output.
  • Help Layout Templates - Provides a customizable formatter to adjust labels and layouts of the generated help text.
  • Option Dependency Constraints - Tracks requirements and exclusions between options to ensure mutually exclusive or dependent flags are correctly provided.
  • TOML Configuration Support - Supports reading application settings from structured TOML and INI configuration files.
  • Callback Execution Controllers - Triggers specific callback functions immediately after a subcommand and its associated options are parsed.
  • Custom Parsing Logic - Provides mechanisms to execute user-defined logic at specific stages of the argument parsing process.
  • Header-Only Libraries - Distributed as a dependency-free, header-only library for easy integration into C++11 and later projects.
  • Option Dependency Constraints - Implements dependencies where one option requires another to be present or prevents another from being used.
  • CLI Option Dependencies - Implements a validation framework to enforce mandatory options and mutual dependencies between command-line flags.
  • Subcommand - Matches subcommands using unambiguous partial names, allowing users to trigger commands with shortened versions.
  • CLI Syntax Consistency Validation - Ensures that defined options and subcommands are self-consistent and throws exceptions for malformed arguments.
  • Custom Argument Validators - Supports defining unique validation or transformation logic via functions to enforce domain-specific rules.
  • Argument Parsers - Feature-rich command-line parser for C++11 and beyond.
  • C++ CLI Frameworks - Feature-rich command-line parser for modern C++.
  • CLI and Argument Parsing - Feature-rich command-line parser for C++11.
  • 命令行界面 - Advanced CLI parsing with single or multi-file support.
  • Command Line Parsing - Feature-rich CLI parsing.

Star 历史

cliutils/cli11 的 Star 历史图表cliutils/cli11 的 Star 历史图表

AI 搜索

探索更多 awesome 仓库

用简单的语言描述您的需求 —— AI 将根据相关性为您从数千个精选开源项目中进行排序。

Start searching with AI

CLI11 的开源替代方案

相似的开源项目,按与 CLI11 的功能重合度排序。
  • commandlineparser/commandlinecommandlineparser 的头像

    commandlineparser/commandline

    4,817在 GitHub 上查看↗

    This library is a .NET command line parser for C# and F# that implements POSIX getopt conventions to map shell arguments into strongly typed objects. It provides a framework for building console applications that process Unix-style flags and options. The project features a routing system that directs program execution based on action-oriented verbs, supporting sub-commands and default actions. It includes an automatic help generator that produces localized usage instructions and formatted help screens based on the defined command options. The toolset covers argument parsing with strongly typ

    C#command-linedotnetdotnet-core
    在 GitHub 上查看↗4,817
  • fastapi/typerfastapi 的头像

    fastapi/typer

    19,632在 GitHub 上查看↗

    This project is a Python framework for building command-line interfaces by converting standard functions into executable programs. It uses type hints to automatically infer and generate argument parsers, validation logic, and help documentation, allowing developers to define complex terminal applications through simple function signatures. The framework distinguishes itself through a decorator-driven registration system that enables the construction of hierarchical command trees. It supports dependency injection to manage shared state and runtime configuration across subcommands, and it utili

    Pythoncliclickpython
    在 GitHub 上查看↗19,632
  • yargs/yargsyargs 的头像

    yargs/yargs

    11,492在 GitHub 上查看↗

    yargs is a command-line interface framework and argument parser for Node.js. It translates raw command-line strings into structured JavaScript objects, providing a toolkit for building terminal applications with nested sub-commands, dedicated handlers, and a structured user interface. The framework distinguishes itself through automated help text generation, which constructs formatted usage menus and instructions based on registered metadata. It also provides shell completion generation for Bash and Zsh and uses string-distance algorithms to offer typo correction suggestions when invalid inpu

    JavaScript
    在 GitHub 上查看↗11,492
  • pallets/clickpallets 的头像

    pallets/click

    17,560在 GitHub 上查看↗

    Click is a Python framework for building command-line interfaces. It provides a declarative approach to defining command structures, allowing developers to map functions to command-line arguments, options, and nested groups using decorators. The framework handles the complexities of parameter parsing, type validation, and help documentation generation automatically. The project distinguishes itself through its hierarchical context system, which propagates configuration and state across nested commands, and its environment-aware parameter resolution that prioritizes command-line inputs, enviro

    Pythoncliclickpallets
    在 GitHub 上查看↗17,560
查看 CLI11 的所有 30 个替代方案→

常见问题解答

cliutils/cli11 是做什么的?

CLI11 是一个仅包含头文件的 C++ 库,用于解析命令行参数和管理配置文件。它将 shell 输入映射到类型化变量,并支持创建复杂的命令层级。

cliutils/cli11 的主要功能有哪些?

cliutils/cli11 的主要功能包括:C++ CLI Frameworks, Command Line Argument Parsing, Configuration File Integration, Automated Help Generators, C++ Configuration Management, CLI Argument Parsers, Nested Command Structures, CLI Configuration Files。

cliutils/cli11 有哪些开源替代品?

cliutils/cli11 的开源替代品包括: commandlineparser/commandline — This library is a .NET command line parser for C# and F# that implements POSIX getopt conventions to map shell… fastapi/typer — This project is a Python framework for building command-line interfaces by converting standard functions into… yargs/yargs — yargs is a command-line interface framework and argument parser for Node.js. It translates raw command-line strings… pallets/click — Click is a Python framework for building command-line interfaces. It provides a declarative approach to defining… remkop/picocli — picocli is a command line interface development framework and argument parser for JVM-based applications. It maps… apple/swift-argument-parser — This is a library for building command-line interfaces in Swift. It converts command-line arguments into type-safe…