p-ranav/argparse

Argument Parser for Modern C++

View on GitHub ↗Jump to charts ↓Open shareable report →

p-ranav/argparse has 3.5k+ stars and 300+ forks on GitHub, is written in C++, and was last pushed on Oct 5, 2026. Data as of . Signed-in members get hourly updates — create a free account.

Summary Information

Updated 52 minutes ago
Type:Library / SDKCategory(s):Core & Utility LibrariesLanguages & Runtimes
Added to GitGenius on October 1st, 2026
Created on March 30th, 2019
Open Issues & Pull Requests: 80 (+0)
GitHub issues: Enabled
Number of forks: 320
Total Stargazers: 3,558 (+0)
Total Subscribers: 31 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 2.5 hours
Mean response time: 98.9 days
90th percentile: 442.3 days
Tracked items: 31

How this project is maintained

100% of open issues come from outside the core team, so the backlog reflects real-world use rather than internal planning. Three people close 69% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 24
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 469 days
Stale 30+ days: 24
Stale 90+ days: 22

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

No label distribution available yet.

Most active issues this week

Sign in to see which issues are moving.
Sign in

Detailed Description

argparse is a header-only argument parser library for modern C++.

The tool solves the problem of parsing command-line arguments in C++ programs by providing a single-header library that handles positional arguments, optional arguments, subcommands, and mutually exclusive groups. It works by allowing developers to define an ArgumentParser object, add arguments with their properties and constraints, and then parse incoming command-line input against those definitions. The library supports features like default values, argument validation, help text generation, parent parsers for shared argument definitions, and the ability to detect whether a user explicitly provided a value.

Developers should choose this tool if they are working with C++17 or later and want to avoid external dependencies in their argument parsing logic. It suits projects ranging from simple command-line utilities to complex applications with subcommands and hierarchical argument structures. The header-only design means no compilation or linking steps are required beyond including the single file. The library handles common parsing scenarios including negative numbers, compound arguments, custom prefix characters, and gathering remaining arguments after a separator.

The project maintains active development with regular updates and bug fixes. The codebase demonstrates attention to edge cases and real-world usage patterns through its comprehensive feature set. Testing infrastructure is in place to validate behavior across supported toolchains. Documentation is thorough, with examples covering both basic and advanced usage patterns including custom value restrictions, JSON construction from arguments, and formatting customization.