A simple CLI utility for generating formatted text headers with borders and boxes.
- Python ≥ 3.9
Run with a positional argument:
$ hfmt "project title"
################################## project title ###################################Run with flags:
$ hfmt --head "build complete" --style multi --char "=" --width 60 --upper --align left
============================================================
= BUILD COMPLETE
============================================================$ hfmt --border-only --width 50
##################################################Run with box mode:
$ hfmt --title --width auto --box double "welcome back"
╔══════════════╗
║ Welcome Back ║
╚══════════════╝hfmt-cli supports the following value flags:
| Flag | Description | Default |
|---|---|---|
head (positional) |
Header text | — |
-H, --head |
Header text (alternative flag form) | — |
-s, --style |
Border style (single, multi) |
single |
-c, --char |
Character to use for the border | # |
-w, --width |
Width of the rows | 84 or auto |
-a, --align |
Header justification | center or left |
-b, --box |
Surround header by a box (overrides other flags) | none |
hfmt-cli supports the following value toggles:
| Toggle | Description |
|---|---|
-U, --upper |
Converts header to "UPPER_CASE" |
-L, --lower |
Converts header to "lower_case" |
-T, --title |
Converts header to "Title_Case" |
-S, --swapcase |
Converts header to "sWAP_cASE" |
--border-only |
Returns only a border of characters with no header |
Install via pipx (recommended)
pipx install hfmt-cliInstall via pip:
pip install hfmt-cli