Command Line Interface#
Prept being a CLI tool provides a collection of commands to manage and generate from boilerplates. These commands are documented here.
prept#
CLI tool for managing and generating boilerplates.
prept [OPTIONS] COMMAND [ARGS]...
info#
Shows information about a boilerplate.
BOILERPLATE is either path to a boilerplate directory (containing preptconfig.json) or name of an installed boilerplate.
prept info [OPTIONS] BOILERPLATE
Arguments
- BOILERPLATE#
Required argument
init#
Initiailize a boilerplate in the current working directory.
This command simply creates a preptconfig.json configuration file in the working directory.
NAME is the boilerplate name and must pass following set of rules:
Consists of alphanumeric, hyphens, and underscores characters.
Must begin with a letter or underscore.
Names are not case-sensitive.
prept init [OPTIONS] NAME
Arguments
- NAME#
Required argument
install#
Installs a boilerplate globally.
Global installations allow generation from boilerplates directly using prept new BOILERPLATE using boilerplate name instead of having to pass paths.
BOILERPLATE can be a path to a valid boilerplate directory (containing preptconfig.json) that is to be installed. If current working directory is the boilerplate template, use the “prept install .” command.
It is also possible to install boilerplates through Git by passing a repository URL with “git+” suffix. Git must be installed and on PATH for this mode of installation.
Examples:
prept install ./basic-boilerplate (install from path)
prept install git+https://github.com/user/repo.git (install from git)
prept install [OPTIONS] BOILERPLATE
Arguments
- BOILERPLATE#
Required argument
list#
Show the list of installed boilerplates.
prept list [OPTIONS]
new#
Bootstrap project from a boilerplate.
BOILERPLATE is the name or path of boilerplate (containing preptconfig.json) to generate the project from.
prept new [OPTIONS] BOILERPLATE
Options
- -O, --output <output>#
The output directory in which the generated files are put into.
This defaults to default_generate_directory in preptconfig.json if set otherwise the name of boilerplate is used as default. If the directory does not exist, it is created by Prept.
- -V, --var <var>#
The name/value pair of template variables in “-V <name> <value>” format.
This takes variables corresponding to
template_variablessetting in preptconfig.json. If some variables are not provided through this option, input for them is prompted when command is ran.If allow_extra_variables setting is set to true in configuration, this option allows passing variables that are not defined in template variables. If setting is false (default), this causes an error to be thrown.
Arguments
- BOILERPLATE#
Required argument
uninstall#
Uninstalls a boilerplate.
BOILERPLATE is the name of a globally installed boilerplate.
prept uninstall [OPTIONS] BOILERPLATE
Arguments
- BOILERPLATE#
Required argument