Skip to content

ptkl template

Search, install, and manage project templates and marketplace activation codes.


Overview

ptkl template wraps the platform's template & marketplace surface: searching the template catalog, listing templates available to your project, and installing/upgrading/uninstalling a template into a workspace. A separate activation-code subtree looks up and lists activation codes redeemed against your account (account/app/integration/template benefits).

Every subcommand supports the standard output flags (-f/--format, -o/--output, --template) plus the --env <dev|live> option.


Subcommands

Subcommand Description
search Search available templates
available List templates available to the current project
install Install a template into a workspace
upgrade Upgrade an installed template
uninstall Uninstall a template from a workspace
activation-code redeem <code> Redeem an activation code for the current user and project

Search the template catalog.

ptkl template search [options]

Options

Option Description
-q, --query <json> Search query, as a JSON object string (default: {})

Example

ptkl template search --query '{"category":"ecommerce"}'

ptkl template available

List templates available to the current project.

ptkl template available [options]

Example

ptkl template available --format table

ptkl template install

Install a template into a workspace.

ptkl template install [options]

Options

Option Description
-t, --template-id <uuid> Template UUID (required)
-w, --workspace-uuid <uuid> Workspace UUID (required)
-d, --data <json> Additional install options, as a JSON object string

Example

ptkl template install \
  --template-id <template-uuid> \
  --workspace-uuid <workspace-uuid>

ptkl template upgrade

Upgrade an already-installed template.

ptkl template upgrade [options]

Options

Option Description
-t, --template-id <uuid> Template UUID (required)
-w, --workspace-uuid <uuid> Workspace UUID (required)
-d, --data <json> Additional upgrade options, as a JSON object string

Example

ptkl template upgrade \
  --template-id <template-uuid> \
  --workspace-uuid <workspace-uuid>

ptkl template uninstall

Uninstall a template from a workspace.

ptkl template uninstall [options]

Options

Option Description
-t, --template-id <uuid> Template UUID (required)
-w, --workspace-uuid <uuid> Workspace UUID (required)
-d, --data <json> Additional uninstall options, as a JSON object string

Example

ptkl template uninstall \
  --template-id <template-uuid> \
  --workspace-uuid <workspace-uuid>

ptkl template activation-code

Redeem and list activation codes. Activation codes cover several benefit types (account/app/integration/template) redeemed through the same endpoint — this is distinct from ptkl template install, which installs a specific template you already have access to.

ptkl template activation-code redeem

Redeem an activation code for the current user and project.

ptkl template activation-code redeem <code>
ptkl template activation-code redeem ACME-2026-PROMO

Note

activation-code redeem is a different subsystem than search/available/ install/upgrade/uninstall above: it redeems account-level activation codes, not template install operations. See the platform documentation on marketplace codes for details.


Installing a template

Installing runs the template's code in your project. Before you confirm, the dashboard shows what the install needs and what it touches.

Declared permissions

A template declares permissions for what its code needs outside its own components, as <action> <resource> strings:

{
  "permissions": ["read orders", "run function::notify_customer"]
}

The list is part of the template document. Publishing checks that each entry is in <action> <resource> form.

The installer must hold every declared permission. The install dialog lists each one and marks it "You hold it" or "You lack it":

This template declares permissions its code needs outside its own components. The installation's role gets them only if you hold every one of them. The server checks again when you install.

If you lack some, it says:

You lack {missing}. The install will be refused until the Owner or a Maintainer grants you these permissions, or installs the template for you.

The API refuses with 403 permissions_not_held and nothing is installed:

{
  "error": "permissions_not_held",
  "message": "the installer does not hold the template's declared permissions",
  "missing": ["read orders"]
}

The fix: ask the Owner or a Maintainer to grant them, or to install the template.

A declared permission that names a resource the project doesn't have fails the install before anything is written, with 422 resources_missing listing what is missing:

The install was refused and nothing was installed: the template declares permissions on resources this project does not have ({missing}). Install or create those components first, then install again.

Everything the template creates needs only manage base_templates, because those resources didn't exist before.

Existing components it writes into

A template can write into a component that already exists. That component keeps the run identity it has now. The installation's role gets no access to it unless the template declares it and you hold it. The dialog lists them:

These components already exist in this project. The template writes into them, and each keeps the run identity it has now. The installation's role gets no access to them unless the template declares it and you hold it.

Each entry reads "keeps {identity}". The install response lists the same components in adopted, each with its component and run_as. ptkl template install prints that response.

The installation's identity

A template can't name your project's roles. Each installation gets its own role and API user, and everything it creates runs as that API user:

The installation gets its own role and API user, and everything it creates runs as that API user. They are locked: they can't be edited, deleted, assigned or chosen as a run identity, and they go away when you uninstall the template. Code still running as them after that is refused, and its editor shows that the identity is gone.

The role holds access to each component the installation created, run function::<name> for its functions, trigger permissions for its workflows, and the template's declared permissions.

The dashboard shows the identity as the installation's own and locked: "Belongs to a template installation: it can't be edited, deleted, assigned or chosen." Choosing it as a run identity gives 403 identity_locked. See Run identity.

On uninstall the role and API user are removed with the installation. Code still running as them is refused with 409 identity_gone. Give it another identity in its editor, and see Code whose identity is gone.

Install refusals

Situation Refusal
Another install or uninstall of this template is running 409. "Another install or uninstall of this template is in progress. Wait a few seconds and try again."
A service the check needs is unavailable 503 with Retry-After. "The install could not be checked because a service is unavailable, and nothing was installed. Try again in a few seconds."

Installs from before run identities have no run identity recorded. Their code runs as Maintainer. See Run identity.

Template code must follow the same rules as any other code: inputs are untrusted.


See Also