- Notifications
You must be signed in to change notification settings - Fork1.1k
Open
Labels
Description
Feature Request
Currently, there is no CLI command or convenient API method to retrieve a list of all available template parameters with their types, defaults, and validation rules.
Current State
API:
- The API endpoint
GET /api/v2/templateversions/{templateversion}/rich-parametersexists and returnsTemplateVersionParameter[]with full metadata including:name,display_name,descriptiontype(string, number, bool, list(string))default_valuemutable,required,ephemeralflagsvalidation_regex,validation_min,validation_max,validation_monotonicoptionsarray for dropdown/select parametersform_type(radio, dropdown, input, textarea, slider, checkbox, etc.)
CLI:
coder templates versions list <template>- lists versions but not parameterscoder create <workspace>- internally callsTemplateVersionRichParameters()but doesn't expose parameter info to users- No command exists to inspect template parameters directly
Proposed Solution
Add a new CLI command to retrieve template version parameters:
coder templates versions parameters<template> [version]
Or:
coder templates parameters<template> [--version<version>]
This should:
- Accept a template name (and optionally a version name or ID)
- Default to the active template version if no version is specified
- Call the existing
TemplateVersionRichParameters()API method - Display parameters in a table format (with JSON output option)
Use Case
The customer needs this to:
- Dynamically test Coder templates against a set of regression tests without statically defining the parameters
- Programmatically discover what parameters a template accepts
- Automate workspace creation with proper parameter validation
Example Output
$ coder templates versions parameters my-templateNAME TYPE REQUIRED DEFAULT DESCRIPTIONregion string true us-east-1 AWS region for deploymentinstance_type string true t3.medium EC2 instance typedisk_size number false 30 Root volume size in GBImplementation Notes
- The API already exists:
GET /api/v2/templateversions/{templateversion}/rich-parameters - The SDK method already exists:
client.TemplateVersionRichParameters(ctx, versionID) - Need to add CLI command in
/cli/templateversions.goor similar - Should follow the pattern of other
coder templates versionssubcommands