feat(cli): add coder open vscode (#11191)

Fixes #7667
This commit is contained in:
Mathias Fredriksson
2024-01-02 20:46:18 +02:00
committed by GitHub
parent 099be249a7
commit df3c310379
26 changed files with 1123 additions and 292 deletions

4
docs/api/agents.md generated
View File

@ -421,6 +421,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/me/manifest \
```json
{
"agent_id": "string",
"agent_name": "string",
"apps": [
{
"command": "string",
@ -532,7 +533,8 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/me/manifest \
}
],
"vscode_port_proxy_uri": "string",
"workspace_id": "string"
"workspace_id": "string",
"workspace_name": "string"
}
```

6
docs/api/schemas.md generated
View File

@ -186,6 +186,7 @@
```json
{
"agent_id": "string",
"agent_name": "string",
"apps": [
{
"command": "string",
@ -297,7 +298,8 @@
}
],
"vscode_port_proxy_uri": "string",
"workspace_id": "string"
"workspace_id": "string",
"workspace_name": "string"
}
```
@ -306,6 +308,7 @@
| Name | Type | Required | Restrictions | Description |
| ---------------------------- | ------------------------------------------------------------------------------------------------- | -------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `agent_id` | string | false | | |
| `agent_name` | string | false | | |
| `apps` | array of [codersdk.WorkspaceApp](#codersdkworkspaceapp) | false | | |
| `derp_force_websockets` | boolean | false | | |
| `derpmap` | [tailcfg.DERPMap](#tailcfgderpmap) | false | | |
@ -320,6 +323,7 @@
| `scripts` | array of [codersdk.WorkspaceAgentScript](#codersdkworkspaceagentscript) | false | | |
| `vscode_port_proxy_uri` | string | false | | |
| `workspace_id` | string | false | | |
| `workspace_name` | string | false | | |
## agentsdk.Metadata

View File

@ -38,6 +38,7 @@ Coder — A tool for provisioning self-hosted development environments with Terr
| [<code>login</code>](./cli/login.md) | Authenticate with Coder deployment |
| [<code>logout</code>](./cli/logout.md) | Unauthenticate your local session |
| [<code>netcheck</code>](./cli/netcheck.md) | Print network debug information for DERP and STUN |
| [<code>open</code>](./cli/open.md) | Open a workspace |
| [<code>ping</code>](./cli/ping.md) | Ping a workspace |
| [<code>port-forward</code>](./cli/port-forward.md) | Forward ports from a workspace to the local machine. For reverse port forwarding, use "coder ssh -R". |
| [<code>provisionerd</code>](./cli/provisionerd.md) | Manage provisioner daemons |

17
docs/cli/open.md generated Normal file
View File

@ -0,0 +1,17 @@
<!-- DO NOT EDIT | GENERATED CONTENT -->
# open
Open a workspace
## Usage
```console
coder open
```
## Subcommands
| Name | Purpose |
| --------------------------------------- | ----------------------------------- |
| [<code>vscode</code>](./open_vscode.md) | Open a workspace in VS Code Desktop |

22
docs/cli/open_vscode.md generated Normal file
View File

@ -0,0 +1,22 @@
<!-- DO NOT EDIT | GENERATED CONTENT -->
# open vscode
Open a workspace in VS Code Desktop
## Usage
```console
coder open vscode [flags] <workspace> [<directory in workspace>]
```
## Options
### --generate-token
| | |
| ----------- | ---------------------------------------------- |
| Type | <code>bool</code> |
| Environment | <code>$CODER_OPEN_VSCODE_GENERATE_TOKEN</code> |
Generate an auth token and include it in the vscode:// URI. This is for automagical configuration of VS Code Desktop and not needed if already configured. This flag does not need to be specified when running this command on a local machine unless automatic open fails.

View File

@ -705,6 +705,16 @@
"description": "Print network debug information for DERP and STUN",
"path": "cli/netcheck.md"
},
{
"title": "open",
"description": "Open a workspace",
"path": "cli/open.md"
},
{
"title": "open vscode",
"description": "Open a workspace in VS Code Desktop",
"path": "cli/open_vscode.md"
},
{
"title": "ping",
"description": "Ping a workspace",