A Small CLI tool for running custom cli commands with shortcuts. Pythonic version of npm scripts
Project description
Python CLI Tool
A command-line interface (CLI) tool written in Python for executing commands defined in a plz.yml file.
Features
- Execute commands defined in a
plz.ymlfile - Customizable command names and corresponding shell commands
- Utilizes the
richlibrary for enhanced console output - Built with
typerfor easy and intuitive CLI creation
Installation
- Install package:
pip install please-do
Usage
- Create a
plz.ymlfile in the current working directory with the following format:
commands:
- name: dev
command: uvicorn main:app --reload # Sample for fastapi project
- name: test
command: pytest tests/
- Run the CLI tool with the desired command name:
please run dev
As an alias you can use plz command
plz run dev
This will execute the corresponding command defined in the plz.yml file.
Configuration
The plz.yml file should be placed in the current working directory and follow this structure:
commands:
- name: command_name
command: shell_command
command_name: The name you want to use to invoke the commandshell_command: The actual shell command to be executed
You can define multiple commands in the plz.yml file.
Error Handling
- If the
plz.ymlfile is not found, an error message will be displayed, and the program will exit with a non-zero status code. - If a command is not found in the
plz.ymlfile, an error message will be displayed, and the program will exit with a non-zero status code. - If a command fails to execute due to a
FileNotFoundError, an error message will be displayed, and the program will exit with a non-zero status code.
Dependencies
- Python 3.6+
typerrichpyyaml
Contributing
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
License
This project is licensed under the MIT License.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file please_do-0.1.0.tar.gz.
File metadata
- Download URL: please_do-0.1.0.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.10.12 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae981defb58ab35e2093392189998dc078e80b7e67f3021e9c88843af81ac8bd
|
|
| MD5 |
29087bea200b5efba9b818e304b35469
|
|
| BLAKE2b-256 |
8c40680b25df2054d95555fa7c1fd2b7019b88d0b0f9f970d1b1b924b8caf8f6
|
File details
Details for the file please_do-0.1.0-py3-none-any.whl.
File metadata
- Download URL: please_do-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.10.12 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9f362731b31cc9b8e4c5e04482d619724f23649db82fb4e811761ae7330a408
|
|
| MD5 |
cb5334dcf646741c7f7ec288475560ec
|
|
| BLAKE2b-256 |
1fa86375681321df8bc0b4ca0c315a07ebb63585e807e4010419bbd4f1fee26d
|