Files
coder/docs/reference/cli/templates_create.md
T
Ethan 78b5a0f5a2 feat(cli): add --agents-allowed to template commands (#27517)
Relates to CODAGT-713

Depends on #27515

This adds `--agents-allowed` to `coder templates create` and `coder templates edit`. Template creation defaults the option to true, matching the per-template API and database default, while template editing only changes the value when the flag is explicitly supplied so unrelated edits preserve the existing setting.

The generated CLI help and reference documentation include the new option. #27518 updates the Coder Agents platform controls documentation to describe the completed per-template model.
2026-08-06 14:45:38 +10:00

4.3 KiB
Generated

templates create

DEPRECATED: Create a template from the current directory or as specified by flag

Usage

coder templates create [flags] [name]

Options

--agents-allowed

Type bool
Default true

Allow Coder Agents to create workspaces using this template.

--private

Type bool

Disable the default behavior of granting template access to the 'everyone' group. The template permissions must be updated to allow non-admin users to use this template.

--variables-file

Type string

Specify a file path with values for Terraform-managed variables.

--variable

Type string-array

Specify a set of values for Terraform-managed variables.

--var

Type string-array

Alias of --variable.

--provisioner-tag

Type string-array

Specify a set of tags to target provisioner daemons.

--default-ttl

Type duration
Default 24h

Specify a default TTL for workspaces created from this template. It is the default time before shutdown - workspaces created from this template default to this value. Maps to "Default autostop" in the UI.

--failure-ttl

Type duration
Default 0h

Specify a failure TTL for workspaces created from this template. It is the amount of time after a failed "start" build before coder automatically schedules a "stop" build to cleanup.This licensed feature's default is 0h (off). Maps to "Failure cleanup"in the UI.

--dormancy-threshold

Type duration
Default 0h

Specify a duration workspaces may be inactive prior to being moved to the dormant state. This licensed feature's default is 0h (off). Maps to "Dormancy threshold" in the UI.

--dormancy-auto-deletion

Type duration
Default 0h

Specify a duration workspaces may be in the dormant state prior to being deleted. This licensed feature's default is 0h (off). Maps to "Dormancy Auto-Deletion" in the UI.

--require-active-version

Type bool
Default false

Requires workspace builds to use the active template version. This setting does not apply to template admins. This is an enterprise-only feature. See https://coder.com/docs/admin/templates/managing-templates#require-automatic-updates-enterprise for more details.

-y, --yes

Type bool

Bypass confirmation prompts.

-O, --org

Type string
Environment $CODER_ORGANIZATION

Select which organization (uuid or name) to use.

-d, --directory

Type string
Default .

Specify the directory to create from, use '-' to read tar from stdin.

--ignore-lockfile

Type bool
Default false

Ignore warnings about not having a .terraform.lock.hcl file present in the template.

-m, --message

Type string

Specify a message describing the changes in this version of the template. Messages longer than 72 characters will be displayed as truncated.