• Python 99.3%
  • Nushell 0.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-17 00:42:34 +02:00
assets 🍱 Update logo 2026-10-17 00:41:02 +02:00
docs 🐛 Fix markdown output 2026-07-24 14:12:40 +02:00
examples 🧑‍💻 Add flag to compiler example 2026-05-15 12:17:45 +02:00
powercli 🐛 Help flag intercepts absence of variadic positionals (fixes #12) 2026-10-16 23:16:22 +02:00
powerdoc 🐛 Fix markdown output 2026-07-24 14:12:40 +02:00
tests 🐛 Help flag intercepts absence of variadic positionals (fixes #12) 2026-10-16 23:16:22 +02:00
.gitignore 🍱 Update logo 2026-10-17 00:41:02 +02:00
.readthedocs.yaml 🔧 Add readthedocs config 2026-05-15 15:28:09 +02:00
CHANGELOG.md 🧑‍💻 Replace GitHub with Codeberg links 2026-10-16 23:24:47 +02:00
CONTRIBUTING.md 🎉 Initial commit 2025-02-26 22:06:24 +01:00
LICENSE.txt 🎉 Initial commit 2025-02-26 22:06:24 +01:00
noxfile.py ⬆️ Upgrade Python dependency 2026-10-16 21:41:21 +02:00
poetry.lock ⬆️ Upgrade Python dependency 2026-10-16 21:41:21 +02:00
pyproject.toml ⬆️ Upgrade Python dependency 2026-10-16 21:41:21 +02:00
README.md 📝 Center new logo 2026-10-17 00:42:34 +02:00
rebuild-docs.nu 🎉 Initial commit 2025-02-26 22:06:24 +01:00

PowerCLI

Build powerful command-line applications in Python 🐍⚡

Preview of help message output Preview of PowerDOC output

Features

  • ✅ Flags, positionals & subcommands
  • 🔧 Highly configurable, flexible API
  • 🔍 Fully typed
  • 🧪 Easy to test
  • 📖 Well documented
  • ❔ Automatic help messages
  • ❕ User-friendly warnings/error reporting

Installation

Poetry

poetry add powercli-python

uv

uv add powercli-python

Manual Installation

Add powercli-python as a dependency in your pyproject.toml file.

dependencies = [
  "powercli-python"
]

Overview

Highly Configurable

Commands and arguments are highly configurable yet provide good defaults to work well out of the box.

import sys
from powercli import Command

cmd = Command(
    # Windows-style flag prefixes
    prefix_short=None,
    prefix_long="/",
    # use other stream
    file=sys.stderr,
)

Object Oriented

Arguments are classes which can be instantiated dynamically and are not directly bound to a parser class.

from pathlib import Path
from powercli import Flag

cmd = Command()

flag = Flag(
    identifier="foo",
    short="f",
    values=[("PATH", Path)],
)
cmd.add_arg(flag)

# ... or use the shorthand ...

cmd.flag(identifier="foo", short="f", values=[("PATH", Path)])

Generate man pages

$ python3 -m powerdoc path/to/file.py --man
$ python3 -m powerdoc path/to/file.py --man | groff -T utf8 -man

Colored output

The built-in provided flags and commands make use of colored output respecting the user's preference.

AI Usage

No AI was used in the creation of this project 🙂.