alexanderlukanin13 / coolname

Random Name and Slug Generator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add CLI functionality

matthewfeickert opened this issue Β· comments

πŸ‘‹ 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. ✨

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.

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