docopt
docopt: A help-first, open-source parser for structured command-line interfaces. Ranked #43 of 60 in Command-Line Interface Frameworks by our editors (4.9/10); pricing: Free plan; best for help-first CLI design across languages.
At a glance
- Editor score4.9 / 10
- PricingFree plan
- Best forHelp-first CLI design across languages
- Free planYes
- Paid fromFree
- Facts checked17 Nov 2026
Where it wins
- Generates parsers directly from written usage and help text
- Supports hierarchical subcommands, repeated arguments, defaults, and options-first mode
- Integrates with JSON, YAML, or INI configuration files and has official language ports
Where it doesn't
- Help-message structure determines parser behavior and requires careful specification
- Self-hosted deployment places installation and maintenance with your team
- Support is centered on community and documentation channels
Our verdict on docopt
docopt is an open-source Python library for defining command-line interfaces through a structured help message. It parses options, positional arguments, and commands, then returns parsed values to an application. The approach suits developers who want the usage text to serve as the interface definition, including solo projects and teams building tools with nested command hierarchies. Official ports extend the same style to other programming languages.
Its pricing model is open_source with a free plan, so adoption does not depend on selecting a paid tier. The central feature is help-driven parser generation: a written usage pattern describes optional and required elements, commands, arguments, and options. docopt handles repeated options and arguments, option defaults, an options-first mode, and automatic help and version options. Hierarchical subcommands and multi-level help make it suitable for CLIs that need more than a single command, while configuration-file integration supports JSON, YAML, or INI formats.
Deployment is self-hosted, and installation can be done with pip or by copying the library into a project. That keeps the runtime model close to the application and avoids a hosted service dependency. Official ports improve language coverage, but each project still needs a help specification that accurately expresses its intended behavior. Teams seeking a typed API or built-in shell-completion workflow should evaluate alternatives alongside docopt. Choose docopt when readable usage text, nested commands, and a lightweight open-source model are priorities; choose another framework when generated typing or completion tooling is central to the CLI experience.
Your product? Our editors can test docopt in depth and publish a review, labelled as paid · from $149/mo →
docopt pricing
docopt fact sheet
| Free plan | Yes |
|---|---|
| Paid from | Free |
| Shell completion | Not verified |
| Nested subcommands | Yes |
| Code generation | Not verified |
| Config file support | Yes |
| Environment variables | Not verified |
| Typed API | Not verified |
| Deployment | Self-hosted |
| Support | Community, Docs |
| Built for | Solo, Small business, Mid-market, Enterprise (editorial estimate) |
| Pricing | Free plan |
| Website | docopt.org |
| Facts checked | 17 Nov 2026 |
Alternatives to docopt
- ClapA free Rust crate with typed parsing, nested commands, validation, and completions.9.4
- ClickA free, open-source toolkit for typed, nested Python command-line applications.9.3
- TyperFree, open-source typed CLI framework with nesting, completions, and configuration support.9.2
Used docopt? Be the first to review it
The editor score above is our own research. What this page doesn't have yet is a reader's view — what you used docopt for, what worked and what didn't. No stars are seeded and no review is paid for; an editor reads every one before it appears.
Write a reviewTwo minutes · verified accounts only · read by an editor before it appears
Featured on iTechGuides
docopt is listed in our Command-Line Interface Frameworks directory. Add the badge to your site — it links back to this page.
<a href="https://www.itechguides.com/products/docopt/"><img src="https://www.itechguides.com/best/badge/docopt.svg" alt="Featured on iTechGuides" width="230" height="46"></a>
Reviewed by iTechGuides Editors · Editorial team · Updated Nov 2026
Advertiser disclosure: iTechGuides is reader-supported. Vendors can pay for top positions in our rankings and for a place on other products' pages, and we may earn a commission when you click some links. Bought places stand at the number bought; this page and our disclosure say so. Paying vendors may get a fuller, more detailed review from our editors, and that review can change their score. How we rank.
Last updated · How we research and update