Skip to main content

Poetry plugin for simple custom user commands execution.

Project description

Poetry Command Aliases Plugin

This plugin allows you to define aliases or shortcuts for commonly used commands in your Poetry projects. It simplifies command execution by providing custom aliases for complex or frequently used commands.

Usage

  1. Installation:

    Install the plugin using Poetry:

    pip install poetry-plugin-commands
    

    or

    pip install --user poetry-plugin-commands
    

    or at least

    poetry self add poetry-plugin-commands
    
  2. Define Aliases:

    Add your aliases to the pyproject.toml file under the [tool.poetry-plugin-commands] section:

    [tool.poetry-plugin-commands]
    stree = "tree src"
    test_var = "echo $VAR"
    run_app = "PYTHONPATH=src:. poetry run python src/app_launch/main.py"
    

    Here, stree, test_var, and run_app are the custom aliases, and their corresponding commands are specified.

  3. Execute Commands:

    Now you can use the defined aliases with Poetry:

    poetry stree
    
    poetry test_var
    
    poetry run_app
    

    These commands will execute the respective commands defined as aliases.

  4. List Available Commands:

    To get a list of available aliases along with their corresponding commands, run:

    poetry user-commands
    

    This will display a list of aliases and their associated commands:

    stree -> `tree src`
    test_var -> `echo $VAR`
    run_app -> `PYTHONPATH=src:. poetry run python src/app_launch/main.py`
    

Contributing

Feel free to contribute to this plugin by reporting issues, suggesting features, or submitting pull requests on GitHub.

License

This plugin is licensed under the Apache 2. License. See the LICENSE file for details.

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

poetry_plugin_commands-0.0.9.tar.gz (7.7 kB view hashes)

Uploaded Source

Built Distribution

poetry_plugin_commands-0.0.9-py3-none-any.whl (8.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page