Skip to main content

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.pyrhythmos-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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rhythmos_cli-0.1.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rhythmos_cli-0.1.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file rhythmos_cli-0.1.0.tar.gz.

File metadata

  • Download URL: rhythmos_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for rhythmos_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 14fb73ecee2081a791fce03d02400ba72be6ed96fd6378814a957d632db66a19
MD5 409a3c9931fa331ffee705369fc83877
BLAKE2b-256 6247b542e7f05f48fb5d007c97aacd608737ae377304ea49ac121c2f52e11ebd

See more details on using hashes here.

File details

Details for the file rhythmos_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: rhythmos_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for rhythmos_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6a650094ef4e43dfacbcdab071fd3a1e21f0522ace9c9ff80f0d4b63fe8fe882
MD5 dc3f7fce0c444487c9d73fffadfa6f27
BLAKE2b-256 c2ed24f1c6985f38204ae44edce5f5fa8bb6e2c7586bd3e3af38258ce595d480

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page