Skip to main content

A cross-platform Python CLI to shortcut tp command-line commands. Inspired by Makefiles and npm scripts.

Project description

rav

A cross-platform Python CLI to shortcut to command-line commands. Inspired by Makefiles and npm scripts.

Install

It's recommended that you use a virtual environment with rav.

python3 -m pip install rav

Minimum python version is 3.7

Start new project

Basic Usage:

cd ~/path/to/project
rav new

Run through the setup wizard to create rav.yaml

or

Manually create rav.yaml

scripts:
    echo: echo hello world

Use:

rav run echo

Manage the Rav project rav.yaml file

The configuration block is flexible. Use rav, scripts, or commands as the top-level key.

rav.yaml

name: rav-in-sixty-seconds

scripts:
    echo: echo "this is awesome"
    server: venv/bin/python -m http.server

Or if on windows:

rav.yaml

name: rav-in-sixty-seconds

scripts:
    echo: echo this is awesome
    win-server: venv\Scripts\python -m http.server

The following all work and will run in this exact order (rav first, scripts second, commands last)

rav:
    echo: echo "this is awesome"
    server: venv/bin/python -m http.server
scripts:
    echo: echo "this is awesome"
    server: venv/bin/python -m http.server
commands:
    echo: echo "this is awesome"
    server: venv/bin/python -m http.server

Basic Syntax

rav run <command>

rav.yaml:

scripts:
    <command>: echo "this is a command"

Basic Example

rav.yaml:

scripts:
    hello: echo hello world!
rav run hello

By default, rav run will look for a rav.yaml file in the current directory. You can customize it, with -f as explained below.

Try the built-in Sample

rav sample

This will output rav.sample.yaml in the current directory.

rav run -f rav.sample.yaml echo

-f is used to specify a custom rav file as documented below.

Run a command

rav run echo

Or

rav run server

Or (if windows):

rav run win-server 8080

Custom Rav File

Rav supports custom yaml files by default. The yaml declaration needs to be any of the following:

  • rav
  • scripts
  • commands

project.yaml

rav:
    sweet: echo "this is working"
    echo: echo "so is this"

rav.basic.yaml

scripts:
    sweet: echo "this is working"
    echo: echo "so is this"
rav run -f project.yaml sweet

or

rav run --file rav.other.yaml echo

Here's a few rules for custom files:

  • -f or --file is used to specify a custom rav file
  • -f or --file must be used prior to the command shortcut name (e.g. rav run -f <your-new-file> <your-command>)

Multiple Commands at Once

rav.yaml

scripts:
    multi: 
        - echo this is
        - echo awesome
        - echo simple
        - echo and 
        - echo easy

Run with:

rav run multi

This is the same as running:

echo this is && echo awesome && echo simple && echo and && echo easy

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

rav-0.0.9.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

rav-0.0.9-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file rav-0.0.9.tar.gz.

File metadata

  • Download URL: rav-0.0.9.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.9

File hashes

Hashes for rav-0.0.9.tar.gz
Algorithm Hash digest
SHA256 ebd4eb7efb620f9ec5016a0d40f27ff28ce69ddfc013c74c44c83d53bf50e9cc
MD5 84f4236df6a801a8003a997b24037766
BLAKE2b-256 9f488f0d257726cfabac975ba73ef7616f45dd2784ebccc120a8865050611212

See more details on using hashes here.

File details

Details for the file rav-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: rav-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.9

File hashes

Hashes for rav-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 5a9429cade688b10ee11321d1c022435b6ac60baa6017c5c636791a4bb2a18c4
MD5 e3e5b17372fc85d6fd2bf5c7ab913092
BLAKE2b-256 8affab9a502d9f8fe3cde5e009caa7c3148d964d9da2f27e53f2020c1d292164

See more details on using hashes here.

Supported by

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