Skip to main content

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.

Metadata

Release files for please-do 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for please-do 0.1.0
File Size Uploaded
please_do-0.1.0.tar.gz 2.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for please-do 0.1.0
File Interpreter ABI Platform
please_do-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 5.6 kB

Release files / please_do-0.1.0.tar.gz

Download URL please_do-0.1.0.tar.gz
Size 2.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ae981defb58ab35e2093392189998dc078e80b7e67f3021e9c88843af81ac8bd
BLAKE2b-256 checksum
How to use checksums
8c40680b25df2054d95555fa7c1fd2b7019b88d0b0f9f970d1b1b924b8caf8f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.10.12 Windows/10

Release files / please_do-0.1.0-py3-none-any.whl

Download URL please_do-0.1.0-py3-none-any.whl
Size 3.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a9f362731b31cc9b8e4c5e04482d619724f23649db82fb4e811761ae7330a408
BLAKE2b-256 checksum
How to use checksums
1fa86375681321df8bc0b4ca0c315a07ebb63585e807e4010419bbd4f1fee26d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.10.12 Windows/10

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page