Rhythmos CLI
A lightweight CLI framework. Install once, put commands in each project's commands/ folder.
Install
pip install rhythmos-cli
Usage
In any project:
rhythmos-cli make hello -d "Say hello to someone"
# edit commands/hello.py
rhythmos-cli hello Alice
rhythmos is an optional shorthand for the same CLI.
make and list are built-in system commands. If you define a user command with the same name, yours wins and a warning is printed.
Commands are loaded from ./commands (cwd), or from RHYTHMOS_COMMANDS if set.
Write a command
from rhythmos import BaseCommand
class HelloCommand(BaseCommand):
def get_description(self):
return "Say hello to someone"
def add_arguments(self):
self.parser.add_argument("name", help="Name of the person to greet")
def handle(self, name):
print(f"Hello, {name}!")
File commands/foo_bar.py → rhythmos-cli foo-bar.
See examples/commands/hello.py for a ready example.
Develop this package
python -m venv .venv
source .venv/bin/activate
pip install -e .
RHYTHMOS_COMMANDS=examples/commands rhythmos-cli hello World
Release (GitLab CI)
Publishes to PyPI when you push a version tag matching the version in pyproject.toml.
git tag v0.1.1
git push origin v0.1.1
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 rhythmos_cli-26.8.2.tar.gz.
File metadata
- Download URL: rhythmos_cli-26.8.2.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28902d98959b87caf3f88bbd9c9c50341ea29342fd6041ccfc5aca688c84b630
|
|
| MD5 |
6f7dec0ac4c7c59d0881a66445d9f61e
|
|
| BLAKE2b-256 |
6e88771f41768cf38ad8d582da7cb6fa3a243270cedf5f841591b095a45e252f
|
File details
Details for the file rhythmos_cli-26.8.2-py3-none-any.whl.
File metadata
- Download URL: rhythmos_cli-26.8.2-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6cbd47b56853064a3e642cadfb96046b3ca25dec81cc98f57eac79fb8b161af
|
|
| MD5 |
5569a67dc5cbb14b792311bd0eb07d5e
|
|
| BLAKE2b-256 |
6e536fe798426fe56746ab3aa7ce805adc2b4b1efc952af7e234b3710eb3237c
|