An extendable file generator
Install via pip:
pip install geny
After installation, the CLI will expose the binary with the name:
geny
Currently, there are two main ways of extending the functionality of the CLI:
- Adding your own commands/plugins
- Overriding the provided resource templates
If you would like to extend the functionality of this CLI, you can include your own plugins/commands
by
setting an environment variable: GENY_PLUGINS
. Simply set this variable to the path where your plugins are.
Plugin commands are auto-discovered if they are placed under the plugins directory, but please be sure to do the following for this to work:
- Name your package and click command the same. That is, a package called
get
, for example, should define aget
command. - Place the command definition within the package's
main.py
module. For example:
# get/main.py
import click
@click.command()
@click.pass_context
def get(ctx):
pass
- Sub-commands should be added to the top-most command group in the package's
main.py
module.
# get/main.py
import click
@click.group() # <- group
@click.pass_context
def get(ctx):
pass
@click.command()
@click.pass_context
def foo(ctx):
pass
get.add_command(foo)
- Access your commands via your top-most command group.
geny get foo
NOTE: If you would like to skip a plugin/command from being auto-discovered, simply rename the package by either
prepending or appending any number of underscores (_
). Any code contained within the package will be ignored.
The flag --templates-dir
can be used to configure an additional path wherein the CLI can look for resource templates.
Alternatively, you can use the environment variable GENY_TEMPLATES_DIR
for the same purpose.
git clone https://github.com/oleoneto/geny.git
cd geny
pip install --editable .
Check out pyproject.toml for all installation dependencies.
Found a bug? See a typo? Have an idea for new command? Feel free to submit a pull request with your contributions. They are much welcome and appreciated.
geny is BSD Licensed.