Historically, much of the UI used title case. This PR adds a lint check
that reports title case UI text so it can be converted to sentence case,
and converts the existing text.
- `site/scripts/check-sentence-case.mjs` runs as `pnpm
lint:sentence-case` and is part of `pnpm lint`. It reads JSX text and
string/template literals from the TypeScript AST and skips literals that
are code rather than UI text (imports, types, property names, tagged
templates, values of JSX attributes that are not displayed such as
`className` or `style`, and operands of `===`/`case` comparisons). JSX
text across inline elements and conditional JSX is checked as one
phrase. `--fix` lowercases the reported words. The checker is a
heuristic: it is not meant to model every code shape, so use a
`sentence-case-expect` comment where it guesses wrong.
- Proper nouns (Coder products, role names, third-party products,
protocols, font names) live in `PROPER_NOUNS`. For other deliberate
exceptions, a `sentence-case-expect` comment on the line above
suppresses the report and fails when that line no longer needs it.
- Existing UI text is converted to sentence case, and tests that assert
on it are updated.
- Deployment option lookups (`useDeploymentOptions`) now use CLI flags
instead of display names, so they do not depend on UI wording.
## Performance
`pnpm lint:sentence-case` takes **1.6 s** and is 2% to 4.5% of `pnpm
lint`. Measured on 82317c925e in a dev workspace (Xeon Platinum 8375C,
16 vCPUs, Node 22.23.4, TypeScript 6.0.2, warm file cache). CI buffers
the output of the lint steps, so its log has no per-step times to
compare against.
| Measurement (20 runs) | Result |
|---|---|
| Wall time | 1.64 s mean, 0.03 s standard deviation, 1.62 s to 1.71 s |
| CPU time | 3.0 s |
| Peak memory (RSS) | 154 MB, of which 116 MB is Node with `typescript`
loaded |
| Input | 1,301 of the 2,199 `.ts` and `.tsx` files in `site/src` (the
rest are excluded), 210,684 lines, 6.1 MB |
| Throughput | About 130,000 lines per second |
| Time per file | 0.5 ms median, 3 ms at the 95th percentile, 76 ms
maximum (`src/api/api.ts`, 121 KB) |
Each step of `pnpm lint`, median wall time of 5 runs:
| Step | Wall time |
|---|---|
| `lint:check` (Biome) | 0.96 s |
| `lint:oxlint` | 0.32 s |
| `lint:types` (`tsc`) | 5.8 s with its incremental cache, 45 s without
|
| `lint:circular-deps` | 5.7 s |
| `lint:compiler` | 15.6 s |
| `lint:sentence-case` | 1.6 s |
| `knip` | 6.6 s |
| All of `pnpm lint` | 37 s with the `tsc` cache, 76 s without |
<details>
<summary>Where the time goes, scaling, and limits</summary>
Phases of one run, from in-process timers. The split between parsing and
checking is approximate.
| Phase | Time | Share |
|---|---|---|
| Node startup | 0.03 s | 2% |
| Load the `typescript` module | 0.32 s | 20% |
| Find and read the files | 0.04 s | 2% |
| Parse (`ts.createSourceFile`) | 0.83 s | 52% |
| Check logic | 0.38 s | 24% |
Scaling, from synthetic inputs passed to `checkSource` (median of 3 to 5
warm runs):
- Clean input is linear in size: 0.2 ms to 0.35 ms per KB for one file
from 54 KB to 7 MB. 100,000 string literals take 0.3 s, 100,000 sibling
JSX elements take 0.8 s, and JSX nested 800 levels deep takes 10 ms.
- Conditional JSX stays bounded by the 64-variant cap: 1 to 48
conditional children in one element take at most 3.4 ms.
- Reporting and fixing add no measurable time. On the merge base with
`main` (378 reports in 175 files), a check, `--fix`, and a second
`--fix` each take 1.6 s to 1.7 s.
- The 21 unit tests run in about 30 ms, 1.7 s including Vitest startup.
Two limits, neither reachable with the current source:
- Time is quadratic in the reports for one file, because the fixed text
is rebuilt once per report. A 3.5 MB file takes 0.7 s clean and 18.0 s
with 12,800 reports. The most reports in one file on the merge base is
16.
- One JSX element with more than about 120,000 text phrases fails with
`RangeError: Maximum call stack size exceeded`, because the phrases are
spread into `push`.
</details>
---------
Co-authored-by: Jake Howell <jake@hwll.me>
8.3 KiB
title
| title |
|---|
| Creating templates |
Users with the Template Administrator role or above can create templates within Coder.
From a starter template
In most cases, it is best to start with a starter template.
Template builder
The template builder is the recommended way to create templates in Coder. It guides you through selecting a base infrastructure template, adding modules (IDEs, tools, integrations), and configuring your template, all without writing Terraform.
The template builder is enabled by default. When you select New template on the Templates page, the builder opens automatically for users with the Owner role. Users with the Template Admin role, and not the Owner role, get the starter templates page instead, where selecting a starter template opens that template in the builder.
The builder guides you through up to five steps:
-
Select base infrastructure: Choose a starter template for your target platform (for example, Docker, AWS Elastic Compute Cloud (EC2), Kubernetes).
Each base template provides a working foundation with the Coder agent pre-configured.
-
Base template parameters (optional): If the selected base template declares configurable variables, you can supply values for them here.
If the base template has no parameters, this step is skipped automatically.
-
Select modules: Pick from a curated list of registry modules to add IDEs, AI agents, source control integrations, and other tools.
Modules are grouped by category and filtered for compatibility with the selected base template's operating system. You can select multiple modules.
-
Module settings (optional): Configure variables for the modules you selected.
Required variables without defaults must be filled in before you can proceed. Modules that require secrets (such as API keys) display a notice that developers will be prompted for the value at workspace creation time.
-
Template customizations: Set the template's display name, description, icon, and organization, then select Create template.
After you select Create template, Coder composes the Terraform configuration server-side, checks it by parsing it and running terraform init and terraform plan, and creates the template.
The generated template is standard Terraform HashiCorp Configuration Language (HCL) that you can edit later through the dashboard or CLI.
Note
The template builder requires outbound access to
registry.coder.comso thatterraform initcan resolve module sources. For air-gapped or restricted-egress deployments, visit Air-gapped deployments.
If you select modules that are known to conflict with each other, the builder displays a warning. Module conflicts do not block template creation, but you should review the warning before proceeding.
Turn off the template builder
Operators can disable the template builder by setting the CODER_DISABLE_TEMPLATE_BUILDER environment variable or the --disable-template-builder server flag.
When disabled, the New template button links to the starter templates page instead, and the /api/v2/templatebuilder/* endpoints return 404.
Deployments using a self-hosted module registry mirror can set CODER_TEMPLATE_BUILDER_REGISTRY_URL to point generated module source paths at the mirror instead of registry.coder.com.
The value is a bare host, optionally with a port (for example mirror.internal:8443).
A leading http(s):// scheme and trailing slash are stripped, and a path, query, fragment, or credentials is rejected at server start.
Alternative creation methods
The template builder's first step also links to alternative creation paths:
- Upload an existing template:
Upload a
.tar.gzor.zipof Terraform files you have authored locally. - Start from scratch: Follow the template from scratch tutorial to write Terraform by hand.
- Browse community templates: Browse the Coder Registry for community and official templates.
CLI
You can use the Coder CLI to manage templates for Coder.
After logging in to your deployment, create a folder to store your templates:
# This snippet applies to macOS and Linux only
mkdir $HOME/coder-templates
cd $HOME/coder-templates
Use the templates init command to pull a starter template:
coder templates init
After pulling the template to your local machine (for example, aws-linux), you can rename it:
# This snippet applies to macOS and Linux only
mv aws-linux universal-template
cd universal-template
Next, push it to Coder with the templates push command:
coder templates push
If templates push fails, it is likely that Coder is not authorized to deploy infrastructure in the given location.
Learn how to configure provisioner authentication.
You can edit the metadata of the template such as the display name with the templates edit command:
coder templates edit universal-template \
--display-name "Universal Template" \
--description "Virtual machine configured with Java, Python, Typescript, IntelliJ IDEA, and Ruby. Use this for starter projects. " \
--icon "/emojis/2b50.png"
CI/CD
Follow the change management guide to manage templates via GitOps.
From an existing template
You can duplicate an existing template in your Coder deployment. This copies the template code and metadata, allowing you to make changes without affecting the original template.
Web UI
After navigating to the page for a template, use the dropdown menu on the right to Duplicate.
Give the new template a name, icon, and description.
Press Create template.
After the build, you will be taken to the new template page.
CLI
First, make sure you are logged in to the control plane as a user with permissions to read and write permissions.
coder login
You can list the available templates with the following CLI invocation.
coder templates list
After identified the template you'd like to work from, clone it into a directory with a name you'd like to assign to the new modified template.
coder templates pull <template-name> ./<new-template-name>
Then, you can make modifications to the existing template in this directory and push them to the control plane using the -d flag to specify the directory.
coder templates push <new-template-name> -d ./<new-template-name>
You will then see your new template in the dashboard.
From scratch (advanced)
There might be cases where you want to create a template from scratch. You can use any Terraform provider with Coder to create templates for additional clouds (for example, Hetzner, Alibaba) or orchestrators (VMware, Proxmox) that we do not provide example templates for.
Refer to the following resources:
- Tutorial: Create a template from scratch
- Extending templates: Features and concepts around templates (agents, parameters, variables, and so on)
- Coder Registry: Official and community templates for Coder
- Coder Terraform Provider Reference






