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
Basic Usage:
cd ~/path/to/project
Create rav.yaml
:
scripts:
echo: echo hello world
Use:
rav run echo
Create a rav.yaml
file
The configuration block is flexible. Use rav
, scripts
, or commands
as the top-level key.
rav.yaml
scripts:
echo: echo "this is awesome"
server: venv/bin/python -m http.server
Or if on windows:
rav.yaml
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
Release history Release notifications | RSS feed
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
File details
Details for the file rav-0.0.5.tar.gz
.
File metadata
- Download URL: rav-0.0.5.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ede14acc6e6fb4a3dc729d6d18ac597fa96bd2758e425d1e2d2a0ef2d0bfbac0 |
|
MD5 | 26e963e14f3509604697c76514e85cbc |
|
BLAKE2b-256 | 938b5012ba085c22e0feabc18e1865a039fe9cb17143655ef8434cada475680c |
File details
Details for the file rav-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: rav-0.0.5-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55cbe55c0342ee49d62aa07367d93021c78a96eb7694ad8c63638c7c0a164583 |
|
MD5 | bd4bd16a34cff836642514e1fc75ec69 |
|
BLAKE2b-256 | 1a606b810130d6cf2c04d3641060f231514e1cc5117c9157f1a0e095ce1c3626 |