jsonargparse
Minimal effort CLIs derived from type hints and parse from command line, config files and environment variables.
Decision gist · record as of 2026-08-14
Yes. jsonargparse is a solid choice for any Python project needing a CLI or configuration system. It has low install friction (one required dependency), active maintenance, no known vulnerabilities, and a permissive license. The design is non-intrusive—your code remains clean and testable. Use it if you want to avoid hand-writing argparse boilerplate or if you need config file support beyond what argparse provides.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction: pure Python wheel with only PyYAML as a required runtime dependency.
- Active maintenance with a release 23 days ago and consistent commit history.
- Supports Python 3.10 through 3.14.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you can use, modify, and distribute this package with minimal restrictions, making it suitable for both open-source and commercial projects.
last release 2026-07-22 (23 days) · last repo commit 2026-08-14 · 429 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 3,354,816 downloads/mo, #2,650 on PyPI
Alternatives
Verify before relying
pip install jsonargparse
from jsonargparse import auto_cli
def main(name: str, count: int = 1):
for _ in range(count):
print(f"Hello {name}")
if __name__ == "__main__":
auto_cli(main)- Whether the 'substantial user base' claim is quantified beyond pytorch-lightning's LightningCLI adoption.
- Performance characteristics when parsing very large config files or deeply nested structures.
- Compatibility guarantees with optional dependencies (OmegaConf, shtab, argcomplete) across versions.
What it is and what it does
jsonargparse is a library for building command-line interfaces and making Python applications configurable without boilerplate. It reads your function or class signatures—their parameter names, type hints, and docstrings—and automatically generates a CLI that accepts arguments from the command line, YAML/JSON/TOML config files, or environment variables. It handles complex types (unions, optionals, nested dataclasses), dependency injection, and variable interpolation, all while keeping your core code free of CLI-specific decorators or inheritance.
The library is built on argparse but extends it significantly: it parses structured configs into nested hierarchies, supports multiple file formats, and can instantiate objects from parsed configurations. It's used as the foundation for pytorch-lightning's LightningCLI and is actively maintained with semantic versioning and full test coverage.
Use it for
- Build a CLI tool that accepts both command-line flags and a YAML config file without writing separate parsing logic.
- Make a machine learning training script configurable via config files while keeping the training function clean and testable.
- Create a multi-step application where each step's parameters are defined as function arguments and automatically exposed to the CLI.
- Parse environment variables and config files into a structured dataclass without manual validation or type conversion.
- Support dependency injection in your CLI so users can swap implementations by changing config values.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
jsonargparse is a solid choice for any Python project needing a CLI or configuration system. It has low install friction (one required dependency), active maintenance, no known vulnerabilities, and a permissive license. The design is non-intrusive—your code remains clean and testable. Use it if you want to avoid hand-writing argparse boilerplate or if you need config file support beyond what argparse provides.
Install
jsonargparse on PyPI
Before you install
Low friction: pure Python wheel with only PyYAML as a required runtime dependency. Active maintenance with a release 23 days ago and consistent commit history. Supports Python 3.10 through 3.14.
License in practice
MIT license is permissive; you can use, modify, and distribute this package with minimal restrictions, making it suitable for both open-source and commercial projects.
Quickstart
pip install jsonargparse
from jsonargparse import auto_cli
def main(name: str, count: int = 1):
for _ in range(count):
print(f"Hello {name}")
if __name__ == "__main__":
auto_cli(main)
Verify before relying
- Whether the 'substantial user base' claim is quantified beyond pytorch-lightning's LightningCLI adoption.
- Performance characteristics when parsing very large config files or deeply nested structures.
- Compatibility guarantees with optional dependencies (OmegaConf, shtab, argcomplete) across versions.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagePyYAML |
| Maintenance | Actively maintained 23 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,354,816 / month, #2,650 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14 |
Evidence: jsonargparse-4.50.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “type-hint based CLI”
- jsonargparsejsonargparse creates command-line interfaces and configuration…
- polyfactoryPolyfactory generates mock data objects from type hints, supporting…
- fastapiFastAPI is a Python web framework for building REST APIs using type…
Give your agent the search over MCP, or paste the wish link into any chat.
More Application Frameworks packages
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Textual is a Python framework for building cross-platform user interfaces that run in the terminal or web browser using a modern, component-based API.
Install it if you're developing CLI tools, dashboards, or interactive terminal applications.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Build and connect to Model Context Protocol servers that expose tools, resources, and prompts to LLM applications over stdio, HTTP, or SSE transports.
Install it if you need to build or connect to servers.
Werkzeug is a WSGI utility library providing request/response objects, URL routing, an interactive debugger, HTTP utilities, and a development server for building web applications.
See also simple-parsing · tyro · jsonnet · argparse-dataclass · ConfigArgParse · typer-config · targ · configurator · jaraco.logging