PYthon Command Line Interface Framework — decorator-driven CLI framework built on click-extra and rich-click
Project description
pyclifer
PYthon Command Line Interface Framework — a decorator-driven CLI framework built on click-extra and rich-click.
pyclifer provides four decorators (@app_group, @group, @command, @option) that give
your CLI applications automatic configuration management, environment variable binding,
Rich-enhanced logging, global option propagation, and standardized output formatting —
with zero boilerplate.
Installation
# pip
pip install pyclifer
# uv
uv add pyclifer
# poetry
poetry add pyclifer
Requires Python 3.10+.
Development
Requires Task.
task install # install dev + docs dependencies
pre-commit install # activate git hooks (ruff check + format on every commit)
task check # lint + test
task test # run test suite
task tox # run tests across Python 3.10–3.13
task release:patch # bump patch version, commit, tag and push
task release:minor
task release:major
Run task --list to see all available tasks.
Quick Start
"""CLI application using pyclifer."""
from pyclifer import app_group, command, option, Response
@app_group(handle_response=True)
def main():
"""My CLI application."""
pass
@main.command()
@option("--name", "-n", default="World", help="Your name")
def hello(name: str) -> Response:
"""Say hello."""
return Response(success=True, message=f"Hello {name}!")
if __name__ == "__main__":
main()
$ python app.py --help
Usage: app.py [OPTIONS] COMMAND [ARGS]...
My CLI application.
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --version Show the version and exit. │
│ --log-file FILE Path to the log file (with │
│ daily automatic rotation). │
│ [env var: MYAPP_LOG_FILE] │
│ -v --verbosity LEVEL Either TRACE, DEBUG, INFO, │
│ WARNING, ERROR, CRITICAL. │
│ [env var: MYAPP_VERBOSITY] │
│ [default: WARNING] │
│ -C --config CONFIG_PATH Configuration file │
│ location. Supports glob │
│ patterns and remote URLs. │
│ [env var: MYAPP_CONFIG] │
│ [default: │
│ /etc/myapp/*.{toml,yaml, │
│ yml,json,ini,xml}, │
│ ~/.config/myapp/*.{toml, │
│ yaml,yml,json,ini,xml}] │
│ -o --output-format [json|yaml|table|rich|raw] Specify the output format │
│ for the command. [env var: │
│ MYAPP_OUTPUT_FORMAT] │
│ [default: table] │
│ -h --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────╮
│ hello Say hello. │
╰──────────────────────────────────────────────────────────────────────────────╯
$ python app.py hello --name Alice
Hello Alice!
$ python app.py hello --help
Usage: app.py hello [OPTIONS]
Say hello.
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ -n --name TEXT Your name [env var: │
│ MYAPP_HELLO_NAME] [default: │
│ World] │
│ -v --verbosity LEVEL Either TRACE, DEBUG, INFO, │
│ WARNING, ERROR, CRITICAL. │
│ [env var: │
│ MYAPP_HELLO_VERBOSITY] │
│ [default: WARNING] │
│ -o --output-format [json|yaml|table|rich|raw] Specify the output format │
│ for the command. [env var: │
│ MYAPP_HELLO_OUTPUT_FORMAT] │
│ [default: table] │
│ -h --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯
Features
- Decorator-driven — four decorators cover the full CLI surface
- Autoconfiguration — TOML/YAML/JSON config files with Linux path conventions (
/etc/<app>/,~/.config/<app>/) - Environment variables — automatic prefix-based binding for every option
- Rich logging — colored output, custom
TRACElevel, secret masking, rotating log files - Standardized output —
Responsedataclass with JSON/YAML/Table/Rich/Raw formatters via--output-format - Global options — options marked
is_global=Truepropagate automatically to all subcommands - Project scaffolding —
pyclifer project initgenerates a ready-to-use project structure
Documentation
Full documentation at bahamut45.github.io/pyclifer.
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyclifer-0.4.1.tar.gz.
File metadata
- Download URL: pyclifer-0.4.1.tar.gz
- Upload date:
- Size: 433.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
043da50b08bd807a70f3f763063e76fe05f377ffd8982048cdcd5153d6bfbdfb
|
|
| MD5 |
c33cc4f2ad18e3f78accc8c58f95a2e5
|
|
| BLAKE2b-256 |
ea695bfdf12014319c95b6bfd59ce0dee44a57b1eaeadb9978ba437251f0c81c
|
Provenance
The following attestation bundles were made for pyclifer-0.4.1.tar.gz:
Publisher:
release.yml on bahamut45/pyclifer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyclifer-0.4.1.tar.gz -
Subject digest:
043da50b08bd807a70f3f763063e76fe05f377ffd8982048cdcd5153d6bfbdfb - Sigstore transparency entry: 1745745157
- Sigstore integration time:
-
Permalink:
bahamut45/pyclifer@f3d9ee1399521b9b1a7a2377729604b011fe2822 -
Branch / Tag:
refs/tags/v0.4.1 - Owner: https://github.com/bahamut45
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f3d9ee1399521b9b1a7a2377729604b011fe2822 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyclifer-0.4.1-py3-none-any.whl.
File metadata
- Download URL: pyclifer-0.4.1-py3-none-any.whl
- Upload date:
- Size: 90.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3cded1326713c95df745b88996590e42160110b7c233edabe0446ad606cd38ec
|
|
| MD5 |
2dc2e64c67e1a389b0421a76fe086012
|
|
| BLAKE2b-256 |
710ca3e09c779a4153be4ebaf9d7dc556a39d195b4f8f8b5bbcc91f118d26b11
|
Provenance
The following attestation bundles were made for pyclifer-0.4.1-py3-none-any.whl:
Publisher:
release.yml on bahamut45/pyclifer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyclifer-0.4.1-py3-none-any.whl -
Subject digest:
3cded1326713c95df745b88996590e42160110b7c233edabe0446ad606cd38ec - Sigstore transparency entry: 1745745223
- Sigstore integration time:
-
Permalink:
bahamut45/pyclifer@f3d9ee1399521b9b1a7a2377729604b011fe2822 -
Branch / Tag:
refs/tags/v0.4.1 - Owner: https://github.com/bahamut45
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f3d9ee1399521b9b1a7a2377729604b011fe2822 -
Trigger Event:
push
-
Statement type: