cliss — Lightweight framework for building CLI applications
Write type-annotated Python functions, get a full CLI — automatic --help, validation, async support, and zero dependencies.
🚀 Quick Start
pip install cliss # Python 3.10+
from cliss import Cliss
cli = Cliss(name="todo", description="Task manager", version="1.0.0")
@cli.command()
def add(task: str, priority: int = 1, done: bool = False):
"""Add a task."""
status = "✓" if done else "○"
return f"[{status}] {task} (priority: {priority})"
@cli.command()
def list_all():
"""Show all tasks."""
return "Nothing yet!"
cli()
$ python todo.py add "Buy milk" --priority 2
[○] Buy milk (priority: 2)
$ python todo.py list-all
Nothing yet!
$ python todo.py --help
Usage: todo [COMMAND] [OPTIONS] [ARGS]...
Task manager
Commands:
add Add a task.
list-all Show all tasks.
Options:
-V, --version Print version info and exit
-h, --help Print help
📋 Commands & Features
@cli.command() — Define commands from functions
@cli.command()
def fetch(url: str, retries: int = 3):
"""Download from URL with retries"""
return f"Fetched {url} (retries: {retries})"
@cli.argument() — Customize argument flags
Use @cli.argument() above @cli.command() to customize flags, help text, and behavior for individual parameters.
@cli.argument("-v", "--verbose", help="Enable verbose output")
@cli.argument("-r", "--retries", type=int, help="Number of retries")
@cli.command()
def fetch(url: str, verbose: bool = False, retries: int = 3):
"""Download from URL"""
return f"Fetched {url} (retries: {retries})"
Type → CLI mapping
| Function signature | CLI argument |
|---|---|
name: str |
Positional name |
count: int = 1 |
--count (default: 1) |
verbose: bool = False |
--verbose / --no-verbose |
mode: str = None |
--mode (default: None) |
Boolean flag behavior
| Function signature | Help display | Usage |
|---|---|---|
flag: bool |
--flag, --no-flag (required) |
--flag or --no-flag |
flag: bool = False |
--flag (default: disabled) |
--flag enables, --no-flag also works |
flag: bool = True |
--no-flag (default: enabled) |
--no-flag disables, --flag also works |
Command groups
remote = cli.group("remote", "Manage remotes")
@remote.command()
def add(name: str, url: str):
return f"Added remote {name}"
Async support
@cli.command()
async def fetch(url: str, retries: int = 3):
return f"Fetched {url} (retries: {retries})"
🎨 CLI Configuration
cli = Cliss(
name="myapp", # Program name in help
description="Does amazing things", # Description in help
version="2.0.0", # Adds --version flag
color=False, # Disable ANSI colours
)
| Option | Description |
|---|---|
name |
Program name in help |
description |
Description in help |
version |
Adds --version flag |
usage |
Custom usage string |
color |
Enable/disable ANSI colours (default: True) |
Disable colours via environment
NO_COLOR=1 python myapp.py --help
📄 License & Acknowledgments
LGPLv3 License — Built with pure Python standard library:
| Module | Purpose |
|---|---|
sys |
Argument parsing |
asyncio |
Async command execution |
inspect |
Signature introspection |
Author: Fkernel653 Project: GitHub • PyPI
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cliss-1.2.4.2.tar.gz
(13.9 kB
view details)
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
cliss-1.2.4.2-py3-none-any.whl
(18.0 kB
view details)
File details
Details for the file cliss-1.2.4.2.tar.gz.
File metadata
- Download URL: cliss-1.2.4.2.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ee6e9afe56fe1027d1807865cc741759014c8cdaf991e0b1e866078bbd87610
|
|
| MD5 |
5bb9a8ee94675768b9cabfa14c700a50
|
|
| BLAKE2b-256 |
3ee29c4630a467665deb2317fa0b1cc94fc458db7d9799bae2805ab65063872e
|
File details
Details for the file cliss-1.2.4.2-py3-none-any.whl.
File metadata
- Download URL: cliss-1.2.4.2-py3-none-any.whl
- Upload date:
- Size: 18.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
452dc9f5917e8b3dece8948abf95e23d94e9a44213b7d468704274b908f55504
|
|
| MD5 |
d50e73398656162c3345507bd8d09736
|
|
| BLAKE2b-256 |
5e1b15d1c4ace5a1fc91b88e4375656ac96ea82c4275a61c339d24fce1384b20
|