PyRunner
A lightweight, cross-platform script runner inspired by npm scripts. Store reusable commands in scripts.json files and execute them by name from anywhere.
PyRunner supports both local and global script collections with automatic priority handling.
Installation
Via pip (Recommended)
pip install pyrunner-cli
Once installed, the pyr command will be available everywhere in your terminal:
pyr --help
pyr list
pyr build
From Source
git clone https://github.com/AbdullahAhmad-0/PyRunner.git
cd PyRunner
pip install -e .
Or run directly without installing:
- Windows: Use
pyr.bat <script> - Linux/macOS: Use
./pyr <script>
Manual PATH Setup (Without pip)
Windows (Using Batch File)
PyRunner includes a pyr.bat file so you can use pyr directly:
- Place
pyr.batandrunner.pyin the same directory. - Add that directory to your system's PATH environment variable.
- Open a new terminal.
Now you can run PyRunner from any location:
pyr build
pyr list
Linux / macOS (Using Shell Script)
PyRunner includes a pyr shell script:
- Make the script executable:
chmod +x pyr
- Move it to a directory in your
PATH(such as/usr/local/binon Linux/Intel Macs or/opt/homebrew/binon Apple Silicon Macs):sudo mv pyr /usr/local/bin/
Note: Ensure
runner.pyremains in the same directory as thepyrscript if not installed via pip.
Features
- 🚀 Run scripts by name (
pyr <name>) - 📁 Local and global script collections
- 🔍 Automatic script lookup
- ⭐ Local scripts take priority over global scripts
- 📋 List available local and global scripts (
pyr list) - 📄 Use a custom
scripts.jsonfile - 💻 Cross-platform (Windows, Linux, macOS)
- ⚡ No external dependencies
Script Locations
PyRunner supports three sources of scripts.
Local Scripts
Located in the current working directory.
project/
│
├── scripts.json
└── ...
These scripts are intended for a single project.
Global Scripts
Stored in ~/.pyrunner/scripts.json (or next to the PyRunner executable in scripts/scripts.json).
~/.pyrunner/
└── scripts.json
These scripts are available from every directory.
Custom Script File
You may specify any scripts.json file:
pyr --file D:/Configs/scripts.json build
Configuration
Example scripts.json:
{
"scripts": {
"start": "python app.py",
"build": "python build.py",
"clean": "python clean.py",
"test": "pytest"
}
}
Running Scripts
Automatic Mode (Default)
pyr build
Search order:
- Local
scripts.json - Global
scripts/scripts.json(or~/.pyrunner/scripts.json)
If a script exists in both locations, the local script is executed.
If one of the configuration files doesn't exist, it is simply ignored.
Local Only
pyr --local build
or
pyr -l build
Only the local scripts.json is searched.
Global scripts are ignored.
Global Only
pyr --global build
or
pyr -g build
Only the global scripts are searched.
Local scripts are ignored.
Custom Configuration
pyr --file ./configs/scripts.json build
Only the specified configuration file is used.
Listing Scripts
Display every available script:
pyr list
Example:
Local Scripts
-------------
build python build.py
clean python clean.py
start python app.py
Global Scripts
--------------
git-clean git clean -fd
update winget upgrade --all
serve python -m http.server
Missing configuration files are skipped automatically.
List Local Scripts
pyr list --local
List Global Scripts
pyr list --global
List Custom File
pyr list --file ./configs/scripts.json
Priority Rules
Default behavior:
Local Script
↓
Global Script
Example:
Local:
{
"scripts": {
"build": "python build.py"
}
}
Global:
{
"scripts": {
"build": "docker compose build"
}
}
Running:
pyr build
executes:
python build.py
because local scripts always have higher priority.
Help
pyr --help
Displays every available command and option.
Future Features
init— Create a newscripts.jsonadd— Add a script from the command lineremove— Remove a scriptedit— Open the configuration in your editordoctor— Validate configuration filesaliases- Environment variables
- Sequential execution
- Parallel execution
- Colored output
- Shell auto-completion
- YAML and TOML support
Contributing
Issues and pull requests are welcome! Feel free to visit the GitHub repository: https://github.com/AbdullahAhmad-0/PyRunner
License
MIT License. See LICENSE for details.
Metadata
Release files for pyrunner-cli 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyrunner_cli-0.1.0.tar.gz | 8.1 kB | Without provenance | Details for pyrunner_cli-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyrunner_cli-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for pyrunner_cli-0.1.0-py3-none-any.whl |
Total release size: 15.5 kB
Release files / pyrunner_cli-0.1.0.tar.gz
| Download URL | pyrunner_cli-0.1.0.tar.gz |
|---|---|
| Size | 8.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2ecbdeaccbac5adc196cb5a228f266cfa9002ef16ccd693cde3cb7c51e187dcd
|
|
BLAKE2b-256 checksum How to use checksums |
79d46042593010b81001da05ae7cbcb40d608e702d104d31ed2a8252770723bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|
Release files / pyrunner_cli-0.1.0-py3-none-any.whl
| Download URL | pyrunner_cli-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1ee914ce6a06f63572e04af68d5e798fc186de06600f7dfac13fa263c23d4b6c
|
|
BLAKE2b-256 checksum How to use checksums |
50ea30ebcc51d9bf3be49421c68d62fcc3a7f66b3843ba8d8fe4c2b6b36f94d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|
Security for pyrunner-cli 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.