CLI reference#
Cookieplone is invoked as:
cookieplone [TEMPLATE] [EXTRA_CONTEXT]... [OPTIONS]
Or via uvx:
uvx cookieplone [TEMPLATE] [EXTRA_CONTEXT]... [OPTIONS]
Arguments#
TEMPLATE#
Type: string
Default: (empty—prompts you to choose)
The ID of a template in the template repository, as listed under templates in its cookieplone-config.json.
When omitted, Cookieplone displays a menu of available templates.
A template ID selects the template even when it's hidden.
cookieplone project
The argument never names a repository.
Cookieplone takes the repository from COOKIEPLONE_REPOSITORY, or uses cookieplone-templates when that variable isn't set.
An answers file with a __template__ key selects that template instead of this argument.
EXTRA_CONTEXT#
Type: list of
key=valuestringsDefault: (none)
Key/value pairs that set answers for template fields.
Each item must contain exactly one =.
cookieplone project author="Érico Andrei" title="My Site"
Values from EXTRA_CONTEXT take precedence over the answers file, default_context, and template defaults.
In an interactive run, they pre-fill the questions, and the answer you type wins.
See Set answers with extra context.
Options#
-o, --output-dir#
Type: path
Default: current working directory
Directory where the generated project is written.
cookieplone -o ~/projects
--tag, --branch#
Type: string
Default:
main
Git tag or branch of the template repository to use.
When not provided on the command line, the COOKIEPLONE_REPOSITORY_TAG
environment variable is consulted; otherwise the default applies.
When Cookieplone uses both the default template repository and the default branch, and that branch has no cookieplone-config.json, it checks out next instead.
Release tags of cookieplone-templates use the YYYYMMDD.N format.
Setting a tag or branch turns off the fallback to next.
cookieplone --branch next
--no-input#
Type: flag (boolean)
Default:
False
Skip all interactive prompts and use only the values from EXTRA_CONTEXT, the answers file, default_context, and the cookieplone.json defaults.
cookieplone --no-input --answers .cookieplone.json
Cannot be combined with --replay.
-r, --replay#
Type: flag (boolean)
Default:
False
Reuse the most recent Cookiecutter replay file for this template. This is the Cookiecutter-native replay mechanism, distinct from the Cookieplone answers file.
--replay-file#
Type: path
Default: (none)
Load a specific Cookiecutter replay file instead of the most recent one.
cookieplone --replay-file ~/backups/my-replay.json
-s, --skip-if-file-exists#
Type: flag (boolean)
Default:
False
When re-running on an existing project, leave files that already exist untouched. Use this to add only new files without overwriting customised ones.
-f, --overwrite-if-exists#
Type: flag (boolean)
Default:
False
When re-running on an existing project, overwrite files that already exist.
Combine with -s to overwrite only files that are not yet present (-s takes priority per file).
--answers-file, --answers#
Type: path
Default: (none)
Path to a JSON file containing pre-filled answers.
The __template__ key in the file, if present, selects the template automatically.
cookieplone --answers .cookieplone.json
See Use an answers file for the file format.
--config-file#
Type: path
Default: (see Configuration reference)
Path to a Cookieplone configuration file. Overrides the default config file search order.
cookieplone --config-file ~/.my-cookieplone.yaml
--default-config#
Type: flag (boolean)
Default:
False
Ignore all user configuration files and use built-in defaults only.
--keep-project-on-failure#
Type: flag (boolean)
Default:
False
Keep the partially generated project directory if a hook script fails. Useful for diagnosing hook errors.
--debug-file#
Type: path
Default: (none)
Write DEBUG-level log output to the specified file in addition to the console.
cookieplone --debug-file cookieplone-debug.log
-a, --all#
Type: flag (boolean)
Default:
False
Include hidden templates in the template selection menu.
By default, templates and groups marked "hidden": true in the repository's cookieplone-config.json are not shown.
cookieplone --all
-v, --verbose#
Type: flag (boolean)
Default:
False
Print DEBUG-level log messages to the console.
--info#
Type: flag (boolean)
Default:
False
Display the resolved repository URL, tag, and password status, then exit.
--version#
Type: flag (boolean)
Default:
False
Display the installed Cookieplone version, then exit.
Environment variables#
Several options can be set through environment variables. See Environment variables reference for the full list.