argh
Plain Python functions as CLI commands without boilerplate
Decision gist · record as of 2026-08-14
Yes, if you need a lightweight CLI builder. Argh is stable, has no dependencies, and solves a real problem—reducing argparse boilerplate. The aging maintenance status (762 days since last release) is a minor concern for a mature, feature-complete library, but verify that it meets your Python version needs and that you're comfortable with LGPL licensing before committing to it.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.8 or later.
- Low friction: pure Python wheel with no runtime dependencies.
- Maintenance is aging—last release was 762 days ago—but the repository remains active with recent commits and no archived status.
License · maintenance · safety
copyleft license (copyleft) — Licensed under LGPL (copyleft). You may use and modify the package freely, but any derivative work must also be distributed under LGPL or a compatible license.
last release 2024-07-13 (762 days) · last repo commit 2025-09-04 · 382 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 2,544,276 downloads/mo, #3,008 on PyPI
Alternatives
Verify before relying
pip install argh
import argh
def greet(name: str, greeting: str = "Hello"):
print(f"{greeting}, {name}!")
argh.dispatch_command(greet)- Whether the package is actively maintained or in maintenance-only mode despite aging release cycle.
- Compatibility with modern Python versions beyond 3.13 as they are released.
What it is and what it does
Argh is a thin wrapper around Python's built-in argparse that eliminates boilerplate by letting you write CLI commands as ordinary Python functions. Instead of constructing argument parsers manually, you define a function with type annotations and call argh.dispatch_command() to turn it into a command-line tool. Argh infers argument names, types, and help text from your function signature and annotations, making the CLI definition match the function definition.
The package is designed for developers who want the power of argparse without its verbose API. It supports subcommands, nested commands, type checking, and integrates cleanly with third-party libraries for features like completion and progress bars. Since it has no runtime dependencies beyond the standard library, it adds minimal overhead to your project.
Use it for
- Convert a utility function into a standalone CLI tool without writing argument parser boilerplate.
- Build multi-command applications with nested subcommands while keeping command logic as plain functions.
- Create type-safe CLI tools where argument validation is driven by Python type annotations.
- Reuse the same function logic in both CLI and programmatic contexts without duplication.
- Rapidly prototype command-line interfaces for scripts, build tools, or system utilities.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need a lightweight CLI builder.
Argh is stable, has no dependencies, and solves a real problem—reducing argparse boilerplate. The aging maintenance status (762 days since last release) is a minor concern for a mature, feature-complete library, but verify that it meets your Python version needs and that you're comfortable with LGPL licensing before committing to it.
Install
argh on PyPI
Before you install
Low friction: pure Python wheel with no runtime dependencies. Maintenance is aging—last release was 762 days ago—but the repository remains active with recent commits and no archived status.
Requires Python 3.8 or later.
License in practice
Licensed under LGPL (copyleft). You may use and modify the package freely, but any derivative work must also be distributed under LGPL or a compatible license.
Quickstart
pip install argh
import argh
def greet(name: str, greeting: str = "Hello"):
print(f"{greeting}, {name}!")
argh.dispatch_command(greet)
Verify before relying
- Whether the package is actively maintained or in maintenance-only mode despite aging release cycle.
- Compatibility with modern Python versions beyond 3.13 as they are released.
Package facts
| License | copyleft license copyleft |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Aging 762 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,544,276 / month, #3,008 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: DevelopersIntended Audience :: Information TechnologyLicense :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)Programming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries :: Python ModulesTopic :: Software Development :: User Interfaces |
Evidence: argh-0.31.3-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 › “python function to cli”
- arghArgh turns plain Python functions into command-line interfaces by…
- entrypoint2Converts Python function signatures and docstrings into command-line…
- autocommandAutocommand converts a Python function into a command-line program by…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also argparse-dataclass · argparse-ext · face · autocommand · entrypoint2 · decli · argdantic · rich-argparse · clize · guacamole