alexanderlukanin13 / coolname

Random Name and Slug Generator
BSD 2-Clause "Simplified" License
140 stars 12 forks source link

Add CLI functionality #13

Closed matthewfeickert closed 1 year ago

matthewfeickert commented 1 year ago

:wave: Hi. Thanks for making coolname! It is one of my favorite tools for making human readable workflow slugs. A feature request would be to add command line functionality, so that you could have something like

$ coolname generate-slug -n 2  # accomplished-cheetah

which would basically be the same as calling

$ python -c 'from coolname import generate_slug; print(generate_slug(2))'

This would also be nice as then people could get it as a global CLI tool with pipx. :sparkles:

alexanderlukanin13 commented 1 year ago

Hi Matthew! Please try coolname 2.0.0, it should work in command line and support installation via pipx.

$ coolname
macho-burgundy-bittern-of-pizza

You can check additional options via --help.

matthewfeickert commented 1 year ago

Fantastic! Thanks. :)

$ pipx install coolname
  installed package coolname 2.0.0, installed using Python 3.10.4
  These apps are now globally available
    - coolname
done! ✨ 🌟 ✨
~                                                                                                                                                                              py base 3.10.4
$ coolname --help
usage: coolname [-h] [-s SEPARATOR] [-n NUMBER] [{2,3,4}]

Generate slug to stdout

positional arguments:
  {2,3,4}

options:
  -h, --help            show this help message and exit
  -s SEPARATOR, --separator SEPARATOR
  -n NUMBER, --number NUMBER
                        how many slugs to generate (default: 1)                                                                                                                                                                              
$ coolname
meek-nocturnal-mussel-from-heaven