Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: Add CLI command to retrieve template version parameters #20898

Open
@blinkagent

Description

@blinkagent

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 endpointGET /api/v2/templateversions/{templateversion}/rich-parameters exists and returnsTemplateVersionParameter[] with full metadata including:
    • name,display_name,description
    • type (string, number, bool, list(string))
    • default_value
    • mutable,required,ephemeral flags
    • validation_regex,validation_min,validation_max,validation_monotonic
    • options array for dropdown/select parameters
    • form_type (radio, dropdown, input, textarea, slider, checkbox, etc.)

CLI:

  • coder templates versions list <template> - lists versions but not parameters
  • coder 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:

  1. Accept a template name (and optionally a version name or ID)
  2. Default to the active template version if no version is specified
  3. Call the existingTemplateVersionRichParameters() API method
  4. 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 GB

Implementation 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.go or similar
  • Should follow the pattern of othercoder templates versions subcommands

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp