--- id: argh version: "0.31.3" license: unclear license_treatment: copyleft maintenance: aging --- # argh — Plain Python functions as CLI commands without boilerplate License: copyleft · Maintenance: aging · Downloads: 2.5M/mo ## 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 above — verify before relying. Argh turns plain Python functions into command-line interfaces by wrapping argparse, inferring CLI arguments and types from function signatures and annotations. 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 pip install argh uv add argh poetry add argh ## Installing argh 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. 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) Requires Python 3.8 or later. 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: not declared (copyleft) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 2.5M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags cli from python functions, argparse wrapper, command line interface builder, python function to cli, minimal boilerplate cli, type-driven argument parsing, cli-builder, argparse-wrapper [View on SkillFed](https://skillfed.io/packages/argh) · [View on PyPI](https://pypi.org/project/argh/)