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

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

rhythmos_cli-26.8.2.tar.gz (5.1 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-26.8.2-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

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

Hashes for rhythmos_cli-26.8.2.tar.gz
Algorithm Hash digest
SHA256 28902d98959b87caf3f88bbd9c9c50341ea29342fd6041ccfc5aca688c84b630
MD5 6f7dec0ac4c7c59d0881a66445d9f61e
BLAKE2b-256 6e88771f41768cf38ad8d582da7cb6fa3a243270cedf5f841591b095a45e252f

See more details on using hashes here.

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

Hashes for rhythmos_cli-26.8.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a6cbd47b56853064a3e642cadfb96046b3ca25dec81cc98f57eac79fb8b161af
MD5 5569a67dc5cbb14b792311bd0eb07d5e
BLAKE2b-256 6e536fe798426fe56746ab3aa7ce805adc2b4b1efc952af7e234b3710eb3237c

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