mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore(docs): update docs for correct use of shell and console and enforce linewidth (#9245)
This commit is contained in:
+36
-25
@@ -5,9 +5,10 @@ for software development.
|
||||
|
||||
## Create workspaces
|
||||
|
||||
Each Coder user has their own workspaces created from [shared templates](./templates/index.md):
|
||||
Each Coder user has their own workspaces created from
|
||||
[shared templates](./templates/index.md):
|
||||
|
||||
```console
|
||||
```shell
|
||||
# create a workspace from the template; specify any variables
|
||||
coder create --template="<templateName>" <workspaceName>
|
||||
|
||||
@@ -22,15 +23,17 @@ Coder [supports multiple IDEs](./ides.md) for use with your workspaces.
|
||||
## Workspace lifecycle
|
||||
|
||||
Workspaces in Coder are started and stopped, often based on whether there was
|
||||
any activity or if there was a [template update](./templates/index.md#Start/stop) available.
|
||||
any activity or if there was a
|
||||
[template update](./templates/index.md#Start/stop) available.
|
||||
|
||||
Resources are often destroyed and re-created when a workspace is restarted,
|
||||
though the exact behavior depends on the template. For more
|
||||
information, see [Resource Persistence](./templates/resource-persistence.md).
|
||||
though the exact behavior depends on the template. For more information, see
|
||||
[Resource Persistence](./templates/resource-persistence.md).
|
||||
|
||||
> ⚠️ To avoid data loss, refer to your template documentation for information on
|
||||
> where to store files, install software, etc., so that they persist. Default
|
||||
> templates are documented in [../examples/templates](https://github.com/coder/coder/tree/c6b1daabc5a7aa67bfbb6c89966d728919ba7f80/examples/templates).
|
||||
> templates are documented in
|
||||
> [../examples/templates](https://github.com/coder/coder/tree/c6b1daabc5a7aa67bfbb6c89966d728919ba7f80/examples/templates).
|
||||
>
|
||||
> You can use `coder show <workspace-name>` to see which resources are
|
||||
> persistent and which are ephemeral.
|
||||
@@ -39,49 +42,51 @@ When a workspace is deleted, all of the workspace's resources are deleted.
|
||||
|
||||
## Workspace scheduling
|
||||
|
||||
By default, workspaces are manually turned on/off by the user. However, a schedule
|
||||
can be defined on a per-workspace basis to automate the workspace start/stop.
|
||||
By default, workspaces are manually turned on/off by the user. However, a
|
||||
schedule can be defined on a per-workspace basis to automate the workspace
|
||||
start/stop.
|
||||
|
||||

|
||||
|
||||
### Autostart
|
||||
|
||||
The autostart feature automates the workspace build at a user-specified time
|
||||
and day(s) of the week. In addition, users can select their preferred timezone.
|
||||
The autostart feature automates the workspace build at a user-specified time and
|
||||
day(s) of the week. In addition, users can select their preferred timezone.
|
||||
|
||||

|
||||
|
||||
### Autostop
|
||||
|
||||
The autostop feature shuts off workspaces after given number of hours in the "on"
|
||||
state. If Coder detects workspace connection activity, the autostop timer is bumped up
|
||||
one hour. IDE, SSH, Port Forwarding, and coder_app activity trigger this bump.
|
||||
The autostop feature shuts off workspaces after given number of hours in the
|
||||
"on" state. If Coder detects workspace connection activity, the autostop timer
|
||||
is bumped up one hour. IDE, SSH, Port Forwarding, and coder_app activity trigger
|
||||
this bump.
|
||||
|
||||

|
||||
|
||||
### Max lifetime
|
||||
|
||||
Max lifetime is a template-level setting that determines the number of hours a
|
||||
workspace can run before it is automatically shutdown, regardless of any
|
||||
active connections. This setting ensures workspaces do not run in perpetuity
|
||||
when connections are left open inadvertently.
|
||||
workspace can run before it is automatically shutdown, regardless of any active
|
||||
connections. This setting ensures workspaces do not run in perpetuity when
|
||||
connections are left open inadvertently.
|
||||
|
||||
## Updating workspaces
|
||||
|
||||
Use the following command to update a workspace to the latest template version.
|
||||
The workspace will be stopped and started:
|
||||
|
||||
```console
|
||||
```shell
|
||||
coder update <workspace-name>
|
||||
```
|
||||
|
||||
## Repairing workspaces
|
||||
|
||||
Use the following command to re-enter template input
|
||||
variables in an existing workspace. This command is useful when a workspace fails
|
||||
to build because its state is out of sync with the template.
|
||||
Use the following command to re-enter template input variables in an existing
|
||||
workspace. This command is useful when a workspace fails to build because its
|
||||
state is out of sync with the template.
|
||||
|
||||
```console
|
||||
```shell
|
||||
coder update <your workspace name> --always-prompt
|
||||
```
|
||||
|
||||
@@ -99,16 +104,22 @@ Coder stores macOS and Linux logs at the following locations:
|
||||
|
||||
## Workspace filtering
|
||||
|
||||
In the Coder UI, you can filter your workspaces using pre-defined filters or employing the Coder's filter query. Take a look at the following examples to understand how to use the Coder's filter query:
|
||||
In the Coder UI, you can filter your workspaces using pre-defined filters or
|
||||
employing the Coder's filter query. Take a look at the following examples to
|
||||
understand how to use the Coder's filter query:
|
||||
|
||||
- To find the workspaces that you own, use the filter `owner:me`.
|
||||
- To find workspaces that are currently running, use the filter `status:running`.
|
||||
- To find workspaces that are currently running, use the filter
|
||||
`status:running`.
|
||||
|
||||
The following filters are supported:
|
||||
|
||||
- `owner` - Represents the `username` of the owner. You can also use `me` as a convenient alias for the logged-in user.
|
||||
- `owner` - Represents the `username` of the owner. You can also use `me` as a
|
||||
convenient alias for the logged-in user.
|
||||
- `template` - Specifies the name of the template.
|
||||
- `status` - Indicates the status of the workspace. For a list of supported statuses, please refer to the [WorkspaceStatus documentation](https://pkg.go.dev/github.com/coder/coder/v2/codersdk#WorkspaceStatus).
|
||||
- `status` - Indicates the status of the workspace. For a list of supported
|
||||
statuses, please refer to the
|
||||
[WorkspaceStatus documentation](https://pkg.go.dev/github.com/coder/coder/v2/codersdk#WorkspaceStatus).
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user