zmoog / public-notes

Apache License 2.0
0 stars 1 forks source link

Bootstrap a new CLI tool #24

Closed zmoog closed 1 year ago

zmoog commented 1 year ago

I plan to use the Simon Willison's click-app cookie cutter template.

Requirements

Install cookiecutter:

pipx install cookiecutter

Usage

$ cookiecutter gh:simonw/click-app
You've downloaded /Users/zmoog/.cookiecutters/click-app before. Is it okay to delete and re-download it? [yes]:
app_name []: eventhubs-cli
description []: CLI tool to send and receive event data from Azure Event Hubs
hyphenated [eventhubs-cli]:
underscored [eventhubs_cli]:
github_username []: zmoog
author_name []: Maurizio Branca

Developing your command-line tool

cd my-new-tool
# Create and activate a virtual environment:
python3 -m venv venv
source venv/bin/activate
# Install dependencies so you can edit the project:
pip install -e '.[test]'
# With zsh you have to run this again for some reason:
source venv/bin/activate
# Confirm your tool can be run from the command-line
my-new-tool --version

Next

For additional info about creating a Git repo and publish the package on PyPI, read on at https://github.com/simonw/click-app