Skip to content

Template Management

Working with Templates

Templates define the structure and configuration of your projects. PyPortion provides built-in templates and supports custom templates.

List Available Templates

View all templates currently available on your system:

portion template list

PyPortion Official Templates

It makes sense that you start without any templates. PyPortion provides a set of official templates maintained by the team that you can download and use right away.

Template Description URL
cli-template A ready-to-use structure for building Python CLI applications https://github.com/Atharabia/cli-template

View all official templates here

Download a Template

Download a template from a remote repository:

portion template download <template-url> [version]

Replace <template-url> with the URL of the template repository. The optional [version] argument pins a specific branch or tag — omitting it downloads the latest version as declared in the template's .pyportion.yml:

portion template download https://github.com/Atharabia/cli-template

To download a specific version:

portion template download https://github.com/Atharabia/cli-template v1.2.0

Multiple versions of the same template can be installed side by side.

You can also use shorthand aliases instead of full URLs:

portion template download gh/Atharabia/cli-template

View Template Info

Inspect a template's metadata and available portions:

portion template info <template-name>

Example:

portion template info cli-template

If multiple versions of the template are installed, you will be prompted to choose which one to inspect.

Remove a Template

Delete a specific version of a template from your local system:

portion template remove <template-name>

Example:

portion template remove cli-template

If multiple versions are installed, you will be prompted to select which version to remove. The template directory is deleted automatically once no versions remain.

Next Steps