CLI11: The Header-Only Command Line Parser for C++
CLI11 is a command line parser for C++11 and beyond that provides a rich feature set with a simple and intuitive interface.
At a glance
- What is it?
- Parsing arguments is one of the least interesting parts of writing a C++ tool and one of the most tedious. CLI11 is a bet that it should take a dozen lines, not a page of boilerplate.
- Who is it for?
- CLI11's argument is a simple one: the boring part of your program should not be the longest part. It is header-only, dependency-free, works back to GCC 4.8, and its recent releases show the maintenance energy going into compile-time cost rather than feature churn.
- Can I use it commercially?
- Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
- Is it still maintained?
- Yes. The repository last received commits 1 day ago.
- What is it written in?
- Mainly C++, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 25, 2026, and from our analysis. They are not legal advice.
Star history
- CLIUtils/CLI114,534 ★ · +59
| Repository | 2026-10-07 | 2026-11-25 |
|---|---|---|
| CLIUtils/CLI11 | 4.5k | 4.5k |
59 Stars in the last 49 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
What CLI11 is
The repository description is plain: "CLI11 is a command line parser for C++11 and beyond that provides a rich feature set with a simple and intuitive interface." The header says the same thing more tersely, "Command line parser for C++11."
A parser like this sits between `main` and the rest of your program. You describe the options your tool accepts, the library reads `argv`, validates it, and hands you ordinary typed variables. It is a small category of software that every command line utility eventually needs and few enjoy writing themselves.
Two properties define CLI11's approach. It is header-only, meaning you copy headers or fetch them through your build system and there is nothing to link against in the traditional sense. It also has no dependencies beyond C++11 itself.
The provenance is worth knowing because it explains the design. The README says CLI11 was originally used by the GooFit GPU fitting framework and was inspired by `plumbum.cli` for Python. That heritage shows: the goal is to bring Python's readability to C++, where hand-rolled argument handling usually sprawls.
Adoption sits at roughly 4,500 stars and 490 forks, with 85 open issues against the current state. The last push to the repository was October 22, 2026, and releases in the 2.7 series landed across late July and early August, so this is an actively developed library rather than a finished artifact.
The criteria the project sets for itself
The README contains one of the more honest sections in library documentation: a checklist of what an acceptable CLI parser should do. The list is worth reading because it is also an argument for why CLI11 exists.
The first requirement is easy to include, meaning header only, one file if possible, with no external requirements. The second is short, simple syntax, and the README expands on why that matters: if most of your program is hidden in CLI parsing, that is a problem for readability.
The third sets the floor. C++11 or better, working with GCC 4.8+, which the README notes is the default on CentOS and RHEL 7, Clang 3.4+, AppleClang 7+, NVCC 7.0+, and MSVC 2015+. That is a deliberately old baseline, and it constrains what the library can use internally.
From there the requirements read like a feature list: Linux, macOS and Windows support; coverage measured by CodeCov; clear help printing; nice error messages; standard shell idioms such as grouping flags and a positional separator; correct exit codes; extensibility as part of a framework that provides applications to users; usable subcommand syntax with multiple and nested subcommands, option groups and optional fallthrough; configuration file support in TOML, INI or a custom format, with the ability to produce one as well as read one; and support for common types, simple custom types, and exotic types through extension.
One requirement stands out as a design philosophy rather than a feature. The library should "produce real values that can be used directly in code, not something you have to pay compute time to look up," which the README frames as being for HPC applications. In other words, the parsed result is a variable, not a query interface.
Installing it across build systems
CLI11 is consumed as headers, and the repository tree reflects every packaging route you would expect.
For CMake, the tree carries `CMakeLists.txt`, a `CMakePresets.json`, and a `cmake/` directory.
Meson is supported directly, with `meson.build` and `meson_options.txt` at the root. Bazel has both `BUILD.bazel` and `MODULE.bazel`, the latter being the modern Bzlmod module file.
The single-header route is the simplest for small projects. A `single-include/` directory at the root holds the amalgamated form, and the README notes that the library "comes in a single file form for easy inclusion in projects."
Beyond source builds, the README badges show packaging through Conan and Conda, a Repology entry, and a DOI for citation. There is also a Gitter chat link and a "Try CLI11 online" wandbox badge, which gives you a way to see the library working before you commit to it.
Options, types, and validators
The documentation's table of contents spends more space on options and validators than on anything else, and that reflects where the library puts its effort. The sections cover adding options, option types, option options, validators, default validators, validators that may be disabled, extra validators, transforming validators, validator operations, custom validators, querying validators, and getting results.
That structure tells you the library's central idea. Validation is a first-class composable object rather than an afterthought bolted onto a flag. You build a validator, apply it to an option, and the parse either succeeds or fails with a message the user can act on.
The README's feature notes mention that the library works with common types, simple custom types, and is extensible to exotic types. Option groups and fallthrough appear in the subcommand section, meaning you can structure related flags together and control whether parsing continues past a recognized subcommand.
Subclassing gets its own section, and so does formatting, which covers how help text is rendered. The "How it works" and "Unicode support" sections, including a note on using Unicode paths, suggest the authors care about the unglamorous parts.
What version 2.7 actually changed
The release history is the best evidence of where the project's attention sits, and 2.7 is unusually focused on build and compile-time cost rather than new user-facing features.
Version 2.7.0, published July 30, 2026, is titled "Audit and documentation."
Version 2.7.1 followed the next day under the title "LTO link fix."
Version 2.7.2, on August 2, is titled "Faster compiles."
How it compares to other choices
The README includes a comparison table of major C++ CLI parsers, helpfully labeled as containing biased opinions. The entry that gets the most space is Boost Program Options, described as a great library if you already depend on Boost, while noting that its pre-C++11 syntax is odd and that setting up the correct call in the main function is poorly documented, at nearly a page of code. The notes record that a simple wrapper around Boost was originally developed and then discarded as CLI11 grew more capable, and that the idea of capturing a value and setting it came from Boost Program Options.
That last detail is a nice piece of intellectual history. CLI11 is not competing with Boost so much as answering a question Boost made necessary.
Other parsers get briefer treatment. The Lean Mean C++ Option Parser is the next entry in the table.
The honest summary is that if your project already pulls in Boost, using Boost Program Options is defensible and avoids a second dependency. If you want something self-contained with a syntax closer to Python, CLI11 is built for that.
Licensing, maintenance, and maturity
The repository metadata reports no license identifier, but the README badge links to a BSD license and a `LICENSE` file sits at the root of the tree. The README's own requirement list asks for a permissively licensed library, and a BSD license satisfies that. Anyone relying on this for compliance should read the `LICENSE` file directly rather than take the badge's word for it.
Maturity is the strongest argument for the library. The version numbering has reached 2.7 with a `CHANGELOG.md` at the root. There are version-specific blog posts linked for 1.0, 1.3, 1.6 and 2.0, which is a long public record of design decisions.
The infrastructure signals are equally mature. The tree contains `.clang-format`, `.clang-tidy`, `.cmake-format.yaml`, `CPPLINT.cfg`, `.pre-commit-config.yaml`, `azure-pipelines.yml`, and a `.ci/` directory alongside GitHub Actions. There is a `fuzz/` directory, which means the parser is fuzzed, and a substantial `tests/` directory. The README states the project is tested on Azure and GitHub Actions, with coverage measured by CodeCov.
There is also an `AGENTS.md`, an `.agents/` directory, and a `.all-contributorsrc`.
For a command line parser, the practical conclusion is that you are choosing a library with a long public release history behind it, available in a form that costs you nothing to vendor. The main decision left is whether your project wants a single dependency at all.
Editorial conclusion
CLI11's argument is a simple one: the boring part of your program should not be the longest part. It is header-only, dependency-free, works back to GCC 4.8, and its recent releases show the maintenance energy going into compile-time cost rather than feature churn. For a C++ tool that needs to be understandable six months later, that is exactly the right direction.
Frequently asked questions
Is CLI11 header-only, and does it need any external libraries?
Yes. The README states CLI11 is header-only with no dependencies beyond C++11, and it ships a single-file form for easy inclusion. The repository root has a single-include directory holding the amalgamated header, so a small project can vendor one file.
Which C++ compilers and platforms does CLI11 support?
The README sets the floor at C++11 and lists GCC 4.8+, Clang 3.4+, AppleClang 7+, NVCC 7.0+ and MSVC 2015+. It works on Linux, macOS and Windows.
Does CLI11 support subcommands and configuration files?
Both. The README lists usable subcommand syntax with multiple and nested subcommands, option groups, and optional fallthrough. It also supports configuration files in TOML, INI or a custom format.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/cliutils-cli11)Star history chart for your README
[](https://hysenlabs.com/projects/cliutils-cli11)Was this useful?