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 name of a template within the resolved template repository. When omitted, Cookieplone displays a menu of available templates.

cookieplone project

If COOKIEPLONE_REPOSITORY is set, the value refers to a template within that repository.

EXTRA_CONTEXT#

  • Type: list of key=value strings

  • Default: (none)

Key/value pairs that override individual template fields. Each item must contain exactly one =.

cookieplone project author_name="Érico Andrei" project_title="My Site"

Values from EXTRA_CONTEXT take precedence over the answers file and template defaults.

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. Overridden by the COOKIEPLONE_REPOSITORY_TAG environment variable.

cookieplone --tag 2024.10.1

--no-input#

  • Type: flag (boolean)

  • Default: False

Skip all interactive prompts and use only the values from cookieplone.json defaults, the answers file, and EXTRA_CONTEXT.

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 or YAML 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#

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 marked "hidden": true in the repository's root cookiecutter.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.