Skip to main content

CLI runner for Rhylthyme real-time program schedules

Project description

Rhylthyme CLI Runner

Command-line interface for validating and running Rhylthyme real-time program schedules.

Installation

From Source

# Clone the repository
git clone https://github.com/rhylthyme/rhylthyme-cli-runner.git
cd rhylthyme-cli-runner

# Install the package
pip install -e .

# Or install with development dependencies
pip install -e ".[dev]"

From PyPI

pip install rhylthyme-cli-runner

Quick Start

The Rhylthyme CLI provides commands for working with real-time program schedules defined using the Rhylthyme JSON or YAML schema.

Validate a Program

Validate a program file against the schema to ensure it's properly formatted:

# Validate a JSON or YAML program file
rhylthyme validate my_program.json

# Validate with verbose output
rhylthyme validate my_program.json --verbose

# Validate with JSON output for CI/scripting
rhylthyme validate my_program.json --json

# Validate in strict mode (requires all tasks in resourceConstraints)
rhylthyme validate my_program.json --strict

Run a Program

Run a program with an interactive terminal UI for monitoring and controlling execution:

# Run a program file
rhylthyme run examples/breakfast_schedule.json

# Run with automatic start (no manual trigger needed)
rhylthyme run examples/breakfast_schedule.json --auto-start

# Run with a different time scale (2x faster)
rhylthyme run examples/breakfast_schedule.json --time-scale 2.0

# Run with a specific environment
rhylthyme run examples/breakfast_schedule.json --environment kitchen

# Run without validation (if you're sure the file is valid)
rhylthyme run examples/breakfast_schedule.json --no-validate

Optimize a Program

Create an optimized version of a program to reduce resource contention:

# Optimize a program and save to new file
rhylthyme plan examples/breakfast_schedule.json optimized_breakfast.json

# Optimize with verbose output
rhylthyme plan examples/breakfast_schedule.json optimized_breakfast.json --verbose

Work with Environments

List and validate environment catalogs:

# List all available environments
rhylthyme environments

# List environments in JSON format
rhylthyme environments --format json

# Validate all environment files
rhylthyme validate-environments

# Show information about a specific environment type
rhylthyme environment-info kitchen

Program File Examples

Simple Breakfast Schedule

{
  "programId": "breakfast-schedule",
  "name": "Breakfast Schedule",
  "description": "Coordinated breakfast preparation",
  "environmentType": "kitchen",
  "startTrigger": {
    "type": "manual"
  },
  "tracks": [
    {
      "trackId": "eggs",
      "name": "Scrambled Eggs",
      "steps": [
        {
          "stepId": "crack-eggs",
          "name": "Crack and Whisk Eggs",
          "startTrigger": {
            "type": "programStart"
          },
          "duration": {
            "type": "fixed",
            "seconds": 60
          }
        }
      ]
    }
  ],
  "resourceConstraints": [
    {
      "task": "stove-burner",
      "maxConcurrent": 2,
      "description": "Maximum stove burners"
    }
  ],
  "version": "1.0.0"
}

Interactive UI Controls

When running a program, the interactive UI provides these controls:

  • Space: Start/stop the program
  • Enter: Trigger manual steps
  • Arrow keys: Navigate between steps
  • q: Quit the program
  • r: Refresh the display
  • s: Sort by different criteria

Command Reference

rhylthyme validate

Validates program files against the schema.

Options:

  • --schema PATH: Path to schema file (default: built-in schema)
  • --verbose, -v: Show detailed validation information

rhylthyme run

Runs programs with interactive terminal UI.

Options:

  • --schema PATH: Path to schema file (default: built-in schema)
  • -e, --environment TEXT: Environment ID to use
  • --time-scale FLOAT: Time scale factor (default: 1.0)
  • --validate / --no-validate: Validate before running (default: True)
  • --auto-start: Automatically start without manual trigger

rhylthyme plan

Optimizes program schedules to reduce resource contention.

Options:

  • --verbose, -v: Show detailed planning information

rhylthyme environments

Lists available environment catalogs.

Options:

  • --format, -f: Output format (table, json, yaml)

rhylthyme validate-environments

Validates environment catalog files.

Options:

  • --environments-dir PATH: Directory containing environment files
  • --verbose, -v: Show detailed validation information

rhylthyme environment-info

Shows information about a specific environment type.

Development

  1. Clone the repository
  2. Install development dependencies: pip install -e ".[dev]"
  3. Run tests: pytest

License

Apache License 2.0

Project details


Download files

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

Source Distribution

rhylthyme_cli_runner-0.1.2a0.tar.gz (60.0 kB view details)

Uploaded Source

Built Distribution

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

rhylthyme_cli_runner-0.1.2a0-py3-none-any.whl (52.2 kB view details)

Uploaded Python 3

File details

Details for the file rhylthyme_cli_runner-0.1.2a0.tar.gz.

File metadata

  • Download URL: rhylthyme_cli_runner-0.1.2a0.tar.gz
  • Upload date:
  • Size: 60.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.15

File hashes

Hashes for rhylthyme_cli_runner-0.1.2a0.tar.gz
Algorithm Hash digest
SHA256 1f0b84e5514b2ef20c729b19e82aa0a2f5ea304155382f74a60c6ad060c421dc
MD5 d7ac2b83c1141f478e3518df73c47e57
BLAKE2b-256 35e70bc93fd6ed95fb4830790357ac20fbf3b21c03f56fc1cef5c4f305113e82

See more details on using hashes here.

File details

Details for the file rhylthyme_cli_runner-0.1.2a0-py3-none-any.whl.

File metadata

File hashes

Hashes for rhylthyme_cli_runner-0.1.2a0-py3-none-any.whl
Algorithm Hash digest
SHA256 6804523cb665c0475001b203cfeb52fb7e761f3a83904e125acf0064dff1f1e1
MD5 749054902ef9396dc9faa46595af57e0
BLAKE2b-256 462bcfb73664a8fea2e83f07e11cb0760d21bc77bcfa63df38202313ec5116bb

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