From 33351290fcc5963fbae9f5fd3f39b7a1d006e199 Mon Sep 17 00:00:00 2001 From: sharkymark Date: Mon, 7 Apr 2025 08:43:19 -0500 Subject: [PATCH 1/5] docs: add zed as coder_app to open from workspace with a hotlink (#17236) I want to open the locally installed Zed IDE as an icon from a Coder workspace. To do this, I added a `coder_app` resource and a `url` with Zed's remote development hotlink approach. ```hcl resource "coder_app" "zed" { agent_id = coder_agent.dev.id slug = "slug" display_name = "Zed" external = true url = "zed://ssh/coder.${data.coder_workspace.me.name}" icon = "/icon/zed.svg" } ``` My [community Docker template](https://github.com/sharkymark/v2-templates/blob/main/src/docker-code-server/main.tf) lets the user choose VS Code Desktop, code-server or Zed. ![image](https://github.com/user-attachments/assets/cd0d4d50-fb7d-4feb-9a9b-5ccecc131387) ![image](https://github.com/user-attachments/assets/dfd994e8-52e1-4417-a5aa-3041f6dbf072) @kylecarbs --------- Co-authored-by: Edward Angert --- docs/user-guides/workspace-access/zed.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/user-guides/workspace-access/zed.md b/docs/user-guides/workspace-access/zed.md index d2d507363c7c1..76d2645a718f8 100644 --- a/docs/user-guides/workspace-access/zed.md +++ b/docs/user-guides/workspace-access/zed.md @@ -62,6 +62,19 @@ Use the Coder CLI to log in and configure SSH, then connect to your workspace wi zed ssh://coder.workspace-name ``` +1. Connect via a coder_app workspace icon and SSH hotlink: + + ```hcl + resource "coder_app" "zed" { + agent_id = coder_agent.main.id + slug = "slug" + display_name = "Zed" + external = true + url = "zed://ssh/coder.${data.coder_workspace.me.name}" + icon = "/icon/zed.svg" + } + ``` + Or use Zed's [Remote Development](https://zed.dev/docs/remote-development#setup) to connect to the workspace: ![Zed open remote project](../../images/zed/zed-ssh-open-remote.png) From e545c44f63c0151a500ede1e9dc6ae907fae677c Mon Sep 17 00:00:00 2001 From: EdwardAngert <17991901+EdwardAngert@users.noreply.github.com> Date: Mon, 7 Apr 2025 14:55:34 +0000 Subject: [PATCH 2/5] move zed to web-ides doc --- .../templates/extending-templates/web-ides.md | 15 +++++++++++++++ docs/user-guides/workspace-access/zed.md | 13 ------------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/docs/admin/templates/extending-templates/web-ides.md b/docs/admin/templates/extending-templates/web-ides.md index d46fcf80010e9..877891483f461 100644 --- a/docs/admin/templates/extending-templates/web-ides.md +++ b/docs/admin/templates/extending-templates/web-ides.md @@ -368,6 +368,21 @@ module "filebrowser" { ![File Browser](../../../images/file-browser.png) +## Zed + +Configure your agent and `coder_app` like to include a Zed hotlink: + +```hcl +resource "coder_app" "zed" { + agent_id = coder_agent.main.id + slug = "slug" + display_name = "Zed" + external = true + url = "zed://ssh/coder.${data.coder_workspace.me.name}" + icon = "/icon/zed.svg" +} +``` + ## SSH Fallback If you prefer to run web IDEs in localhost, you can port forward using diff --git a/docs/user-guides/workspace-access/zed.md b/docs/user-guides/workspace-access/zed.md index 76d2645a718f8..d2d507363c7c1 100644 --- a/docs/user-guides/workspace-access/zed.md +++ b/docs/user-guides/workspace-access/zed.md @@ -62,19 +62,6 @@ Use the Coder CLI to log in and configure SSH, then connect to your workspace wi zed ssh://coder.workspace-name ``` -1. Connect via a coder_app workspace icon and SSH hotlink: - - ```hcl - resource "coder_app" "zed" { - agent_id = coder_agent.main.id - slug = "slug" - display_name = "Zed" - external = true - url = "zed://ssh/coder.${data.coder_workspace.me.name}" - icon = "/icon/zed.svg" - } - ``` - Or use Zed's [Remote Development](https://zed.dev/docs/remote-development#setup) to connect to the workspace: ![Zed open remote project](../../images/zed/zed-ssh-open-remote.png) From 2b224661dcb0136b34af07395813210aa0f2178f Mon Sep 17 00:00:00 2001 From: EdwardAngert <17991901+EdwardAngert@users.noreply.github.com> Date: Mon, 7 Apr 2025 15:34:03 +0000 Subject: [PATCH 3/5] move zed up amongst the ides --- .../templates/extending-templates/web-ides.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/admin/templates/extending-templates/web-ides.md b/docs/admin/templates/extending-templates/web-ides.md index 877891483f461..64da248aeca4c 100644 --- a/docs/admin/templates/extending-templates/web-ides.md +++ b/docs/admin/templates/extending-templates/web-ides.md @@ -315,6 +315,21 @@ module "airflow" { ![Airflow in Coder](../../../images/airflow-port-forward.png) +## Zed + +Configure your agent and `coder_app` like to include a Zed hotlink: + +```hcl +resource "coder_app" "zed" { + agent_id = coder_agent.main.id + slug = "slug" + display_name = "Zed" + external = true + url = "zed://ssh/coder.${data.coder_workspace.me.name}" + icon = "/icon/zed.svg" +} +``` + ## File Browser To access the contents of a workspace directory in a browser, you can use File @@ -368,21 +383,6 @@ module "filebrowser" { ![File Browser](../../../images/file-browser.png) -## Zed - -Configure your agent and `coder_app` like to include a Zed hotlink: - -```hcl -resource "coder_app" "zed" { - agent_id = coder_agent.main.id - slug = "slug" - display_name = "Zed" - external = true - url = "zed://ssh/coder.${data.coder_workspace.me.name}" - icon = "/icon/zed.svg" -} -``` - ## SSH Fallback If you prefer to run web IDEs in localhost, you can port forward using From eb1ad93dd8e54e98ef3888ac27dd5dd154313e91 Mon Sep 17 00:00:00 2001 From: EdwardAngert <17991901+EdwardAngert@users.noreply.github.com> Date: Mon, 7 Apr 2025 17:49:43 +0000 Subject: [PATCH 4/5] zed+ coder app examples in extending-templates --- .../templates/extending-templates/index.md | 47 +++++++++++++++++++ .../templates/extending-templates/web-ides.md | 15 ------ 2 files changed, 47 insertions(+), 15 deletions(-) diff --git a/docs/admin/templates/extending-templates/index.md b/docs/admin/templates/extending-templates/index.md index c27c1da709253..f6c90f1dcd988 100644 --- a/docs/admin/templates/extending-templates/index.md +++ b/docs/admin/templates/extending-templates/index.md @@ -87,6 +87,53 @@ and can be hidden directly in the resource. You can arrange the display orientation of Coder apps in your template using [resource ordering](./resource-ordering.md). +### Coder app examples + +
+ +You can use these examples to add new Coder apps: + +## code-server + +```hcl +resource "coder_app" "code-server" { + agent_id = coder_agent.main.id + slug = "code-server" + display_name = "code-server" + url = "http://localhost:13337/?folder=/home/${local.username}" + icon = "/icon/code.svg" + subdomain = false + share = "owner" +``` + +## Filebrowser + +```hcl +resource "coder_app" "filebrowser" { + agent_id = coder_agent.main.id + display_name = "file browser" + slug = "filebrowser" + url = "http://localhost:13339" + icon = "/icon/database.svg" + subdomain = true + share = "owner" +``` + +## Zed + +```hcl +resource "coder_app" "zed" { + agent_id = coder_agent.main.id + slug = "slug" + display_name = "Zed" + external = true + url = "zed://ssh/coder.${data.coder_workspace.me.name}" + icon = "/icon/zed.svg" +} +``` + +
+ Check out our [module registry](https://registry.coder.com/modules) for additional Coder apps from the team and our OSS community. diff --git a/docs/admin/templates/extending-templates/web-ides.md b/docs/admin/templates/extending-templates/web-ides.md index 64da248aeca4c..d46fcf80010e9 100644 --- a/docs/admin/templates/extending-templates/web-ides.md +++ b/docs/admin/templates/extending-templates/web-ides.md @@ -315,21 +315,6 @@ module "airflow" { ![Airflow in Coder](../../../images/airflow-port-forward.png) -## Zed - -Configure your agent and `coder_app` like to include a Zed hotlink: - -```hcl -resource "coder_app" "zed" { - agent_id = coder_agent.main.id - slug = "slug" - display_name = "Zed" - external = true - url = "zed://ssh/coder.${data.coder_workspace.me.name}" - icon = "/icon/zed.svg" -} -``` - ## File Browser To access the contents of a workspace directory in a browser, you can use File From 5bdb4898022ac21af1d2f91ea98dcaa4e185db09 Mon Sep 17 00:00:00 2001 From: EdwardAngert <17991901+EdwardAngert@users.noreply.github.com> Date: Mon, 7 Apr 2025 17:52:57 +0000 Subject: [PATCH 5/5] close the }s --- docs/admin/templates/extending-templates/index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/admin/templates/extending-templates/index.md b/docs/admin/templates/extending-templates/index.md index f6c90f1dcd988..2e274e11effe7 100644 --- a/docs/admin/templates/extending-templates/index.md +++ b/docs/admin/templates/extending-templates/index.md @@ -104,6 +104,7 @@ resource "coder_app" "code-server" { icon = "/icon/code.svg" subdomain = false share = "owner" +} ``` ## Filebrowser @@ -117,6 +118,7 @@ resource "coder_app" "filebrowser" { icon = "/icon/database.svg" subdomain = true share = "owner" +} ``` ## Zed