skillfed

clize

Turn functions into command-line interfaces

clize v5.0.2 207.7K downloads/30d#9,543 on PyPI496
Permissive license MIT DORMANT released

What it is and what it does

Clize is an argument parser that eliminates boilerplate by deriving CLI interfaces directly from Python function definitions. Instead of writing separate argparse code, you define a function with typed parameters and a docstring, pass it to clize.run(), and get a fully functional command-line tool with automatic help text, option parsing, and subcommand support.

The package works by introspecting function signatures to infer positional arguments, optional flags, and keyword arguments, then generates help messages from docstrings. It supports decorators for composing multiple commands and extending parameter behavior. Runtime dependencies are minimal (sigtools, attrs, od, docutils), and it runs on Python 3.6+ across CPython and PyPy.

Use it for:

  • Build a simple CLI tool for a utility function without writing argparse boilerplate.
  • Create multi-command CLI applications using decorators to compose related functions.
  • Generate self-documenting command-line tools where help text comes directly from docstrings.
  • Prototype command-line interfaces quickly during development before committing to a larger framework.
  • Add CLI entry points to existing Python libraries by wrapping functions with clize.run().

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Clize turns Python functions into command-line interfaces automatically, generating argument parsing and help text from function signatures and docstrings instead of requiring manual argparse configuration.

Yes, for stable CLI projects. Clize is production-ready and permissively licensed, with low install friction and no known vulnerabilities. Dormant maintenance is acceptable if you need a simple, proven argument parser and do not require active feature development. Not recommended if you need ongoing support or anticipate heavy customization beyond what decorators provide.

Install

clize on PyPI

pip

pip install clize

uv

uv add clize

poetry

poetry add clize

Installing clize

Before you install

Low install friction with four lightweight runtime dependencies. Dormant maintenance (last commit 2023-11-24, 1132 days ago) but marked Production/Stable; suitable for stable CLI use cases where active development is not expected.

License in practice

MIT license (permissive); you can use, modify, and distribute clize freely in commercial and private projects with minimal restrictions.

Quickstart

pip install clize

from clize import run

def greet(name=None):
    """Greet someone.
    
    :param name: Person to greet
    """
    return f'Hello {name or "world"}!'

if __name__ == '__main__':
    run(greet)

Verify before relying

  • Whether dormant status (no commits since 2023-11-24) poses a risk for future Python version compatibility or security patches.
  • Performance characteristics compared to argparse for large CLI applications with many subcommands.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.6)
Install friction low — pure-Python wheel
Runtime dependencies 4 — sigtools, attrs, od, docutils
Maintenance dormant — 1,132 days since the last release
Last repo commit
First released
Downloads 207,721/month — #9,543 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: clize-5.0.2-py2.py3-none-any.whl

Keywords: CLI, options, arguments, getopts, getopt, argparse, introspection, flags, decorator, subcommands

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersIntended Audience :: System AdministratorsLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software DevelopmentTopic :: Software Development :: Libraries :: Python ModulesTopic :: Software Development :: User Interfaces

Tags

python cli argument parserfunction to command line interfaceautomatic argparse alternativecli from function signaturepython command line decoratorgenerate help from docstringsubcommands decorator
cli-builderargparse-alternativedecorator-based

More Software Development packages