Skip to main content

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.yml file
  • Customizable command names and corresponding shell commands
  • Utilizes the rich library for enhanced console output
  • Built with typer for easy and intuitive CLI creation

Installation

  1. Install package:
pip install please-do

Usage

  1. Create a plz.yml file 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/
  1. 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 command
  • shell_command: The actual shell command to be executed

You can define multiple commands in the plz.yml file.

Error Handling

  • If the plz.yml file 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.yml file, 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+
  • typer
  • rich
  • pyyaml

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


Download files

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

Source Distribution

please_do-0.1.0.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

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

please_do-0.1.0-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

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

Hashes for please_do-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ae981defb58ab35e2093392189998dc078e80b7e67f3021e9c88843af81ac8bd
MD5 29087bea200b5efba9b818e304b35469
BLAKE2b-256 8c40680b25df2054d95555fa7c1fd2b7019b88d0b0f9f970d1b1b924b8caf8f6

See more details on using hashes here.

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

Hashes for please_do-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a9f362731b31cc9b8e4c5e04482d619724f23649db82fb4e811761ae7330a408
MD5 cb5334dcf646741c7f7ec288475560ec
BLAKE2b-256 1fa86375681321df8bc0b4ca0c315a07ebb63585e807e4010419bbd4f1fee26d

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