Skip to content

feat: templates push should read display_name, icon, and description from README.md frontmatter #23735

@bpmct

Description

@bpmct

Problem

coder templates push currently ignores the README.md frontmatter when creating a template. The CreateTemplateRequest supports display_name, description, and icon, but the CLI never populates them — users must follow up with coder templates edit to set these fields.

Meanwhile, templates in coder/registry and our own examples/templates/ already use a well-defined YAML frontmatter format:

---
display_name: Docker Containers
description: Provision Docker containers as Coder workspaces
icon: ../../../site/static/icon/docker.png
maintainer_github: coder
verified: true
tags: [docker, container]
---

We even parse this exact format in scripts/examplegen/main.go (using github.com/gohugoio/hugo/parser/pageparser, already a go.mod dependency) to generate starter template metadata.

Proposal

When coder templates push runs from a directory (not stdin), read README.md from the template directory and parse its frontmatter. Use display_name, description, and icon to populate the template on both create and update paths.

  • Create path: populate DisplayName, Description, and Icon in CreateTemplateRequest.
  • Update path: call UpdateTemplateMeta with values from frontmatter.
  • CLI flag override: add --display-name and --icon flags so explicit values take precedence over frontmatter.
  • Stdin: skip frontmatter detection when reading from stdin (-d -).

Why this matters

  1. User-contributed templates in the registry — community authors already write frontmatter for registry publishing. When they push these same templates to their Coder deployment, the display name and icon should just work without a separate templates edit step. This removes a paper cut that makes the registry-to-deployment workflow feel disjointed.

  2. Template creation AI skill — we are building a template creation skill that will generate complete template directories including README.md with frontmatter. If templates push respects frontmatter, the skill can produce a fully-configured template in one shot, no post-push fixup required.

Prior art

  • scripts/examplegen/main.go — parses the same frontmatter schema to build codersdk.TemplateExample for starter templates.
  • codersdk.CreateTemplateRequest already has DisplayName, Description, and Icon fields.
  • coder templates edit already supports --display-name, --icon, and --description flags via UpdateTemplateMeta.

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