coder / coder/internal

dynamic parameters: `script` or `code` as a `form_type` option

Open
#745 3 comments 0 reactions 0 assignees View on GitHub
parameters
Dominant language
No language data
Stars
3
Forks
0
PR merge metrics
No merged PRs in 30d

Description

### Proposal

Some customers want a larger text area in the workspace create so users may enter their scripts.

I think we should add a sibling to `textarea` that renders in monospace and displays line numbers.

I don't think embedding a text editor is necessary.

### Example

```terraform

data "coder_parameter" "setup_script" {
name = "setup_script"
description = "Commands that run after your workspace is provisioned."
mutable = true
display_name = "Workspace setup script"

# Renders as a code editor with syntax highlighting
form_type = "code"
type = "string"

# <<-EOT lets us indent the body but strips the extra leading tabs/spaces
default = <<-EOT
#!/usr/bin/env bash
# This script is executed once the workspace starts.
# You can install packages, pull dotfiles, or do any other bootstrap tasks.

set -euo pipefail

echo "🔄 Updating APT cache…"
sudo apt-get update -y

echo "📦 Installing baseline packages…"
sudo apt-get install -y tmux ripgrep fd-find

echo "⬇️ Cloning dotfiles repository (replace with your own)…"
if [ ! -d "$HOME/.dotfiles" ]; then
git clone https://github.com/your-github-handle/dotfiles.git "$HOME/.dotfiles"
"$HOME/.dotfiles/install.sh"
fi

echo "✅ Workspace bootstrap complete!"
EOT
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.