docs: move api and cli docs routes to reference/ (#14241)

This commit is contained in:
Muhammad Atif Ali
2024-08-13 18:39:46 +03:00
committed by GitHub
parent 6f9b1a39f4
commit 48f29a1995
145 changed files with 4121 additions and 3448 deletions

4
.gitattributes vendored
View File

@ -1,7 +1,7 @@
# Generated files # Generated files
coderd/apidoc/docs.go linguist-generated=true coderd/apidoc/docs.go linguist-generated=true
docs/api/*.md linguist-generated=true docs/reference/api/*.md linguist-generated=true
docs/cli/*.md linguist-generated=true docs/reference/cli/*.md linguist-generated=true
coderd/apidoc/swagger.json linguist-generated=true coderd/apidoc/swagger.json linguist-generated=true
coderd/database/dump.sql linguist-generated=true coderd/database/dump.sql linguist-generated=true
peerbroker/proto/*.go linguist-generated=true peerbroker/proto/*.go linguist-generated=true

View File

@ -9,8 +9,8 @@ tabWidth: 2
overrides: overrides:
- files: - files:
- README.md - README.md
- docs/api/**/*.md - docs/reference/api/**/*.md
- docs/cli/**/*.md - docs/reference/cli/**/*.md
- docs/changelogs/*.md - docs/changelogs/*.md
- .github/**/*.{yaml,yml,toml} - .github/**/*.{yaml,yml,toml}
- scripts/**/*.{yaml,yml,toml} - scripts/**/*.{yaml,yml,toml}

View File

@ -196,7 +196,8 @@
"**/*.gen.json": true, "**/*.gen.json": true,
"**/testdata/*": true, "**/testdata/*": true,
"coderd/apidoc/**": true, "coderd/apidoc/**": true,
"docs/api/*.md": true, "docs/reference/api/*.md": true,
"docs/reference/cli/*.md": true,
"docs/templates/*.md": true, "docs/templates/*.md": true,
"LICENSE": true, "LICENSE": true,
"scripts/metricsdocgen/metrics": true, "scripts/metricsdocgen/metrics": true,

View File

@ -489,7 +489,7 @@ gen: \
codersdk/rbacresources_gen.go \ codersdk/rbacresources_gen.go \
site/src/api/rbacresources_gen.ts \ site/src/api/rbacresources_gen.ts \
docs/admin/prometheus.md \ docs/admin/prometheus.md \
docs/cli.md \ docs/reference/cli/README.md \
docs/admin/audit-logs.md \ docs/admin/audit-logs.md \
coderd/apidoc/swagger.json \ coderd/apidoc/swagger.json \
.prettierignore.include \ .prettierignore.include \
@ -521,7 +521,7 @@ gen/mark-fresh:
codersdk/rbacresources_gen.go \ codersdk/rbacresources_gen.go \
site/src/api/rbacresources_gen.ts \ site/src/api/rbacresources_gen.ts \
docs/admin/prometheus.md \ docs/admin/prometheus.md \
docs/cli.md \ docs/reference/cli/README.md \
docs/admin/audit-logs.md \ docs/admin/audit-logs.md \
coderd/apidoc/swagger.json \ coderd/apidoc/swagger.json \
.prettierignore.include \ .prettierignore.include \
@ -633,10 +633,10 @@ docs/admin/prometheus.md: scripts/metricsdocgen/main.go scripts/metricsdocgen/me
./scripts/pnpm_install.sh ./scripts/pnpm_install.sh
pnpm exec prettier --write ./docs/admin/prometheus.md pnpm exec prettier --write ./docs/admin/prometheus.md
docs/cli.md: scripts/clidocgen/main.go examples/examples.gen.json $(GO_SRC_FILES) docs/reference/cli/README.md: scripts/clidocgen/main.go examples/examples.gen.json $(GO_SRC_FILES)
CI=true BASE_PATH="." go run ./scripts/clidocgen CI=true BASE_PATH="." go run ./scripts/clidocgen
./scripts/pnpm_install.sh ./scripts/pnpm_install.sh
pnpm exec prettier --write ./docs/cli.md ./docs/cli/*.md ./docs/manifest.json pnpm exec prettier --write ./docs/reference/cli/README.md ./docs/reference/cli/*.md ./docs/manifest.json
docs/admin/audit-logs.md: coderd/database/querier.go scripts/auditdocgen/main.go enterprise/audit/table.go coderd/rbac/object_gen.go docs/admin/audit-logs.md: coderd/database/querier.go scripts/auditdocgen/main.go enterprise/audit/table.go coderd/rbac/object_gen.go
go run scripts/auditdocgen/main.go go run scripts/auditdocgen/main.go
@ -646,7 +646,7 @@ docs/admin/audit-logs.md: coderd/database/querier.go scripts/auditdocgen/main.go
coderd/apidoc/swagger.json: $(shell find ./scripts/apidocgen $(FIND_EXCLUSIONS) -type f) $(wildcard coderd/*.go) $(wildcard enterprise/coderd/*.go) $(wildcard codersdk/*.go) $(wildcard enterprise/wsproxy/wsproxysdk/*.go) $(DB_GEN_FILES) .swaggo docs/manifest.json coderd/rbac/object_gen.go coderd/apidoc/swagger.json: $(shell find ./scripts/apidocgen $(FIND_EXCLUSIONS) -type f) $(wildcard coderd/*.go) $(wildcard enterprise/coderd/*.go) $(wildcard codersdk/*.go) $(wildcard enterprise/wsproxy/wsproxysdk/*.go) $(DB_GEN_FILES) .swaggo docs/manifest.json coderd/rbac/object_gen.go
./scripts/apidocgen/generate.sh ./scripts/apidocgen/generate.sh
./scripts/pnpm_install.sh ./scripts/pnpm_install.sh
pnpm exec prettier --write ./docs/api ./docs/manifest.json ./coderd/apidoc/swagger.json pnpm exec prettier --write ./docs/reference/api ./docs/manifest.json ./coderd/apidoc/swagger.json
update-golden-files: \ update-golden-files: \
cli/testdata/.gen-golden \ cli/testdata/.gen-golden \

View File

@ -70,14 +70,15 @@ audit trails.
Audit logs can be accessed through our REST API. You can find detailed Audit logs can be accessed through our REST API. You can find detailed
information about this in our information about this in our
[endpoint documentation](../api/audit.md#get-audit-logs). [endpoint documentation](../reference/api/audit.md#get-audit-logs).
## Service Logs ## Service Logs
Audit trails are also dispatched as service logs and can be captured and Audit trails are also dispatched as service logs and can be captured and
categorized using any log management tool such as [Splunk](https://splunk.com). categorized using any log management tool such as [Splunk](https://splunk.com).
Example of a [JSON formatted](../cli/server.md#--log-json) audit log entry: Example of a [JSON formatted](../reference/cli/server.md#--log-json) audit log
entry:
```json ```json
{ {
@ -112,7 +113,8 @@ Example of a [JSON formatted](../cli/server.md#--log-json) audit log entry:
} }
``` ```
Example of a [human readable](../cli/server.md#--log-human) audit log entry: Example of a [human readable](../reference/cli/server.md#--log-human) audit log
entry:
```console ```console
2023-06-13 03:43:29.233 [info] coderd: audit_log ID=95f7c392-da3e-480c-a579-8909f145fbe2 Time="2023-06-13T03:43:29.230422Z" UserID=6c405053-27e3-484a-9ad7-bcb64e7bfde6 OrganizationID=00000000-0000-0000-0000-000000000000 Ip=<nil> UserAgent=<nil> ResourceType=workspace_build ResourceID=988ae133-5b73-41e3-a55e-e1e9d3ef0b66 ResourceTarget="" Action=start Diff="{}" StatusCode=200 AdditionalFields="{\"workspace_name\":\"linux-container\",\"build_number\":\"7\",\"build_reason\":\"initiator\",\"workspace_owner\":\"\"}" RequestID=9682b1b5-7b9f-4bf2-9a39-9463f8e41cd6 ResourceIcon="" 2023-06-13 03:43:29.233 [info] coderd: audit_log ID=95f7c392-da3e-480c-a579-8909f145fbe2 Time="2023-06-13T03:43:29.230422Z" UserID=6c405053-27e3-484a-9ad7-bcb64e7bfde6 OrganizationID=00000000-0000-0000-0000-000000000000 Ip=<nil> UserAgent=<nil> ResourceType=workspace_build ResourceID=988ae133-5b73-41e3-a55e-e1e9d3ef0b66 ResourceTarget="" Action=start Diff="{}" StatusCode=200 AdditionalFields="{\"workspace_name\":\"linux-container\",\"build_number\":\"7\",\"build_reason\":\"initiator\",\"workspace_owner\":\"\"}" RequestID=9682b1b5-7b9f-4bf2-9a39-9463f8e41cd6 ResourceIcon=""

View File

@ -19,7 +19,7 @@ First,
GitHub will ask you for the following Coder parameters: GitHub will ask you for the following Coder parameters:
- **Homepage URL**: Set to your Coder deployments - **Homepage URL**: Set to your Coder deployments
[`CODER_ACCESS_URL`](../cli/server.md#--access-url) (e.g. [`CODER_ACCESS_URL`](../reference/cli/server.md#--access-url) (e.g.
`https://coder.domain.com`) `https://coder.domain.com`)
- **User Authorization Callback URL**: Set to `https://coder.domain.com` - **User Authorization Callback URL**: Set to `https://coder.domain.com`

View File

@ -4,8 +4,8 @@ All actions possible through the Coder dashboard can also be automated as it
utilizes the same public REST API. There are several ways to extend/automate utilizes the same public REST API. There are several ways to extend/automate
Coder: Coder:
- [CLI](../cli.md) - [CLI](../reference/cli/README.md)
- [REST API](../api/) - [REST API](../reference/api/README.md)
- [Coder SDK](https://pkg.go.dev/github.com/coder/coder/v2/codersdk) - [Coder SDK](https://pkg.go.dev/github.com/coder/coder/v2/codersdk)
## Quickstart ## Quickstart
@ -32,9 +32,10 @@ curl https://coder.example.com/api/v2/workspaces?q=owner:me \
## Documentation ## Documentation
We publish an [API reference](../api/index.md) in our documentation. You can We publish an [API reference](../reference/api/README.md) in our documentation.
also enable a [Swagger endpoint](../cli/server.md#--swagger-enable) on your You can also enable a
Coder deployment. [Swagger endpoint](../reference/cli/server.md#--swagger-enable) on your Coder
deployment.
## Use cases ## Use cases
@ -52,8 +53,8 @@ payloads, we recommend checking the CLI and API documentation.
Workspace agents have a special token that can send logs, metrics, and workspace Workspace agents have a special token that can send logs, metrics, and workspace
activity. activity.
- [Custom workspace logs](../api/agents.md#patch-workspace-agent-logs): Expose - [Custom workspace logs](../reference/api/agents.md#patch-workspace-agent-logs):
messages prior to the Coder init script running (e.g. pulling image, VM Expose messages prior to the Coder init script running (e.g. pulling image, VM
starting, restoring snapshot). starting, restoring snapshot).
[coder-logstream-kube](https://github.com/coder/coder-logstream-kube) uses [coder-logstream-kube](https://github.com/coder/coder-logstream-kube) uses
this to show Kubernetes events, such as image pulls or ResourceQuota this to show Kubernetes events, such as image pulls or ResourceQuota
@ -73,7 +74,7 @@ activity.
}" }"
``` ```
- [Manually send workspace activity](../api/agents.md#submit-workspace-agent-stats): - [Manually send workspace activity](../reference/api/agents.md#submit-workspace-agent-stats):
Keep a workspace "active," even if there is not an open connection (e.g. for a Keep a workspace "active," even if there is not an open connection (e.g. for a
long-running machine learning job). long-running machine learning job).

View File

@ -1,6 +1,6 @@
Coder server's primary configuration is done via environment variables. For a Coder server's primary configuration is done via environment variables. For a
full list of the options, run `coder server --help` or see our full list of the options, run `coder server --help` or see our
[CLI documentation](../cli/server.md). [CLI documentation](../reference/cli/server.md).
## Access URL ## Access URL
@ -48,10 +48,11 @@ If you are providing TLS certificates directly to the Coder server, either
1. Use a single certificate and key for both the root and wildcard domains. 1. Use a single certificate and key for both the root and wildcard domains.
2. Configure multiple certificates and keys via 2. Configure multiple certificates and keys via
[`coder.tls.secretNames`](https://github.com/coder/coder/blob/main/helm/coder/values.yaml) [`coder.tls.secretNames`](https://github.com/coder/coder/blob/main/helm/coder/values.yaml)
in the Helm Chart, or [`--tls-cert-file`](../cli/server.md#--tls-cert-file) in the Helm Chart, or
and [`--tls-key-file`](../cli/server.md#--tls-key-file) command line options [`--tls-cert-file`](../reference/cli/server.md#--tls-cert-file) and
(these both take a comma separated list of files; list certificates and their [`--tls-key-file`](../reference/cli/server.md#--tls-key-file) command line
respective keys in the same order). options (these both take a comma separated list of files; list certificates
and their respective keys in the same order).
## TLS & Reverse Proxy ## TLS & Reverse Proxy

View File

@ -7,7 +7,7 @@ preventing attackers with database access from using them to impersonate users.
## How it works ## How it works
Coder allows administrators to specify Coder allows administrators to specify
[external token encryption keys](../cli/server.md#external-token-encryption-keys). [external token encryption keys](../reference/cli/server.md#external-token-encryption-keys).
If configured, Coder will use these keys to encrypt external user tokens before If configured, Coder will use these keys to encrypt external user tokens before
storing them in the database. The encryption algorithm used is AES-256-GCM with storing them in the database. The encryption algorithm used is AES-256-GCM with
a 32-byte key length. a 32-byte key length.
@ -47,7 +47,7 @@ Additional database fields may be encrypted in the future.
- Ensure you have a valid backup of your database. **Do not skip this step.** If - Ensure you have a valid backup of your database. **Do not skip this step.** If
you are using the built-in PostgreSQL database, you can run you are using the built-in PostgreSQL database, you can run
[`coder server postgres-builtin-url`](../cli/server_postgres-builtin-url.md) [`coder server postgres-builtin-url`](../reference/cli/server_postgres-builtin-url.md)
to get the connection URL. to get the connection URL.
- Generate a 32-byte random key and base64-encode it. For example: - Generate a 32-byte random key and base64-encode it. For example:
@ -90,7 +90,7 @@ if you need to rotate keys, you can perform the following procedure:
- Generate a new encryption key following the same procedure as above. - Generate a new encryption key following the same procedure as above.
- Add the above key to the list of - Add the above key to the list of
[external token encryption keys](../cli/server.md#--external-token-encryption-keys). [external token encryption keys](../reference/cli/server.md#--external-token-encryption-keys).
**The new key must appear first in the list**. For example, in the Kubernetes **The new key must appear first in the list**. For example, in the Kubernetes
secret created above: secret created above:
@ -110,13 +110,13 @@ data:
encrypted with the old key(s). encrypted with the old key(s).
- To re-encrypt all encrypted database fields with the new key, run - To re-encrypt all encrypted database fields with the new key, run
[`coder server dbcrypt rotate`](../cli/server_dbcrypt_rotate.md). This command [`coder server dbcrypt rotate`](../reference/cli/server_dbcrypt_rotate.md).
will re-encrypt all tokens with the specified new encryption key. We recommend This command will re-encrypt all tokens with the specified new encryption key.
performing this action during a maintenance window. We recommend performing this action during a maintenance window.
> Note: this command requires direct access to the database. If you are using > Note: this command requires direct access to the database. If you are using
> the built-in PostgreSQL database, you can run > the built-in PostgreSQL database, you can run
> [`coder server postgres-builtin-url`](../cli/server_postgres-builtin-url.md) > [`coder server postgres-builtin-url`](../reference/cli/server_postgres-builtin-url.md)
> to get the connection URL. > to get the connection URL.
- Once the above command completes successfully, remove the old encryption key - Once the above command completes successfully, remove the old encryption key
@ -132,8 +132,9 @@ To disable encryption, perform the following actions:
- Stop all active coderd instances. This will prevent new encrypted data from - Stop all active coderd instances. This will prevent new encrypted data from
being written, which may cause the next step to fail. being written, which may cause the next step to fail.
- Run [`coder server dbcrypt decrypt`](../cli/server_dbcrypt_decrypt.md). This - Run
command will decrypt all encrypted user tokens and revoke all active [`coder server dbcrypt decrypt`](../reference/cli/server_dbcrypt_decrypt.md).
This command will decrypt all encrypted user tokens and revoke all active
encryption keys. encryption keys.
> Note: for `decrypt` command, the equivalent environment variable for > Note: for `decrypt` command, the equivalent environment variable for
@ -142,7 +143,7 @@ To disable encryption, perform the following actions:
> to help prevent accidentally decrypting data. > to help prevent accidentally decrypting data.
- Remove all - Remove all
[external token encryption keys](../cli/server.md#--external-token-encryption-keys) [external token encryption keys](../reference/cli/server.md#--external-token-encryption-keys)
from Coder's configuration. from Coder's configuration.
- Start coderd. You can now safely delete the encryption keys from your secret - Start coderd. You can now safely delete the encryption keys from your secret
@ -159,12 +160,13 @@ To delete all encrypted data from your database, perform the following actions:
- Stop all active coderd instances. This will prevent new encrypted data from - Stop all active coderd instances. This will prevent new encrypted data from
being written. being written.
- Run [`coder server dbcrypt delete`](../cli/server_dbcrypt_delete.md). This - Run
command will delete all encrypted user tokens and revoke all active encryption [`coder server dbcrypt delete`](../reference/cli/server_dbcrypt_delete.md).
keys. This command will delete all encrypted user tokens and revoke all active
encryption keys.
- Remove all - Remove all
[external token encryption keys](../cli/server.md#--external-token-encryption-keys) [external token encryption keys](../reference/cli/server.md#--external-token-encryption-keys)
from Coder's configuration. from Coder's configuration.
- Start coderd. You can now safely delete the encryption keys from your secret - Start coderd. You can now safely delete the encryption keys from your secret

View File

@ -4,7 +4,8 @@ Coder includes an operator-friendly deployment health page that provides a
number of details about the health of your Coder deployment. number of details about the health of your Coder deployment.
You can view it at `https://${CODER_URL}/health`, or you can alternatively view You can view it at `https://${CODER_URL}/health`, or you can alternatively view
the [JSON response directly](../api/debug.md#debug-info-deployment-health). the
[JSON response directly](../reference/api/debug.md#debug-info-deployment-health).
The deployment health page is broken up into the following sections: The deployment health page is broken up into the following sections:
@ -106,8 +107,8 @@ query fails.
_Database Latency High_ _Database Latency High_
**Problem:** This code is returned if the median latency is higher than the **Problem:** This code is returned if the median latency is higher than the
[configured threshold](../cli/server.md#--health-check-threshold-database). This [configured threshold](../reference/cli/server.md#--health-check-threshold-database).
may not be an error as such, but is an indication of a potential issue. This may not be an error as such, but is an indication of a potential issue.
**Solution:** Investigate the sizing of the configured database with regard to **Solution:** Investigate the sizing of the configured database with regard to
Coder's current activity and usage. It may be necessary to increase the Coder's current activity and usage. It may be necessary to increase the
@ -117,18 +118,19 @@ configured threshold to a higher value (this will not address the root cause).
> [!TIP] > [!TIP]
> >
> - You can enable > - You can enable
> [detailed database metrics](../cli/server.md#--prometheus-collect-db-metrics) > [detailed database metrics](../reference/cli/server.md#--prometheus-collect-db-metrics)
> in Coder's Prometheus endpoint. > in Coder's Prometheus endpoint.
> - If you have [tracing enabled](../cli/server.md#--trace), these traces may > - If you have [tracing enabled](../reference/cli/server.md#--trace), these
> also contain useful information regarding Coder's database activity. > traces may also contain useful information regarding Coder's database
> activity.
## DERP ## DERP
Coder workspace agents may use Coder workspace agents may use
[DERP (Designated Encrypted Relay for Packets)](https://tailscale.com/blog/how-tailscale-works/#encrypted-tcp-relays-derp) [DERP (Designated Encrypted Relay for Packets)](https://tailscale.com/blog/how-tailscale-works/#encrypted-tcp-relays-derp)
to communicate with Coder. This requires connectivity to a number of configured to communicate with Coder. This requires connectivity to a number of configured
[DERP servers](../cli/server.md#--derp-config-path) which are used to relay [DERP servers](../reference/cli/server.md#--derp-config-path) which are used to
traffic between Coder and workspace agents. Coder periodically queries the relay traffic between Coder and workspace agents. Coder periodically queries the
health of its configured DERP servers and may return one or more of the health of its configured DERP servers and may return one or more of the
following: following:
@ -146,7 +148,7 @@ misconfigured reverse HTTP proxy. Additionally, while workspace users should
still be able to reach their workspaces, connection performance may be degraded. still be able to reach their workspaces, connection performance may be degraded.
> **Note:** This may also be shown if you have > **Note:** This may also be shown if you have
> [forced websocket connections for DERP](../cli/server.md#--derp-force-websockets). > [forced websocket connections for DERP](../reference/cli/server.md#--derp-force-websockets).
**Solution:** ensure that any proxies you use allow connection upgrade with the **Solution:** ensure that any proxies you use allow connection upgrade with the
`Upgrade: derp` header. `Upgrade: derp` header.
@ -179,9 +181,9 @@ to establish [direct connections](../networking/stun.md). Without at least one
working STUN server, direct connections may not be possible. working STUN server, direct connections may not be possible.
**Solution:** Ensure that the **Solution:** Ensure that the
[configured STUN severs](../cli/server.md#derp-server-stun-addresses) are [configured STUN severs](../reference/cli/server.md#derp-server-stun-addresses)
reachable from Coder and that UDP traffic can be sent/received on the configured are reachable from Coder and that UDP traffic can be sent/received on the
port. configured port.
### ESTUN02 ### ESTUN02
@ -292,8 +294,8 @@ be built until there is at least one provisioner daemon running.
If you are using If you are using
[External Provisioner Daemons](./provisioners.md#external-provisioners), ensure [External Provisioner Daemons](./provisioners.md#external-provisioners), ensure
that they are able to successfully connect to Coder. Otherwise, ensure that they are able to successfully connect to Coder. Otherwise, ensure
[`--provisioner-daemons`](../cli/server.md#provisioner-daemons) is set to a [`--provisioner-daemons`](../reference/cli/server.md#provisioner-daemons) is set
value greater than 0. to a value greater than 0.
> Note: This may be a transient issue if you are currently in the process of > Note: This may be a transient issue if you are currently in the process of
> updating your deployment. > updating your deployment.

View File

@ -1,9 +1,9 @@
# External provisioners # External provisioners
By default, the Coder server runs By default, the Coder server runs
[built-in provisioner daemons](../cli/server.md#provisioner-daemons), which [built-in provisioner daemons](../reference/cli/server.md#provisioner-daemons),
execute `terraform` during workspace and template builds. However, there are which execute `terraform` during workspace and template builds. However, there
sometimes benefits to running external provisioner daemons: are sometimes benefits to running external provisioner daemons:
- **Secure build environments:** Run build jobs in isolated containers, - **Secure build environments:** Run build jobs in isolated containers,
preventing malicious templates from gaining shell access to the Coder host. preventing malicious templates from gaining shell access to the Coder host.
@ -26,40 +26,40 @@ For example, running 30 provisioner containers will allow 30 users to start
workspaces at the same time. workspaces at the same time.
Provisioners are started with the Provisioners are started with the
[coder provisionerd start](../cli/provisionerd_start.md) command. [coder provisionerd start](../reference/cli/provisionerd_start.md) command.
## Authentication ## Authentication
The provisioner daemon must authenticate with your Coder deployment. The provisioner daemon must authenticate with your Coder deployment.
Set a Set a
[provisioner daemon pre-shared key (PSK)](../cli/server.md#--provisioner-daemon-psk) [provisioner daemon pre-shared key (PSK)](../reference/cli/server.md#--provisioner-daemon-psk)
on the Coder server and start the provisioner with on the Coder server and start the provisioner with
`coder provisionerd start --psk <your-psk>`. If you are `coder provisionerd start --psk <your-psk>`. If you are
[installing with Helm](../install/kubernetes.md#install-coder-with-helm), see [installing with Helm](../install/kubernetes.md#install-coder-with-helm), see
the [Helm example](#example-running-an-external-provisioner-with-helm) below. the [Helm example](#example-running-an-external-provisioner-with-helm) below.
> Coder still supports authenticating the provisioner daemon with a > Coder still supports authenticating the provisioner daemon with a
> [token](../cli.md#--token) from a user with the Template Admin or Owner role. > [token](../reference/cli/README.md#--token) from a user with the Template
> This method is deprecated in favor of the PSK, which only has permission to > Admin or Owner role. This method is deprecated in favor of the PSK, which only
> access provisioner daemon APIs. We recommend migrating to the PSK as soon as > has permission to access provisioner daemon APIs. We recommend migrating to
> practical. > the PSK as soon as practical.
## Types of provisioners ## Types of provisioners
Provisioners can broadly be categorized by scope: `organization` or `user`. The Provisioners can broadly be categorized by scope: `organization` or `user`. The
scope of a provisioner can be specified with scope of a provisioner can be specified with
[`-tag=scope=<scope>`](../cli/provisionerd_start.md#t---tag) when starting the [`-tag=scope=<scope>`](../reference/cli/provisionerd_start.md#t---tag) when
provisioner daemon. Only users with at least the starting the provisioner daemon. Only users with at least the
[Template Admin](../admin/users.md#roles) role or higher may create [Template Admin](../admin/users.md#roles) role or higher may create
organization-scoped provisioner daemons. organization-scoped provisioner daemons.
There are two exceptions: There are two exceptions:
- [Built-in provisioners](../cli/server.md#provisioner-daemons) are always - [Built-in provisioners](../reference/cli/server.md#provisioner-daemons) are
organization-scoped. always organization-scoped.
- External provisioners started using a - External provisioners started using a
[pre-shared key (PSK)](../cli/provisionerd_start.md#psk) are always [pre-shared key (PSK)](../reference/cli/provisionerd_start.md#psk) are always
organization-scoped. organization-scoped.
### Organization-Scoped Provisioners ### Organization-Scoped Provisioners
@ -270,7 +270,7 @@ docker run --rm -it \
As mentioned above, the Coder server will run built-in provisioners by default. As mentioned above, the Coder server will run built-in provisioners by default.
This can be disabled with a server-wide This can be disabled with a server-wide
[flag or environment variable](../cli/server.md#provisioner-daemons). [flag or environment variable](../reference/cli/server.md#provisioner-daemons).
```shell ```shell
coder server --provisioner-daemons=0 coder server --provisioner-daemons=0

View File

@ -112,13 +112,14 @@ on the workload size to ensure deployment stability.
#### CPU and memory usage #### CPU and memory usage
Enabling [agent stats collection](../../cli.md#--prometheus-collect-agent-stats) Enabling
[agent stats collection](../../reference/cli/server.md#--prometheus-collect-agent-stats)
(optional) may increase memory consumption. (optional) may increase memory consumption.
Enabling direct connections between users and workspace agents (apps or SSH Enabling direct connections between users and workspace agents (apps or SSH
traffic) can help prevent an increase in CPU usage. It is recommended to keep traffic) can help prevent an increase in CPU usage. It is recommended to keep
[this option enabled](../../cli.md#--disable-direct-connections) unless there [this option enabled](../../reference/cli/server.md#--disable-direct-connections)
are compelling reasons to disable it. unless there are compelling reasons to disable it.
Inactive users do not consume Coder resources. Inactive users do not consume Coder resources.

View File

@ -26,8 +26,8 @@ Workspace proxies can be used in the browser by navigating to the user
## Requirements ## Requirements
- The [Coder CLI](../cli.md) must be installed and authenticated as a user with - The [Coder CLI](../reference/cli/README.md) must be installed and
the Owner role. authenticated as a user with the Owner role.
## Step 1: Create the proxy ## Step 1: Create the proxy

View File

@ -324,7 +324,7 @@ could affect workspace users experience once the platform is live.
identify the required values for deployment. identify the required values for deployment.
1. Create a `values.yaml` and add it to your version control system. 1. Create a `values.yaml` and add it to your version control system.
1. Determine the necessary environment variables. Here is the 1. Determine the necessary environment variables. Here is the
[full list of supported server environment variables](../cli/server.md). [full list of supported server environment variables](../reference/cli/server.md).
1. Follow our documented 1. Follow our documented
[steps for installing Coder via Helm](../install/kubernetes.md). [steps for installing Coder via Helm](../install/kubernetes.md).

View File

@ -1,174 +0,0 @@
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder
## Usage
```console
coder [global-flags] <subcommand>
```
## Description
```console
Coder — A tool for provisioning self-hosted development environments with Terraform.
- Start a Coder server:
$ coder server
- Get started by creating a template from an example:
$ coder templates init
```
## Subcommands
| Name | Purpose |
| ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------- |
| [<code>dotfiles</code>](./cli/dotfiles.md) | Personalize your workspace by applying a canonical dotfiles repository |
| [<code>external-auth</code>](./cli/external-auth.md) | Manage external authentication |
| [<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>notifications</code>](./cli/notifications.md) | Manage Coder notifications |
| [<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>publickey</code>](./cli/publickey.md) | Output your Coder public key used for Git operations |
| [<code>reset-password</code>](./cli/reset-password.md) | Directly connect to the database to reset a user's password |
| [<code>state</code>](./cli/state.md) | Manually manage Terraform state to fix broken workspaces |
| [<code>templates</code>](./cli/templates.md) | Manage templates |
| [<code>tokens</code>](./cli/tokens.md) | Manage personal access tokens |
| [<code>users</code>](./cli/users.md) | Manage users |
| [<code>version</code>](./cli/version.md) | Show coder version |
| [<code>autoupdate</code>](./cli/autoupdate.md) | Toggle auto-update policy for a workspace |
| [<code>config-ssh</code>](./cli/config-ssh.md) | Add an SSH Host entry for your workspaces "ssh coder.workspace" |
| [<code>create</code>](./cli/create.md) | Create a workspace |
| [<code>delete</code>](./cli/delete.md) | Delete a workspace |
| [<code>favorite</code>](./cli/favorite.md) | Add a workspace to your favorites |
| [<code>list</code>](./cli/list.md) | List workspaces |
| [<code>open</code>](./cli/open.md) | Open a workspace |
| [<code>ping</code>](./cli/ping.md) | Ping a workspace |
| [<code>rename</code>](./cli/rename.md) | Rename a workspace |
| [<code>restart</code>](./cli/restart.md) | Restart a workspace |
| [<code>schedule</code>](./cli/schedule.md) | Schedule automated start and stop times for workspaces |
| [<code>show</code>](./cli/show.md) | Display details of a workspace's resources and agents |
| [<code>speedtest</code>](./cli/speedtest.md) | Run upload and download tests from your machine to a workspace |
| [<code>ssh</code>](./cli/ssh.md) | Start a shell into a workspace |
| [<code>start</code>](./cli/start.md) | Start a workspace |
| [<code>stat</code>](./cli/stat.md) | Show resource usage for the current workspace. |
| [<code>stop</code>](./cli/stop.md) | Stop a workspace |
| [<code>unfavorite</code>](./cli/unfavorite.md) | Remove a workspace from your favorites |
| [<code>update</code>](./cli/update.md) | Will update and start a given workspace if it is out of date |
| [<code>whoami</code>](./cli/whoami.md) | Fetch authenticated user info for Coder deployment |
| [<code>support</code>](./cli/support.md) | Commands for troubleshooting issues with a Coder deployment. |
| [<code>server</code>](./cli/server.md) | Start a Coder server |
| [<code>features</code>](./cli/features.md) | List Enterprise features |
| [<code>licenses</code>](./cli/licenses.md) | Add, delete, and list licenses |
| [<code>groups</code>](./cli/groups.md) | Manage groups |
| [<code>provisionerd</code>](./cli/provisionerd.md) | Manage provisioner daemons |
## Options
### --url
| | |
| ----------- | ----------------------- |
| Type | <code>url</code> |
| Environment | <code>$CODER_URL</code> |
URL to a deployment.
### --debug-options
| | |
| ---- | ----------------- |
| Type | <code>bool</code> |
Print all options, how they're set, then exit.
### --token
| | |
| ----------- | --------------------------------- |
| Type | <code>string</code> |
| Environment | <code>$CODER_SESSION_TOKEN</code> |
Specify an authentication token. For security reasons setting
CODER_SESSION_TOKEN is preferred.
### --no-version-warning
| | |
| ----------- | -------------------------------------- |
| Type | <code>bool</code> |
| Environment | <code>$CODER_NO_VERSION_WARNING</code> |
Suppress warning when client and server versions do not match.
### --no-feature-warning
| | |
| ----------- | -------------------------------------- |
| Type | <code>bool</code> |
| Environment | <code>$CODER_NO_FEATURE_WARNING</code> |
Suppress warnings about unlicensed features.
### --header
| | |
| ----------- | -------------------------- |
| Type | <code>string-array</code> |
| Environment | <code>$CODER_HEADER</code> |
Additional HTTP headers added to all requests. Provide as key=value. Can be
specified multiple times.
### --header-command
| | |
| ----------- | ---------------------------------- |
| Type | <code>string</code> |
| Environment | <code>$CODER_HEADER_COMMAND</code> |
An external command that outputs additional HTTP headers added to all requests.
The command must output each header as `key=value` on its own line.
### -v, --verbose
| | |
| ----------- | --------------------------- |
| Type | <code>bool</code> |
| Environment | <code>$CODER_VERBOSE</code> |
Enable verbose output.
### --disable-direct-connections
| | |
| ----------- | ---------------------------------------------- |
| Type | <code>bool</code> |
| Environment | <code>$CODER_DISABLE_DIRECT_CONNECTIONS</code> |
Disable direct (P2P) connections to workspaces.
### --disable-network-telemetry
| | |
| ----------- | --------------------------------------------- |
| Type | <code>bool</code> |
| Environment | <code>$CODER_DISABLE_NETWORK_TELEMETRY</code> |
Disable network telemetry. Network telemetry is collected when connecting to
workspaces using the CLI, and is forwarded to the server. If telemetry is also
enabled on the server, it may be sent to Coder. Network telemetry is used to
measure network quality and detect regressions.
### --global-config
| | |
| ----------- | ------------------------------ |
| Type | <code>string</code> |
| Environment | <code>$CODER_CONFIG_DIR</code> |
| Default | <code>~/.config/coderv2</code> |
Path to the global `coder` config directory.

View File

@ -34,32 +34,32 @@ A brief overview of all files contained in the bundle is provided below:
> Note: detailed descriptions of all the information available in the bundle is > Note: detailed descriptions of all the information available in the bundle is
> out of scope, as support bundles are primarily intended for internal use. > out of scope, as support bundles are primarily intended for internal use.
| Filename | Description | | Filename | Description |
| --------------------------------- | ------------------------------------------------------------------------------------------------ | | --------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| `agent/agent.json` | The agent used to connect to the workspace with environment variables stripped. | | `agent/agent.json` | The agent used to connect to the workspace with environment variables stripped. |
| `agent/agent_magicsock.html` | The contents of the HTTP debug endpoint of the agent's Tailscale connection. | | `agent/agent_magicsock.html` | The contents of the HTTP debug endpoint of the agent's Tailscale connection. |
| `agent/client_magicsock.html` | The contents of the HTTP debug endpoint of the client's Tailscale connection. | | `agent/client_magicsock.html` | The contents of the HTTP debug endpoint of the client's Tailscale connection. |
| `agent/listening_ports.json` | The listening ports detected by the selected agent running in the workspace. | | `agent/listening_ports.json` | The listening ports detected by the selected agent running in the workspace. |
| `agent/logs.txt` | The logs of the selected agent running in the workspace. | | `agent/logs.txt` | The logs of the selected agent running in the workspace. |
| `agent/manifest.json` | The manifest of the selected agent with environment variables stripped. | | `agent/manifest.json` | The manifest of the selected agent with environment variables stripped. |
| `agent/startup_logs.txt` | Startup logs of the workspace agent. | | `agent/startup_logs.txt` | Startup logs of the workspace agent. |
| `agent/prometheus.txt` | The contents of the agent's Prometheus endpoint. | | `agent/prometheus.txt` | The contents of the agent's Prometheus endpoint. |
| `cli_logs.txt` | Logs from running the `coder support bundle` command. | | `cli_logs.txt` | Logs from running the `coder support bundle` command. |
| `deployment/buildinfo.json` | Coder version and build information. | | `deployment/buildinfo.json` | Coder version and build information. |
| `deployment/config.json` | Deployment [configuration](../api/general.md#get-deployment-config), with secret values removed. | | `deployment/config.json` | Deployment [configuration](../reference/api/general.md#get-deployment-config), with secret values removed. |
| `deployment/experiments.json` | Any [experiments](../cli/server.md#experiments) currently enabled for the deployment. | | `deployment/experiments.json` | Any [experiments](../reference/cli/server.md#experiments) currently enabled for the deployment. |
| `deployment/health.json` | A snapshot of the [health status](../admin/healthcheck.md) of the deployment. | | `deployment/health.json` | A snapshot of the [health status](../admin/healthcheck.md) of the deployment. |
| `logs.txt` | Logs from the `codersdk.Client` used to generate the bundle. | | `logs.txt` | Logs from the `codersdk.Client` used to generate the bundle. |
| `network/connection_info.json` | Information used by workspace agents used to connect to Coder (DERP map etc.) | | `network/connection_info.json` | Information used by workspace agents used to connect to Coder (DERP map etc.) |
| `network/coordinator_debug.html` | Peers currently connected to each Coder instance and the tunnels established between peers. | | `network/coordinator_debug.html` | Peers currently connected to each Coder instance and the tunnels established between peers. |
| `network/netcheck.json` | Results of running `coder netcheck` locally. | | `network/netcheck.json` | Results of running `coder netcheck` locally. |
| `network/tailnet_debug.html` | Tailnet coordinators, their heartbeat ages, connected peers, and tunnels. | | `network/tailnet_debug.html` | Tailnet coordinators, their heartbeat ages, connected peers, and tunnels. |
| `workspace/build_logs.txt` | Build logs of the selected workspace. | | `workspace/build_logs.txt` | Build logs of the selected workspace. |
| `workspace/workspace.json` | Details of the selected workspace. | | `workspace/workspace.json` | Details of the selected workspace. |
| `workspace/parameters.json` | Build parameters of the selected workspace. | | `workspace/parameters.json` | Build parameters of the selected workspace. |
| `workspace/template.json` | The template currently in use by the selected workspace. | | `workspace/template.json` | The template currently in use by the selected workspace. |
| `workspace/template_file.zip` | The source code of the template currently in use by the selected workspace. | | `workspace/template_file.zip` | The source code of the template currently in use by the selected workspace. |
| `workspace/template_version.json` | The template version currently in use by the selected workspace. | | `workspace/template_version.json` | The template version currently in use by the selected workspace. |
## How do I generate a Support Bundle? ## How do I generate a Support Bundle?
@ -72,8 +72,8 @@ A brief overview of all files contained in the bundle is provided below:
> Note: It is recommended to generate a support bundle from a location > Note: It is recommended to generate a support bundle from a location
> experiencing workspace connectivity issues. > experiencing workspace connectivity issues.
3. Ensure you are [logged in](../cli/login.md#login) to your Coder deployment as 3. Ensure you are [logged in](../reference/cli/login.md#login) to your Coder
a user with the Owner privilege. deployment as a user with the Owner privilege.
4. Run `coder support bundle [owner/workspace]`, and respond `yes` to the 4. Run `coder support bundle [owner/workspace]`, and respond `yes` to the
prompt. The support bundle will be generated in the current directory with prompt. The support bundle will be generated in the current directory with

View File

@ -6,15 +6,15 @@ environments. However, some changes to your configuration are necessary.
> This is a general comparison. Keep reading for a full tutorial running Coder > This is a general comparison. Keep reading for a full tutorial running Coder
> offline with Kubernetes or Docker. > offline with Kubernetes or Docker.
| | Public deployments | Offline deployments | | | Public deployments | Offline deployments |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Terraform binary | By default, Coder downloads Terraform binary from [releases.hashicorp.com](https://releases.hashicorp.com) | Terraform binary must be included in `PATH` for the VM or container image. [Supported versions](https://github.com/coder/coder/blob/main/provisioner/terraform/install.go#L23-L24) | | Terraform binary | By default, Coder downloads Terraform binary from [releases.hashicorp.com](https://releases.hashicorp.com) | Terraform binary must be included in `PATH` for the VM or container image. [Supported versions](https://github.com/coder/coder/blob/main/provisioner/terraform/install.go#L23-L24) |
| Terraform registry | Coder templates will attempt to download providers from [registry.terraform.io](https://registry.terraform.io) or [custom source addresses](https://developer.hashicorp.com/terraform/language/providers/requirements#source-addresses) specified in each template | [Custom source addresses](https://developer.hashicorp.com/terraform/language/providers/requirements#source-addresses) can be specified in each Coder template, or a custom registry/mirror can be used. More details below | | Terraform registry | Coder templates will attempt to download providers from [registry.terraform.io](https://registry.terraform.io) or [custom source addresses](https://developer.hashicorp.com/terraform/language/providers/requirements#source-addresses) specified in each template | [Custom source addresses](https://developer.hashicorp.com/terraform/language/providers/requirements#source-addresses) can be specified in each Coder template, or a custom registry/mirror can be used. More details below |
| STUN | By default, Coder uses Google's public STUN server for direct workspace connections | STUN can be safely [disabled](../cli/server.md#--derp-server-stun-addresses), users can still connect via [relayed connections](../networking/index.md#-geo-distribution). Alternatively, you can set a [custom DERP server](../cli/server.md#--derp-server-stun-addresses) | | STUN | By default, Coder uses Google's public STUN server for direct workspace connections | STUN can be safely [disabled](../reference/ users can still connect via [relayed connections](../networking/index.md#-geo-distribution). Alternatively, you can set a [custom DERP server](../reference/cli/server.md#--derp-server-stun-addresses) |
| DERP | By default, Coder's built-in DERP relay can be used, or [Tailscale's public relays](../networking/index.md#relayed-connections). | By default, Coder's built-in DERP relay can be used, or [custom relays](../networking/index.md#custom-relays). | | DERP | By default, Coder's built-in DERP relay can be used, or [Tailscale's public relays](../networking/index.md#relayed-connections). | By default, Coder's built-in DERP relay can be used, or [custom relays](../networking/index.md#custom-relays). |
| PostgreSQL | If no [PostgreSQL connection URL](../cli/server.md#--postgres-url) is specified, Coder will download Postgres from [repo1.maven.org](https://repo1.maven.org) | An external database is required, you must specify a [PostgreSQL connection URL](../cli/server.md#--postgres-url) | | PostgreSQL | If no [PostgreSQL connection URL](../reference/cli/server.md#--postgres-url) is specified, Coder will download Postgres from [repo1.maven.org](https://repo1.maven.org) | An external database is required, you must specify a [PostgreSQL connection URL](../reference/cli/server.md#--postgres-url) |
| Telemetry | Telemetry is on by default, and [can be disabled](../cli/server.md#--telemetry) | Telemetry [can be disabled](../cli/server.md#--telemetry) | | Telemetry | Telemetry is on by default, and [can be disabled](../reference/cli/server.md#--telemetry) | Telemetry [can be disabled](../reference/cli/server.md#--telemetry) |
| Update check | By default, Coder checks for updates from [GitHub releases](https:/github.com/coder/coder/releases) | Update checks [can be disabled](../cli/server.md#--update-check) | | Update check | By default, Coder checks for updates from [GitHub releases](https:/github.com/coder/coder/releases) | Update checks [can be disabled](../reference/cli/server.md#--update-check) |
## Offline container images ## Offline container images
@ -223,9 +223,9 @@ server, as demonstrated in the example below:
3. Extract the file and move its contents to your server folder. 3. Extract the file and move its contents to your server folder.
4. If you are using NodeJS, you can execute the following command: 4. If you are using NodeJS, you can execute the following command:
`cd docs && npx http-server .` `cd docs && npx http-server .`
5. Set the [CODER_DOCS_URL](../cli/server.md#--docs-url) environment variable to 5. Set the [CODER_DOCS_URL](../reference/cli/server.md#--docs-url) environment
use the URL of your hosted docs. This way, the Coder UI will reference the variable to use the URL of your hosted docs. This way, the Coder UI will
documentation from your specified URL. reference the documentation from your specified URL.
With these steps, you'll have the Coder documentation hosted on your server and With these steps, you'll have the Coder documentation hosted on your server and
accessible for your team to use. accessible for your team to use.

File diff suppressed because it is too large Load Diff

View File

@ -33,24 +33,24 @@ In order for clients to be able to establish direct connections:
`coder port-forward`). Note that the `coder port-forward`). Note that the
[VSCode extension](https://marketplace.visualstudio.com/items?itemName=coder.coder-remote) [VSCode extension](https://marketplace.visualstudio.com/items?itemName=coder.coder-remote)
and [JetBrains Plugin](https://plugins.jetbrains.com/plugin/19620-coder/), and and [JetBrains Plugin](https://plugins.jetbrains.com/plugin/19620-coder/), and
[`ssh coder.<workspace>`](../cli/config-ssh.md) all utilize the CLI to [`ssh coder.<workspace>`](../reference/cli/config-ssh.md) all utilize the CLI
establish a workspace connection. to establish a workspace connection.
- Either the client or workspace agent are able to discover a reachable - Either the client or workspace agent are able to discover a reachable
`ip:port` of their counterpart. If the agent and client are able to `ip:port` of their counterpart. If the agent and client are able to
communicate with each other using their locally assigned IP addresses, then a communicate with each other using their locally assigned IP addresses, then a
direct connection can be established immediately. Otherwise, the client and direct connection can be established immediately. Otherwise, the client and
agent will contact agent will contact
[the configured STUN servers](../cli/server.md#derp-server-stun-addresses) to [the configured STUN servers](../reference/cli/server.md#derp-server-stun-addresses)
try and determine which `ip:port` can be used to communicate with their to try and determine which `ip:port` can be used to communicate with their
counterpart. See [STUN and NAT](./stun.md) for more details on how this counterpart. See [STUN and NAT](./stun.md) for more details on how this
process works. process works.
- All outbound UDP traffic must be allowed for both the client and the agent on - All outbound UDP traffic must be allowed for both the client and the agent on
**all ports** to each others' respective networks. **all ports** to each others' respective networks.
- To establish a direct connection, both agent and client use STUN. This - To establish a direct connection, both agent and client use STUN. This
involves sending UDP packets outbound on `udp/3478` to the configured involves sending UDP packets outbound on `udp/3478` to the configured
[STUN server](../cli/server.md#--derp-server-stun-addresses). If either the [STUN server](../reference/cli/server.md#--derp-server-stun-addresses). If
agent or the client are unable to send and receive UDP packets to a STUN either the agent or the client are unable to send and receive UDP packets to
server, then direct connections will not be possible. a STUN server, then direct connections will not be possible.
- Both agents and clients will then establish a - Both agents and clients will then establish a
[WireGuard](https://www.wireguard.com/) tunnel and send UDP traffic on [WireGuard](https://www.wireguard.com/) tunnel and send UDP traffic on
ephemeral (high) ports. If a firewall between the client and the agent ephemeral (high) ports. If a firewall between the client and the agent
@ -103,7 +103,7 @@ for more information on how this process works.
If a direct connection is not available (e.g. client or server is behind NAT), If a direct connection is not available (e.g. client or server is behind NAT),
Coder will use a relayed connection. By default, Coder will use a relayed connection. By default,
[Coder uses Google's public STUN server](../cli/server.md#--derp-server-stun-addresses), [Coder uses Google's public STUN server](../reference/cli/server.md#--derp-server-stun-addresses),
but this can be disabled or changed for but this can be disabled or changed for
[offline deployments](../install/offline.md). [offline deployments](../install/offline.md).

6
docs/reference/README.md Normal file
View File

@ -0,0 +1,6 @@
# Reference
Autogenerated documentation around Coder.
- [REST API](./api)
- [Command Line](./cli)

View File

@ -18,10 +18,10 @@ curl https://coder.example.com/api/v2/workspaces?q=owner:me \
## Use cases ## Use cases
See some common [use cases](../admin/automation.md#use-cases) for the REST API. See some common [use cases](../../admin/automation.md#use-cases) for the REST API.
## Sections ## Sections
<children> <children>
This page is rendered on https://coder.com/docs/coder-oss/api. Refer to the other documents in the `api/` directory. This page is rendered on https://coder.com/docs/reference/api. Refer to the other documents in the `api/` directory.
</children> </children>

168
docs/reference/cli/README.md generated Normal file
View File

@ -0,0 +1,168 @@
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder
## Usage
```console
coder [global-flags] <subcommand>
```
## Description
```console
Coder — A tool for provisioning self-hosted development environments with Terraform.
- Start a Coder server:
$ coder server
- Get started by creating a template from an example:
$ coder templates init
```
## Subcommands
| Name | Purpose |
| -------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| [<code>dotfiles</code>](./dotfiles.md) | Personalize your workspace by applying a canonical dotfiles repository |
| [<code>external-auth</code>](./external-auth.md) | Manage external authentication |
| [<code>login</code>](./login.md) | Authenticate with Coder deployment |
| [<code>logout</code>](./logout.md) | Unauthenticate your local session |
| [<code>netcheck</code>](./netcheck.md) | Print network debug information for DERP and STUN |
| [<code>notifications</code>](./notifications.md) | Manage Coder notifications |
| [<code>port-forward</code>](./port-forward.md) | Forward ports from a workspace to the local machine. For reverse port forwarding, use "coder ssh -R". |
| [<code>publickey</code>](./publickey.md) | Output your Coder public key used for Git operations |
| [<code>reset-password</code>](./reset-password.md) | Directly connect to the database to reset a user's password |
| [<code>state</code>](./state.md) | Manually manage Terraform state to fix broken workspaces |
| [<code>templates</code>](./templates.md) | Manage templates |
| [<code>tokens</code>](./tokens.md) | Manage personal access tokens |
| [<code>users</code>](./users.md) | Manage users |
| [<code>version</code>](./version.md) | Show coder version |
| [<code>autoupdate</code>](./autoupdate.md) | Toggle auto-update policy for a workspace |
| [<code>config-ssh</code>](./config-ssh.md) | Add an SSH Host entry for your workspaces "ssh coder.workspace" |
| [<code>create</code>](./create.md) | Create a workspace |
| [<code>delete</code>](./delete.md) | Delete a workspace |
| [<code>favorite</code>](./favorite.md) | Add a workspace to your favorites |
| [<code>list</code>](./list.md) | List workspaces |
| [<code>open</code>](./open.md) | Open a workspace |
| [<code>ping</code>](./ping.md) | Ping a workspace |
| [<code>rename</code>](./rename.md) | Rename a workspace |
| [<code>restart</code>](./restart.md) | Restart a workspace |
| [<code>schedule</code>](./schedule.md) | Schedule automated start and stop times for workspaces |
| [<code>show</code>](./show.md) | Display details of a workspace's resources and agents |
| [<code>speedtest</code>](./speedtest.md) | Run upload and download tests from your machine to a workspace |
| [<code>ssh</code>](./ssh.md) | Start a shell into a workspace |
| [<code>start</code>](./start.md) | Start a workspace |
| [<code>stat</code>](./stat.md) | Show resource usage for the current workspace. |
| [<code>stop</code>](./stop.md) | Stop a workspace |
| [<code>unfavorite</code>](./unfavorite.md) | Remove a workspace from your favorites |
| [<code>update</code>](./update.md) | Will update and start a given workspace if it is out of date |
| [<code>whoami</code>](./whoami.md) | Fetch authenticated user info for Coder deployment |
| [<code>support</code>](./support.md) | Commands for troubleshooting issues with a Coder deployment. |
| [<code>server</code>](./server.md) | Start a Coder server |
| [<code>features</code>](./features.md) | List Enterprise features |
| [<code>licenses</code>](./licenses.md) | Add, delete, and list licenses |
| [<code>groups</code>](./groups.md) | Manage groups |
| [<code>provisionerd</code>](./provisionerd.md) | Manage provisioner daemons |
## Options
### --url
| | |
| ----------- | ----------------------- |
| Type | <code>url</code> |
| Environment | <code>$CODER_URL</code> |
URL to a deployment.
### --debug-options
| | |
| ---- | ----------------- |
| Type | <code>bool</code> |
Print all options, how they're set, then exit.
### --token
| | |
| ----------- | --------------------------------- |
| Type | <code>string</code> |
| Environment | <code>$CODER_SESSION_TOKEN</code> |
Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
### --no-version-warning
| | |
| ----------- | -------------------------------------- |
| Type | <code>bool</code> |
| Environment | <code>$CODER_NO_VERSION_WARNING</code> |
Suppress warning when client and server versions do not match.
### --no-feature-warning
| | |
| ----------- | -------------------------------------- |
| Type | <code>bool</code> |
| Environment | <code>$CODER_NO_FEATURE_WARNING</code> |
Suppress warnings about unlicensed features.
### --header
| | |
| ----------- | -------------------------- |
| Type | <code>string-array</code> |
| Environment | <code>$CODER_HEADER</code> |
Additional HTTP headers added to all requests. Provide as key=value. Can be specified multiple times.
### --header-command
| | |
| ----------- | ---------------------------------- |
| Type | <code>string</code> |
| Environment | <code>$CODER_HEADER_COMMAND</code> |
An external command that outputs additional HTTP headers added to all requests. The command must output each header as `key=value` on its own line.
### -v, --verbose
| | |
| ----------- | --------------------------- |
| Type | <code>bool</code> |
| Environment | <code>$CODER_VERBOSE</code> |
Enable verbose output.
### --disable-direct-connections
| | |
| ----------- | ---------------------------------------------- |
| Type | <code>bool</code> |
| Environment | <code>$CODER_DISABLE_DIRECT_CONNECTIONS</code> |
Disable direct (P2P) connections to workspaces.
### --disable-network-telemetry
| | |
| ----------- | --------------------------------------------- |
| Type | <code>bool</code> |
| Environment | <code>$CODER_DISABLE_NETWORK_TELEMETRY</code> |
Disable network telemetry. Network telemetry is collected when connecting to workspaces using the CLI, and is forwarded to the server. If telemetry is also enabled on the server, it may be sent to Coder. Network telemetry is used to measure network quality and detect regressions.
### --global-config
| | |
| ----------- | ------------------------------ |
| Type | <code>string</code> |
| Environment | <code>$CODER_CONFIG_DIR</code> |
| Default | <code>~/.config/coderv2</code> |
Path to the global `coder` config directory.

Some files were not shown because too many files have changed in this diff Show More