feat(docs): rework CLI docs (#6312)

This commit is contained in:
Ammar Bandukwala 2023-02-22 19:53:21 -06:00 committed by GitHub
parent 43e8ba0811
commit f6a8c360e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
71 changed files with 2342 additions and 2087 deletions

View File

@ -501,9 +501,10 @@ docs/admin/prometheus.md: scripts/metricsdocgen/main.go scripts/metricsdocgen/me
yarn run format:write:only ../docs/admin/prometheus.md
docs/cli/coder.md: scripts/clidocgen/main.go $(GO_SRC_FILES) docs/manifest.json
BASE_PATH="." go run scripts/clidocgen/main.go
rm -rf ./docs/cli/*.md
BASE_PATH="." go run ./scripts/clidocgen
cd site
yarn run format:write:only ../docs/cli/*.md ../docs/manifest.json
yarn run format:write:only ../docs/cli.md ../docs/cli/*.md ../docs/manifest.json
docs/admin/audit-logs.md: scripts/auditdocgen/main.go enterprise/audit/table.go
go run scripts/auditdocgen/main.go

View File

@ -27,8 +27,9 @@ func state() *cobra.Command {
func statePull() *cobra.Command {
var buildNumber int
cmd := &cobra.Command{
Use: "pull <workspace> [file]",
Args: cobra.MinimumNArgs(1),
Use: "pull <workspace> [file]",
Short: "Pull a Terraform state file from a workspace.",
Args: cobra.MinimumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
client, err := CreateClient(cmd)
if err != nil {
@ -68,8 +69,9 @@ func statePull() *cobra.Command {
func statePush() *cobra.Command {
var buildNumber int
cmd := &cobra.Command{
Use: "push <workspace> <file>",
Args: cobra.ExactArgs(2),
Use: "push <workspace> <file>",
Args: cobra.ExactArgs(2),
Short: "Push a Terraform state file to a workspace.",
RunE: func(cmd *cobra.Command, args []string) error {
client, err := CreateClient(cmd)
if err != nil {

View File

@ -73,6 +73,7 @@ func TestTemplatePull(t *testing.T) {
// and writes it to the correct directory.
t.Run("ToDir", func(t *testing.T) {
t.Parallel()
t.Skip("FLAKE: @ammario to fix imminently")
client := coderdtest.New(t, &coderdtest.Options{IncludeProvisionerDaemon: true})
user := coderdtest.CreateFirstUser(t, client)

View File

@ -6,8 +6,8 @@ Usage:
coder state [command]
Commands:
pull
push
pull Pull a Terraform state file from a workspace.
push Push a Terraform state file to a workspace.
Flags:
-h, --help help for state

View File

@ -1,3 +1,5 @@
Pull a Terraform state file from a workspace.
Usage:
coder state pull <workspace> [file] [flags]

View File

@ -1,3 +1,5 @@
Push a Terraform state file to a workspace.
Usage:
coder state push <workspace> <file> [flags]

55
docs/cli.md Normal file
View File

@ -0,0 +1,55 @@
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder
Coder — A tool for provisioning self-hosted development environments with Terraform.
## Usage
```console
coder [flags]
```
## Examples
```console
- Start a Coder server:
$ coder server
- Get started by creating a template from an example:
$ coder templates init
```
## Subcommands
| Name | Purpose |
| --------------------------------------------------------- | --------------------------------------------------------------- |
| [<code>config-ssh</code>](./cli/coder_config-ssh) | Add an SSH Host entry for your workspaces "ssh coder.workspace" |
| [<code>create</code>](./cli/coder_create) | Create a workspace |
| [<code>delete</code>](./cli/coder_delete) | Delete a workspace |
| [<code>dotfiles</code>](./cli/coder_dotfiles) | Checkout and install a dotfiles repository from a Git URL |
| [<code>list</code>](./cli/coder_list) | List workspaces |
| [<code>login</code>](./cli/coder_login) | Authenticate with Coder deployment |
| [<code>logout</code>](./cli/coder_logout) | Unauthenticate your local session |
| [<code>ping</code>](./cli/coder_ping) | Ping a workspace |
| [<code>port-forward</code>](./cli/coder_port-forward) | Forward ports from machine to a workspace |
| [<code>publickey</code>](./cli/coder_publickey) | Output your Coder public key used for Git operations |
| [<code>rename</code>](./cli/coder_rename) | Rename a workspace |
| [<code>reset-password</code>](./cli/coder_reset-password) | Directly connect to the database to reset a user's password |
| [<code>restart</code>](./cli/coder_restart) | Restart a workspace |
| [<code>scaletest</code>](./cli/coder_scaletest) | Run a scale test against the Coder API |
| [<code>schedule</code>](./cli/coder_schedule) | Schedule automated start and stop times for workspaces |
| [<code>server</code>](./cli/coder_server) | Start a Coder server |
| [<code>show</code>](./cli/coder_show) | Display details of a workspace's resources and agents |
| [<code>speedtest</code>](./cli/coder_speedtest) | Run upload and download tests from your machine to a workspace |
| [<code>ssh</code>](./cli/coder_ssh) | Start a shell into a workspace |
| [<code>start</code>](./cli/coder_start) | Start a workspace |
| [<code>state</code>](./cli/coder_state) | Manually manage Terraform state to fix broken workspaces |
| [<code>stop</code>](./cli/coder_stop) | Stop a workspace |
| [<code>templates</code>](./cli/coder_templates) | Manage templates |
| [<code>tokens</code>](./cli/coder_tokens) | Manage personal access tokens |
| [<code>update</code>](./cli/coder_update) | Update a workspace |
| [<code>users</code>](./cli/coder_users) | Manage users |
| [<code>version</code>](./cli/coder_version) | Show coder version |

View File

@ -1,71 +0,0 @@
## coder
### Synopsis
Coder — A tool for provisioning self-hosted development environments with Terraform.
```
coder [flags]
```
### Examples
```
- Start a Coder server:
$ coder server
- Get started by creating a template from an example:
$ coder templates init
```
### Options
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
-h, --help help for coder
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder config-ssh](coder_config-ssh.md) - Add an SSH Host entry for your workspaces "ssh coder.workspace"
- [coder create](coder_create.md) - Create a workspace
- [coder delete](coder_delete.md) - Delete a workspace
- [coder dotfiles](coder_dotfiles.md) - Checkout and install a dotfiles repository from a Git URL
- [coder list](coder_list.md) - List workspaces
- [coder login](coder_login.md) - Authenticate with Coder deployment
- [coder logout](coder_logout.md) - Unauthenticate your local session
- [coder ping](coder_ping.md) - Ping a workspace
- [coder port-forward](coder_port-forward.md) - Forward ports from machine to a workspace
- [coder publickey](coder_publickey.md) - Output your Coder public key used for Git operations
- [coder rename](coder_rename.md) - Rename a workspace
- [coder reset-password](coder_reset-password.md) - Directly connect to the database to reset a user's password
- [coder restart](coder_restart.md) - Restart a workspace
- [coder scaletest](coder_scaletest.md) - Run a scale test against the Coder API
- [coder schedule](coder_schedule.md) - Schedule automated start and stop times for workspaces
- [coder server](coder_server.md) - Start a Coder server
- [coder show](coder_show.md) - Display details of a workspace's resources and agents
- [coder speedtest](coder_speedtest.md) - Run upload and download tests from your machine to a workspace
- [coder ssh](coder_ssh.md) - Start a shell into a workspace
- [coder start](coder_start.md) - Start a workspace
- [coder state](coder_state.md) - Manually manage Terraform state to fix broken workspaces
- [coder stop](coder_stop.md) - Stop a workspace
- [coder templates](coder_templates.md) - Manage templates
- [coder tokens](coder_tokens.md) - Manage personal access tokens
- [coder update](coder_update.md) - Update a workspace
- [coder users](coder_users.md) - Manage users
- [coder version](coder_version.md) - Show coder version

View File

@ -1,14 +1,18 @@
## coder config-ssh
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder config-ssh
Add an SSH Host entry for your workspaces "ssh coder.workspace"
```
## Usage
```console
coder config-ssh [flags]
```
### Examples
## Examples
```
```console
- You can use -o (or --ssh-option) so set SSH options to be used for all your
workspaces:
@ -19,38 +23,46 @@ coder config-ssh [flags]
$ coder config-ssh --dry-run
```
### Options
## Flags
```
-n, --dry-run Perform a trial run with no changes made, showing a diff at the end.
-h, --help help for config-ssh
--ssh-config-file string Specifies the path to an SSH config.
Consumes $CODER_SSH_CONFIG_FILE (default "~/.ssh/config")
-o, --ssh-option stringArray Specifies additional SSH options to embed in each host stanza.
--use-previous-options Specifies whether or not to keep options from previous run of config-ssh.
Consumes $CODER_SSH_USE_PREVIOUS_OPTIONS
-y, --yes Bypass prompts
```
### --dry-run, -n
### Options inherited from parent commands
Perform a trial run with no changes made, showing a diff at the end.
<br/>
| | |
| --- | --- |
| Default | <code>false</code> |
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### --ssh-config-file
### SEE ALSO
Specifies the path to an SSH config.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_SSH_CONFIG_FILE</code> |
| Default | <code>~/.ssh/config</code> |
- [coder](coder.md) -
### --ssh-option, -o
Specifies additional SSH options to embed in each host stanza.
<br/>
| | |
| --- | --- |
| Default | <code>[]</code> |
### --use-previous-options
Specifies whether or not to keep options from previous run of config-ssh.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_SSH_USE_PREVIOUS_OPTIONS</code> |
| Default | <code>false</code> |
### --yes, -y
Bypass prompts
<br/>
| | |
| --- | --- |
| Default | <code>false</code> |

View File

@ -1,47 +1,62 @@
## coder create
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder create
Create a workspace
```
## Usage
```console
coder create [name] [flags]
```
### Options
## Flags
```
-h, --help help for create
--parameter-file string Specify a file path with parameter values.
Consumes $CODER_PARAMETER_FILE
--rich-parameter-file string Specify a file path with values for rich parameters defined in the template.
Consumes $CODER_RICH_PARAMETER_FILE
--start-at coder schedule start --help Specify the workspace autostart schedule. Check coder schedule start --help for the syntax.
Consumes $CODER_WORKSPACE_START_AT
--stop-after duration Specify a duration after which the workspace should shut down (e.g. 8h).
Consumes $CODER_WORKSPACE_STOP_AFTER (default 8h0m0s)
-t, --template string Specify a template name.
Consumes $CODER_TEMPLATE_NAME
-y, --yes Bypass prompts
```
### --parameter-file
### Options inherited from parent commands
Specify a file path with parameter values.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_PARAMETER_FILE</code> |
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### --rich-parameter-file
### SEE ALSO
Specify a file path with values for rich parameters defined in the template.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_RICH_PARAMETER_FILE</code> |
- [coder](coder.md) -
### --start-at
Specify the workspace autostart schedule. Check `coder schedule start --help` for the syntax.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_WORKSPACE_START_AT</code> |
### --stop-after
Specify a duration after which the workspace should shut down (e.g. 8h).
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_WORKSPACE_STOP_AFTER</code> |
| Default | <code>8h0m0s</code> |
### --template, -t
Specify a template name.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_TEMPLATE_NAME</code> |
### --yes, -y
Bypass prompts
<br/>
| | |
| --- | --- |
| Default | <code>false</code> |

View File

@ -1,39 +1,29 @@
## coder delete
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder delete
Delete a workspace
```
## Usage
```console
coder delete <workspace> [flags]
```
### Options
## Flags
```
-h, --help help for delete
--orphan Delete a workspace without deleting its resources. This can delete a
workspace in a broken state, but may also lead to unaccounted cloud resources.
-y, --yes Bypass prompts
```
### --orphan
### Options inherited from parent commands
Delete a workspace without deleting its resources. This can delete a<br/>workspace in a broken state, but may also lead to unaccounted cloud resources.
<br/>
| | |
| --- | --- |
| Default | <code>false</code> |
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### --yes, -y
### SEE ALSO
- [coder](coder.md) -
Bypass prompts
<br/>
| | |
| --- | --- |
| Default | <code>false</code> |

View File

@ -1,47 +1,37 @@
## coder dotfiles
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder dotfiles
Checkout and install a dotfiles repository from a Git URL
```
## Usage
```console
coder dotfiles [git_repo_url] [flags]
```
### Examples
## Examples
```
```console
- Check out and install a dotfiles repository without prompts:
$ coder dotfiles --yes git@github.com:example/dotfiles.git
```
### Options
## Flags
```
-h, --help help for dotfiles
--symlink-dir string Specifies the directory for the dotfiles symlink destinations. If empty will use $HOME.
Consumes $CODER_SYMLINK_DIR
-y, --yes Bypass prompts
```
### --symlink-dir
### Options inherited from parent commands
Specifies the directory for the dotfiles symlink destinations. If empty will use $HOME.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_SYMLINK_DIR</code> |
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### --yes, -y
### SEE ALSO
- [coder](coder.md) -
Bypass prompts
<br/>
| | |
| --- | --- |
| Default | <code>false</code> |

View File

@ -1,40 +1,45 @@
## coder list
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder list
List workspaces
```
## Usage
```console
coder list [flags]
```
### Options
## Flags
```
-a, --all Specifies whether all workspaces will be listed or not.
-c, --column strings Columns to display in table output. Available columns: workspace, template, status, last built, outdated, starts at, stops after (default [workspace,template,status,last built,outdated,starts at,stops after])
-h, --help help for list
-o, --output string Output format. Available formats: table, json (default "table")
--search string Search for a workspace with a query. (default "owner:me")
```
### --all, -a
### Options inherited from parent commands
Specifies whether all workspaces will be listed or not.
<br/>
| | |
| --- | --- |
| Default | <code>false</code> |
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### --column, -c
### SEE ALSO
Columns to display in table output. Available columns: workspace, template, status, last built, outdated, starts at, stops after
<br/>
| | |
| --- | --- |
| Default | <code>[workspace,template,status,last built,outdated,starts at,stops after]</code> |
- [coder](coder.md) -
### --output, -o
Output format. Available formats: table, json
<br/>
| | |
| --- | --- |
| Default | <code>table</code> |
### --search
Search for a workspace with a query.
<br/>
| | |
| --- | --- |
| Default | <code>owner:me</code> |

View File

@ -1,44 +1,46 @@
## coder login
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder login
Authenticate with Coder deployment
```
## Usage
```console
coder login <url> [flags]
```
### Options
## Flags
```
--first-user-email string Specifies an email address to use if creating the first user for the deployment.
Consumes $CODER_FIRST_USER_EMAIL
--first-user-password string Specifies a password to use if creating the first user for the deployment.
Consumes $CODER_FIRST_USER_PASSWORD
--first-user-trial Specifies whether a trial license should be provisioned for the Coder deployment or not.
Consumes $CODER_FIRST_USER_TRIAL
--first-user-username string Specifies a username to use if creating the first user for the deployment.
Consumes $CODER_FIRST_USER_USERNAME
-h, --help help for login
```
### --first-user-email
### Options inherited from parent commands
Specifies an email address to use if creating the first user for the deployment.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_FIRST_USER_EMAIL</code> |
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### --first-user-password
### SEE ALSO
Specifies a password to use if creating the first user for the deployment.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_FIRST_USER_PASSWORD</code> |
- [coder](coder.md) -
### --first-user-trial
Specifies whether a trial license should be provisioned for the Coder deployment or not.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_FIRST_USER_TRIAL</code> |
| Default | <code>false</code> |
### --first-user-username
Specifies a username to use if creating the first user for the deployment.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_FIRST_USER_USERNAME</code> |

View File

@ -1,37 +1,21 @@
## coder logout
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder logout
Unauthenticate your local session
```
## Usage
```console
coder logout [flags]
```
### Options
## Flags
```
-h, --help help for logout
-y, --yes Bypass prompts
```
### --yes, -y
### Options inherited from parent commands
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder](coder.md) -
Bypass prompts
<br/>
| | |
| --- | --- |
| Default | <code>false</code> |

View File

@ -1,38 +1,45 @@
## coder ping
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder ping
Ping a workspace
```
## Usage
```console
coder ping <workspace> [flags]
```
### Options
## Flags
```
-h, --help help for ping
-n, --num int Specifies the number of pings to perform. (default 10)
-t, --timeout duration Specifies how long to wait for a ping to complete. (default 5s)
-v, --verbose Enables verbose logging.
--wait duration Specifies how long to wait between pings. (default 1s)
```
### --num, -n
### Options inherited from parent commands
Specifies the number of pings to perform.
<br/>
| | |
| --- | --- |
| Default | <code>10</code> |
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
```
### --timeout, -t
### SEE ALSO
Specifies how long to wait for a ping to complete.
<br/>
| | |
| --- | --- |
| Default | <code>5s</code> |
- [coder](coder.md) -
### --verbose, -v
Enables verbose logging.
<br/>
| | |
| --- | --- |
| Default | <code>false</code> |
### --wait
Specifies how long to wait between pings.
<br/>
| | |
| --- | --- |
| Default | <code>1s</code> |

View File

@ -1,14 +1,18 @@
## coder port-forward
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder port-forward
Forward ports from machine to a workspace
```
## Usage
```console
coder port-forward <workspace> [flags]
```
### Examples
## Examples
```
```console
- Port forward a single TCP port from 1234 in the workspace to port 5678 on
your local machine:
@ -28,35 +32,22 @@ coder port-forward <workspace> [flags]
$ coder port-forward <workspace> --tcp 8080,9000:3000,9090-9092,10000-10002:10010-10012
```
### Options
## Flags
```
-h, --help help for port-forward
-p, --tcp stringArray Forward TCP port(s) from the workspace to the local machine.
Consumes $CODER_PORT_FORWARD_TCP
--udp stringArray Forward UDP port(s) from the workspace to the local machine. The UDP connection has TCP-like semantics to support stateful UDP protocols.
Consumes $CODER_PORT_FORWARD_UDP
```
### --tcp, -p
### Options inherited from parent commands
Forward TCP port(s) from the workspace to the local machine.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_PORT_FORWARD_TCP</code> |
| Default | <code>[]</code> |
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### --udp
### SEE ALSO
- [coder](coder.md) -
Forward UDP port(s) from the workspace to the local machine. The UDP connection has TCP-like semantics to support stateful UDP protocols.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_PORT_FORWARD_UDP</code> |
| Default | <code>[]</code> |

View File

@ -1,38 +1,29 @@
## coder publickey
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder publickey
Output your Coder public key used for Git operations
```
## Usage
```console
coder publickey [flags]
```
### Options
## Flags
```
-h, --help help for publickey
--reset Regenerate your public key. This will require updating the key on any services it's registered with.
-y, --yes Bypass prompts
```
### --reset
### Options inherited from parent commands
Regenerate your public key. This will require updating the key on any services it's registered with.
<br/>
| | |
| --- | --- |
| Default | <code>false</code> |
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### --yes, -y
### SEE ALSO
- [coder](coder.md) -
Bypass prompts
<br/>
| | |
| --- | --- |
| Default | <code>false</code> |

View File

@ -1,37 +1,21 @@
## coder rename
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder rename
Rename a workspace
```
## Usage
```console
coder rename <workspace> <new name> [flags]
```
### Options
## Flags
```
-h, --help help for rename
-y, --yes Bypass prompts
```
### --yes, -y
### Options inherited from parent commands
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder](coder.md) -
Bypass prompts
<br/>
| | |
| --- | --- |
| Default | <code>false</code> |

View File

@ -1,38 +1,21 @@
## coder reset-password
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder reset-password
Directly connect to the database to reset a user's password
```
## Usage
```console
coder reset-password <username> [flags]
```
### Options
## Flags
```
-h, --help help for reset-password
--postgres-url string URL of a PostgreSQL database to connect to.
Consumes $CODER_PG_CONNECTION_URL
```
### --postgres-url
### Options inherited from parent commands
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder](coder.md) -
URL of a PostgreSQL database to connect to.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_PG_CONNECTION_URL</code> |

View File

@ -1,37 +1,21 @@
## coder restart
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder restart
Restart a workspace
```
## Usage
```console
coder restart <workspace> [flags]
```
### Options
## Flags
```
-h, --help help for restart
-y, --yes Bypass prompts
```
### --yes, -y
### Options inherited from parent commands
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder](coder.md) -
Bypass prompts
<br/>
| | |
| --- | --- |
| Default | <code>false</code> |

View File

@ -1,42 +1,18 @@
## coder scaletest
<!-- DO NOT EDIT | GENERATED CONTENT -->
Run a scale test against the Coder API
### Synopsis
# coder scaletest
Perform scale tests against the Coder server.
```
## Usage
```console
coder scaletest [flags]
```
### Options
## Subcommands
```
-h, --help help for scaletest
```
### Options inherited from parent commands
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder](coder.md) -
- [coder scaletest cleanup](coder_scaletest_cleanup.md) - Cleanup any orphaned scaletest resources
- [coder scaletest create-workspaces](coder_scaletest_create-workspaces.md) - Creates many workspaces and waits for them to be ready
| Name | Purpose |
| --------------------------------------------------------------------- | ------------------------------------------------------ |
| [<code>cleanup</code>](./coder_scaletest_cleanup) | Cleanup any orphaned scaletest resources |
| [<code>create-workspaces</code>](./coder_scaletest_create-workspaces) | Creates many workspaces and waits for them to be ready |

View File

@ -1,46 +1,40 @@
## coder scaletest cleanup
<!-- DO NOT EDIT | GENERATED CONTENT -->
Cleanup any orphaned scaletest resources
### Synopsis
# coder scaletest cleanup
Cleanup scaletest workspaces, then cleanup scaletest users. The strategy flags will apply to each stage of the cleanup process.
```
## Usage
```console
coder scaletest cleanup [flags]
```
### Options
## Flags
```
--cleanup-concurrency int Number of concurrent cleanup jobs to run. 0 means unlimited.
Consumes $CODER_LOADTEST_CLEANUP_CONCURRENCY (default 1)
--cleanup-job-timeout duration Timeout per job. Jobs may take longer to complete under higher concurrency limits.
Consumes $CODER_LOADTEST_CLEANUP_JOB_TIMEOUT (default 5m0s)
--cleanup-timeout duration Timeout for the entire cleanup run. 0 means unlimited.
Consumes $CODER_LOADTEST_CLEANUP_TIMEOUT (default 30m0s)
-h, --help help for cleanup
```
### --cleanup-concurrency
### Options inherited from parent commands
Number of concurrent cleanup jobs to run. 0 means unlimited.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOADTEST_CLEANUP_CONCURRENCY</code> |
| Default | <code>1</code> |
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### --cleanup-job-timeout
### SEE ALSO
Timeout per job. Jobs may take longer to complete under higher concurrency limits.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOADTEST_CLEANUP_JOB_TIMEOUT</code> |
| Default | <code>5m0s</code> |
- [coder scaletest](coder_scaletest.md) - Run a scale test against the Coder API
### --cleanup-timeout
Timeout for the entire cleanup run. 0 means unlimited.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOADTEST_CLEANUP_TIMEOUT</code> |
| Default | <code>30m0s</code> |

View File

@ -1,98 +1,261 @@
## coder scaletest create-workspaces
<!-- DO NOT EDIT | GENERATED CONTENT -->
Creates many workspaces and waits for them to be ready
### Synopsis
# coder scaletest create-workspaces
Creates many users, then creates a workspace for each user and waits for them finish building and fully come online. Optionally runs a command inside each workspace, and connects to the workspace over WireGuard.
It is recommended that all rate limits are disabled on the server before running this scaletest. This test generates many login events which will be rate limited against the (most likely single) IP.
```
## Usage
```console
coder scaletest create-workspaces [flags]
```
### Options
## Flags
```
--cleanup-concurrency int Number of concurrent cleanup jobs to run. 0 means unlimited.
Consumes $CODER_LOADTEST_CLEANUP_CONCURRENCY (default 1)
--cleanup-job-timeout duration Timeout per job. Jobs may take longer to complete under higher concurrency limits.
Consumes $CODER_LOADTEST_CLEANUP_JOB_TIMEOUT (default 5m0s)
--cleanup-timeout duration Timeout for the entire cleanup run. 0 means unlimited.
Consumes $CODER_LOADTEST_CLEANUP_TIMEOUT (default 30m0s)
--concurrency int Number of concurrent jobs to run. 0 means unlimited.
Consumes $CODER_LOADTEST_CONCURRENCY (default 1)
--connect-hold duration How long to hold the WireGuard connection open for.
Consumes $CODER_LOADTEST_CONNECT_HOLD (default 30s)
--connect-interval duration How long to wait between making requests to the --connect-url once the connection is established.
Consumes $CODER_LOADTEST_CONNECT_INTERVAL (default 1s)
--connect-mode string Mode to use for connecting to the workspace. Can be 'derp' or 'direct'.
Consumes $CODER_LOADTEST_CONNECT_MODE (default "derp")
--connect-timeout duration Timeout for each request to the --connect-url.
Consumes $CODER_LOADTEST_CONNECT_TIMEOUT (default 5s)
--connect-url string URL to connect to inside the the workspace over WireGuard. If not specified, no connections will be made over WireGuard.
Consumes $CODER_LOADTEST_CONNECT_URL
-c, --count int Required: Number of workspaces to create.
Consumes $CODER_LOADTEST_COUNT (default 1)
-h, --help help for create-workspaces
--job-timeout duration Timeout per job. Jobs may take longer to complete under higher concurrency limits.
Consumes $CODER_LOADTEST_JOB_TIMEOUT (default 5m0s)
--no-cleanup coder scaletest cleanup Do not clean up resources after the test completes. You can cleanup manually using coder scaletest cleanup.
Consumes $CODER_LOADTEST_NO_CLEANUP
--no-plan Skip the dry-run step to plan the workspace creation. This step ensures that the given parameters are valid for the given template.
Consumes $CODER_LOADTEST_NO_PLAN
--no-wait-for-agents Do not wait for agents to start before marking the test as succeeded. This can be useful if you are running the test against a template that does not start the agent quickly.
Consumes $CODER_LOADTEST_NO_WAIT_FOR_AGENTS
--output stringArray Output format specs in the format "<format>[:<path>]". Not specifying a path will default to stdout. Available formats: text, json.
Consumes $CODER_SCALETEST_OUTPUTS (default [text])
--parameter stringArray Parameters to use for each workspace. Can be specified multiple times. Overrides any existing parameters with the same name from --parameters-file. Format: key=value.
Consumes $CODER_LOADTEST_PARAMETERS
--parameters-file string Path to a YAML file containing the parameters to use for each workspace.
Consumes $CODER_LOADTEST_PARAMETERS_FILE
--run-command string Command to run inside each workspace using reconnecting-pty (i.e. web terminal protocol). If not specified, no command will be run.
Consumes $CODER_LOADTEST_RUN_COMMAND
--run-expect-output string Expect the command to output the given string (on a single line). If the command does not output the given string, it will be marked as failed.
Consumes $CODER_LOADTEST_RUN_EXPECT_OUTPUT
--run-expect-timeout Expect the command to timeout. If the command does not finish within the given --run-timeout, it will be marked as succeeded. If the command finishes before the timeout, it will be marked as failed.
Consumes $CODER_LOADTEST_RUN_EXPECT_TIMEOUT
--run-log-output Log the output of the command to the test logs. This should be left off unless you expect small amounts of output. Large amounts of output will cause high memory usage.
Consumes $CODER_LOADTEST_RUN_LOG_OUTPUT
--run-timeout duration Timeout for the command to complete.
Consumes $CODER_LOADTEST_RUN_TIMEOUT (default 5s)
-t, --template string Required: Name or ID of the template to use for workspaces.
Consumes $CODER_LOADTEST_TEMPLATE
--timeout duration Timeout for the entire test run. 0 means unlimited.
Consumes $CODER_LOADTEST_TIMEOUT (default 30m0s)
--trace Whether application tracing data is collected. It exports to a backend configured by environment variables. See: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md.
Consumes $CODER_LOADTEST_TRACE
--trace-coder Whether opentelemetry traces are sent to Coder. We recommend keeping this disabled unless we advise you to enable it.
Consumes $CODER_LOADTEST_TRACE_CODER
--trace-honeycomb-api-key string Enables trace exporting to Honeycomb.io using the provided API key.
Consumes $CODER_LOADTEST_TRACE_HONEYCOMB_API_KEY
--trace-propagate Enables trace propagation to the Coder backend, which will be used to correlate server-side spans with client-side spans. Only enable this if the server is configured with the exact same tracing configuration as the client.
Consumes $CODER_LOADTEST_TRACE_PROPAGATE
```
### --cleanup-concurrency
### Options inherited from parent commands
Number of concurrent cleanup jobs to run. 0 means unlimited.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOADTEST_CLEANUP_CONCURRENCY</code> |
| Default | <code>1</code> |
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### --cleanup-job-timeout
### SEE ALSO
Timeout per job. Jobs may take longer to complete under higher concurrency limits.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOADTEST_CLEANUP_JOB_TIMEOUT</code> |
| Default | <code>5m0s</code> |
- [coder scaletest](coder_scaletest.md) - Run a scale test against the Coder API
### --cleanup-timeout
Timeout for the entire cleanup run. 0 means unlimited.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOADTEST_CLEANUP_TIMEOUT</code> |
| Default | <code>30m0s</code> |
### --concurrency
Number of concurrent jobs to run. 0 means unlimited.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOADTEST_CONCURRENCY</code> |
| Default | <code>1</code> |
### --connect-hold
How long to hold the WireGuard connection open for.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOADTEST_CONNECT_HOLD</code> |
| Default | <code>30s</code> |
### --connect-interval
How long to wait between making requests to the --connect-url once the connection is established.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOADTEST_CONNECT_INTERVAL</code> |
| Default | <code>1s</code> |
### --connect-mode
Mode to use for connecting to the workspace. Can be 'derp' or 'direct'.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOADTEST_CONNECT_MODE</code> |
| Default | <code>derp</code> |
### --connect-timeout
Timeout for each request to the --connect-url.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOADTEST_CONNECT_TIMEOUT</code> |
| Default | <code>5s</code> |
### --connect-url
URL to connect to inside the the workspace over WireGuard. If not specified, no connections will be made over WireGuard.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOADTEST_CONNECT_URL</code> |
### --count, -c
Required: Number of workspaces to create.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOADTEST_COUNT</code> |
| Default | <code>1</code> |
### --job-timeout
Timeout per job. Jobs may take longer to complete under higher concurrency limits.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOADTEST_JOB_TIMEOUT</code> |
| Default | <code>5m0s</code> |
### --no-cleanup
Do not clean up resources after the test completes. You can cleanup manually using `coder scaletest cleanup`.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOADTEST_NO_CLEANUP</code> |
| Default | <code>false</code> |
### --no-plan
Skip the dry-run step to plan the workspace creation. This step ensures that the given parameters are valid for the given template.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOADTEST_NO_PLAN</code> |
| Default | <code>false</code> |
### --no-wait-for-agents
Do not wait for agents to start before marking the test as succeeded. This can be useful if you are running the test against a template that does not start the agent quickly.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOADTEST_NO_WAIT_FOR_AGENTS</code> |
| Default | <code>false</code> |
### --output
Output format specs in the format "<format>[:<path>]". Not specifying a path will default to stdout. Available formats: text, json.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_SCALETEST_OUTPUTS</code> |
| Default | <code>[text]</code> |
### --parameter
Parameters to use for each workspace. Can be specified multiple times. Overrides any existing parameters with the same name from --parameters-file. Format: key=value.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOADTEST_PARAMETERS</code> |
| Default | <code>[]</code> |
### --parameters-file
Path to a YAML file containing the parameters to use for each workspace.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOADTEST_PARAMETERS_FILE</code> |
### --run-command
Command to run inside each workspace using reconnecting-pty (i.e. web terminal protocol). If not specified, no command will be run.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOADTEST_RUN_COMMAND</code> |
### --run-expect-output
Expect the command to output the given string (on a single line). If the command does not output the given string, it will be marked as failed.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOADTEST_RUN_EXPECT_OUTPUT</code> |
### --run-expect-timeout
Expect the command to timeout. If the command does not finish within the given --run-timeout, it will be marked as succeeded. If the command finishes before the timeout, it will be marked as failed.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOADTEST_RUN_EXPECT_TIMEOUT</code> |
| Default | <code>false</code> |
### --run-log-output
Log the output of the command to the test logs. This should be left off unless you expect small amounts of output. Large amounts of output will cause high memory usage.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOADTEST_RUN_LOG_OUTPUT</code> |
| Default | <code>false</code> |
### --run-timeout
Timeout for the command to complete.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOADTEST_RUN_TIMEOUT</code> |
| Default | <code>5s</code> |
### --template, -t
Required: Name or ID of the template to use for workspaces.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOADTEST_TEMPLATE</code> |
### --timeout
Timeout for the entire test run. 0 means unlimited.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOADTEST_TIMEOUT</code> |
| Default | <code>30m0s</code> |
### --trace
Whether application tracing data is collected. It exports to a backend configured by environment variables. See: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOADTEST_TRACE</code> |
| Default | <code>false</code> |
### --trace-coder
Whether opentelemetry traces are sent to Coder. We recommend keeping this disabled unless we advise you to enable it.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOADTEST_TRACE_CODER</code> |
| Default | <code>false</code> |
### --trace-honeycomb-api-key
Enables trace exporting to Honeycomb.io using the provided API key.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOADTEST_TRACE_HONEYCOMB_API_KEY</code> |
### --trace-propagate
Enables trace propagation to the Coder backend, which will be used to correlate server-side spans with client-side spans. Only enable this if the server is configured with the exact same tracing configuration as the client.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOADTEST_TRACE_PROPAGATE</code> |
| Default | <code>false</code> |

View File

@ -1,40 +1,20 @@
## coder schedule
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder schedule
Schedule automated start and stop times for workspaces
```
## Usage
```console
coder schedule { show | start | stop | override } <workspace> [flags]
```
### Options
## Subcommands
```
-h, --help help for schedule
```
### Options inherited from parent commands
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder](coder.md) -
- [coder schedule override-stop](coder_schedule_override-stop.md) - Edit stop time of active workspace
- [coder schedule show](coder_schedule_show.md) - Show workspace schedule
- [coder schedule start](coder_schedule_start.md) - Edit workspace start schedule
- [coder schedule stop](coder_schedule_stop.md) - Edit workspace stop schedule
| Name | Purpose |
| ------------------------------------------------------------ | ---------------------------------- |
| [<code>override-stop</code>](./coder_schedule_override-stop) | Edit stop time of active workspace |
| [<code>show</code>](./coder_schedule_show) | Show workspace schedule |
| [<code>start</code>](./coder_schedule_start) | Edit workspace start schedule |
| [<code>stop</code>](./coder_schedule_stop) | Edit workspace stop schedule |

View File

@ -1,8 +1,6 @@
## coder schedule override-stop
<!-- DO NOT EDIT | GENERATED CONTENT -->
Edit stop time of active workspace
### Synopsis
# coder schedule override-stop
Override the stop time of a currently running workspace instance.
@ -10,41 +8,14 @@ Override the stop time of a currently running workspace instance.
- The new stop time must be at least 30 minutes in the future.
- The workspace template may restrict the maximum workspace runtime.
```
## Usage
```console
coder schedule override-stop <workspace-name> <duration from now> [flags]
```
### Examples
## Examples
```
```console
$ coder schedule override-stop my-workspace 90m
```
### Options
```
-h, --help help for override-stop
```
### Options inherited from parent commands
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder schedule](coder_schedule.md) - Schedule automated start and stop times for workspaces

View File

@ -1,8 +1,6 @@
## coder schedule show
<!-- DO NOT EDIT | GENERATED CONTENT -->
Show workspace schedule
### Synopsis
# coder schedule show
Shows the following information for the given workspace:
@ -11,35 +9,8 @@ Shows the following information for the given workspace:
- The duration after which it will stop
- The next scheduled stop time
```
## Usage
```console
coder schedule show <workspace-name> [flags]
```
### Options
```
-h, --help help for show
```
### Options inherited from parent commands
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder schedule](coder_schedule.md) - Schedule automated start and stop times for workspaces

View File

@ -1,8 +1,6 @@
## coder schedule start
<!-- DO NOT EDIT | GENERATED CONTENT -->
Edit workspace start schedule
### Synopsis
# coder schedule start
Schedules a workspace to regularly start at a specific time.
Schedule format: <start-time> [day-of-week] [location].
@ -15,43 +13,16 @@ Schedule format: <start-time> [day-of-week] [location].
If omitted, we will fall back to either the TZ environment variable or /etc/localtime.
You can check your corresponding location by visiting https://ipinfo.io - it shows in the demo widget on the right.
```
## Usage
```console
coder schedule start <workspace-name> { <start-time> [day-of-week] [location] | manual } [flags]
```
### Examples
## Examples
```
```console
- Set the workspace to start at 9:30am (in Dublin) from Monday to Friday:
$ coder schedule start my-workspace 9:30AM Mon-Fri Europe/Dublin
```
### Options
```
-h, --help help for start
```
### Options inherited from parent commands
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder schedule](coder_schedule.md) - Schedule automated start and stop times for workspaces

View File

@ -1,8 +1,6 @@
## coder schedule stop
<!-- DO NOT EDIT | GENERATED CONTENT -->
Edit workspace stop schedule
### Synopsis
# coder schedule stop
Schedules a workspace to stop after a given duration has elapsed.
@ -19,41 +17,14 @@ When enabling scheduled stop, enter a duration in one of the following formats:
- 2m (2 minutes)
- 2 (2 minutes)
```
## Usage
```console
coder schedule stop <workspace-name> { <duration> | manual } [flags]
```
### Examples
## Examples
```
```console
$ coder schedule stop my-workspace 2h30m
```
### Options
```
-h, --help help for stop
```
### Options inherited from parent commands
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder schedule](coder_schedule.md) - Schedule automated start and stop times for workspaces

View File

@ -1,185 +1,660 @@
## coder server
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder server
Start a Coder server
```
## Usage
```console
coder server [flags]
```
### Options
## Subcommands
```
--access-url string External URL to access your deployment. This must be accessible by all provisioned workspaces.
Consumes $CODER_ACCESS_URL
--api-rate-limit int Maximum number of requests per minute allowed to the API per user, or per IP address for unauthenticated users. Negative values mean no rate limit. Some API endpoints have separate strict rate limits regardless of this value to prevent denial-of-service or brute force attacks.
Consumes $CODER_API_RATE_LIMIT (default 512)
--cache-dir string The directory to cache temporary files. If unspecified and $CACHE_DIRECTORY is set, it will be used for compatibility with systemd.
Consumes $CODER_CACHE_DIRECTORY (default "~/.cache/coder")
--dangerous-allow-path-app-sharing Allow workspace apps that are not served from subdomains to be shared. Path-based app sharing is DISABLED by default for security purposes. Path-based apps can make requests to the Coder API and pose a security risk when the workspace serves malicious JavaScript. Path-based apps can be disabled entirely with --disable-path-apps for further security.
Consumes $CODER_DANGEROUS_ALLOW_PATH_APP_SHARING
--dangerous-allow-path-app-site-owner-access Allow site-owners to access workspace apps from workspaces they do not own. Owners cannot access path-based apps they do not own by default. Path-based apps can make requests to the Coder API and pose a security risk when the workspace serves malicious JavaScript. Path-based apps can be disabled entirely with --disable-path-apps for further security.
Consumes $CODER_DANGEROUS_ALLOW_PATH_APP_SITE_OWNER_ACCESS
--dangerous-disable-rate-limits Disables all rate limits. This is not recommended in production.
Consumes $CODER_RATE_LIMIT_DISABLE_ALL
--derp-config-path string Path to read a DERP mapping from. See: https://tailscale.com/kb/1118/custom-derp-servers/
Consumes $CODER_DERP_CONFIG_PATH
--derp-config-url string URL to fetch a DERP mapping on startup. See: https://tailscale.com/kb/1118/custom-derp-servers/
Consumes $CODER_DERP_CONFIG_URL
--derp-server-enable Whether to enable or disable the embedded DERP relay server.
Consumes $CODER_DERP_SERVER_ENABLE (default true)
--derp-server-region-code string Region code to use for the embedded DERP server.
Consumes $CODER_DERP_SERVER_REGION_CODE (default "coder")
--derp-server-region-id int Region ID to use for the embedded DERP server.
Consumes $CODER_DERP_SERVER_REGION_ID (default 999)
--derp-server-region-name string Region name that for the embedded DERP server.
Consumes $CODER_DERP_SERVER_REGION_NAME (default "Coder Embedded Relay")
--derp-server-stun-addresses strings Addresses for STUN servers to establish P2P connections. Set empty to disable P2P connections.
Consumes $CODER_DERP_SERVER_STUN_ADDRESSES (default [stun.l.google.com:19302])
--disable-password-auth coder server create-admin Disable password authentication. This is recommended for security purposes in production deployments that rely on an identity provider. Any user with the owner role will be able to sign in with their password regardless of this setting to avoid potential lock out. If you are locked out of your account, you can use the coder server create-admin command to create a new admin user directly in the database.
Consumes $CODER_DISABLE_PASSWORD_AUTH
--disable-path-apps Disable workspace apps that are not served from subdomains. Path-based apps can make requests to the Coder API and pose a security risk when the workspace serves malicious JavaScript. This is recommended for security purposes if a --wildcard-access-url is configured.
Consumes $CODER_DISABLE_PATH_APPS
--disable-session-expiry-refresh Disable automatic session expiry bumping due to activity. This forces all sessions to become invalid after the session expiry duration has been reached.
Consumes $CODER_DISABLE_SESSION_EXPIRY_REFRESH
--experiments strings Enable one or more experiments. These are not ready for production. Separate multiple experiments with commas, or enter '*' to opt-in to all available experiments.
Consumes $CODER_EXPERIMENTS
-h, --help help for server
--http-address string HTTP bind address of the server. Unset to disable the HTTP endpoint.
Consumes $CODER_HTTP_ADDRESS (default "127.0.0.1:3000")
--log-human string Output human-readable logs to a given file.
Consumes $CODER_LOGGING_HUMAN (default "/dev/stderr")
--log-json string Output JSON logs to a given file.
Consumes $CODER_LOGGING_JSON
--log-stackdriver string Output Stackdriver compatible logs to a given file.
Consumes $CODER_LOGGING_STACKDRIVER
--max-token-lifetime duration The maximum lifetime duration users can specify when creating an API token.
Consumes $CODER_MAX_TOKEN_LIFETIME (default 720h0m0s)
--oauth2-github-allow-everyone Allow all logins, setting this option means allowed orgs and teams must be empty.
Consumes $CODER_OAUTH2_GITHUB_ALLOW_EVERYONE
--oauth2-github-allow-signups Whether new users can sign up with GitHub.
Consumes $CODER_OAUTH2_GITHUB_ALLOW_SIGNUPS
--oauth2-github-allowed-orgs strings Organizations the user must be a member of to Login with GitHub.
Consumes $CODER_OAUTH2_GITHUB_ALLOWED_ORGS
--oauth2-github-allowed-teams strings Teams inside organizations the user must be a member of to Login with GitHub. Structured as: <organization-name>/<team-slug>.
Consumes $CODER_OAUTH2_GITHUB_ALLOWED_TEAMS
--oauth2-github-client-id string Client ID for Login with GitHub.
Consumes $CODER_OAUTH2_GITHUB_CLIENT_ID
--oauth2-github-client-secret string Client secret for Login with GitHub.
Consumes $CODER_OAUTH2_GITHUB_CLIENT_SECRET
--oauth2-github-enterprise-base-url string Base URL of a GitHub Enterprise deployment to use for Login with GitHub.
Consumes $CODER_OAUTH2_GITHUB_ENTERPRISE_BASE_URL
--oidc-allow-signups Whether new users can sign up with OIDC.
Consumes $CODER_OIDC_ALLOW_SIGNUPS (default true)
--oidc-client-id string Client ID to use for Login with OIDC.
Consumes $CODER_OIDC_CLIENT_ID
--oidc-client-secret string Client secret to use for Login with OIDC.
Consumes $CODER_OIDC_CLIENT_SECRET
--oidc-email-domain strings Email domains that clients logging in with OIDC must match.
Consumes $CODER_OIDC_EMAIL_DOMAIN
--oidc-icon-url string URL pointing to the icon to use on the OepnID Connect login button
Consumes $CODER_OIDC_ICON_URL
--oidc-ignore-email-verified Ignore the email_verified claim from the upstream provider.
Consumes $CODER_OIDC_IGNORE_EMAIL_VERIFIED
--oidc-issuer-url string Issuer URL to use for Login with OIDC.
Consumes $CODER_OIDC_ISSUER_URL
--oidc-scopes strings Scopes to grant when authenticating with OIDC.
Consumes $CODER_OIDC_SCOPES (default [openid,profile,email])
--oidc-sign-in-text string The text to show on the OpenID Connect sign in button
Consumes $CODER_OIDC_SIGN_IN_TEXT (default "OpenID Connect")
--oidc-username-field string OIDC claim field to use as the username.
Consumes $CODER_OIDC_USERNAME_FIELD (default "preferred_username")
--postgres-url string URL of a PostgreSQL database. If empty, PostgreSQL binaries will be downloaded from Maven (https://repo1.maven.org/maven2) and store all data in the config root. Access the built-in database with "coder server postgres-builtin-url".
Consumes $CODER_PG_CONNECTION_URL
--pprof-address string The bind address to serve pprof.
Consumes $CODER_PPROF_ADDRESS (default "127.0.0.1:6060")
--pprof-enable Serve pprof metrics on the address defined by pprof address.
Consumes $CODER_PPROF_ENABLE
--prometheus-address string The bind address to serve prometheus metrics.
Consumes $CODER_PROMETHEUS_ADDRESS (default "127.0.0.1:2112")
--prometheus-enable Serve prometheus metrics on the address defined by prometheus address.
Consumes $CODER_PROMETHEUS_ENABLE
--provisioner-daemon-poll-interval duration Time to wait before polling for a new job.
Consumes $CODER_PROVISIONER_DAEMON_POLL_INTERVAL (default 1s)
--provisioner-daemon-poll-jitter duration Random jitter added to the poll interval.
Consumes $CODER_PROVISIONER_DAEMON_POLL_JITTER (default 100ms)
--provisioner-daemons int Number of provisioner daemons to create on start. If builds are stuck in queued state for a long time, consider increasing this.
Consumes $CODER_PROVISIONER_DAEMONS (default 3)
--provisioner-force-cancel-interval duration Time to force cancel provisioning tasks that are stuck.
Consumes $CODER_PROVISIONER_FORCE_CANCEL_INTERVAL (default 10m0s)
--proxy-trusted-headers strings Headers to trust for forwarding IP addresses. e.g. Cf-Connecting-Ip, True-Client-Ip, X-Forwarded-For
Consumes $CODER_PROXY_TRUSTED_HEADERS
--proxy-trusted-origins strings Origin addresses to respect "proxy-trusted-headers". e.g. 192.168.1.0/24
Consumes $CODER_PROXY_TRUSTED_ORIGINS
--redirect-to-access-url Specifies whether to redirect requests that do not match the access URL host.
Consumes $CODER_REDIRECT_TO_ACCESS_URL
--secure-auth-cookie Controls if the 'Secure' property is set on browser session cookies.
Consumes $CODER_SECURE_AUTH_COOKIE
--session-duration duration The token expiry duration for browser sessions. Sessions may last longer if they are actively making requests, but this functionality can be disabled via --disable-session-expiry-refresh.
Consumes $CODER_MAX_SESSION_EXPIRY (default 24h0m0s)
--ssh-keygen-algorithm string The algorithm to use for generating ssh keys. Accepted values are "ed25519", "ecdsa", or "rsa4096".
Consumes $CODER_SSH_KEYGEN_ALGORITHM (default "ed25519")
--strict-transport-security int Controls if the 'Strict-Transport-Security' header is set on all static file responses. This header should only be set if the server is accessed via HTTPS. This value is the MaxAge in seconds of the header.
Consumes $CODER_STRICT_TRANSPORT_SECURITY
--strict-transport-security-options strings Two optional fields can be set in the Strict-Transport-Security header; 'includeSubDomains' and 'preload'. The 'strict-transport-security' flag must be set to a non-zero value for these options to be used.
Consumes $CODER_STRICT_TRANSPORT_SECURITY_OPTIONS
--swagger-enable Expose the swagger endpoint via /swagger.
Consumes $CODER_SWAGGER_ENABLE
--telemetry Whether telemetry is enabled or not. Coder collects anonymized usage data to help improve our product.
Consumes $CODER_TELEMETRY_ENABLE (default true)
--telemetry-trace Whether Opentelemetry traces are sent to Coder. Coder collects anonymized application tracing to help improve our product. Disabling telemetry also disables this option.
Consumes $CODER_TELEMETRY_TRACE (default true)
--tls-address string HTTPS bind address of the server.
Consumes $CODER_TLS_ADDRESS (default "127.0.0.1:3443")
--tls-cert-file strings Path to each certificate for TLS. It requires a PEM-encoded file. To configure the listener to use a CA certificate, concatenate the primary certificate and the CA certificate together. The primary certificate should appear first in the combined file.
Consumes $CODER_TLS_CERT_FILE
--tls-client-auth string Policy the server will follow for TLS Client Authentication. Accepted values are "none", "request", "require-any", "verify-if-given", or "require-and-verify".
Consumes $CODER_TLS_CLIENT_AUTH (default "none")
--tls-client-ca-file string PEM-encoded Certificate Authority file used for checking the authenticity of client
Consumes $CODER_TLS_CLIENT_CA_FILE
--tls-client-cert-file string Path to certificate for client TLS authentication. It requires a PEM-encoded file.
Consumes $CODER_TLS_CLIENT_CERT_FILE
--tls-client-key-file string Path to key for client TLS authentication. It requires a PEM-encoded file.
Consumes $CODER_TLS_CLIENT_KEY_FILE
--tls-enable Whether TLS will be enabled.
Consumes $CODER_TLS_ENABLE
--tls-key-file strings Paths to the private keys for each of the certificates. It requires a PEM-encoded file.
Consumes $CODER_TLS_KEY_FILE
--tls-min-version string Minimum supported version of TLS. Accepted values are "tls10", "tls11", "tls12" or "tls13"
Consumes $CODER_TLS_MIN_VERSION (default "tls12")
--trace Whether application tracing data is collected. It exports to a backend configured by environment variables. See: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md
Consumes $CODER_TRACE_ENABLE
--trace-honeycomb-api-key string Enables trace exporting to Honeycomb.io using the provided API Key.
Consumes $CODER_TRACE_HONEYCOMB_API_KEY
--trace-logs Enables capturing of logs as events in traces. This is useful for debugging, but may result in a very large amount of events being sent to the tracing backend which may incur significant costs. If the verbose flag was supplied, debug-level logs will be included.
Consumes $CODER_TRACE_CAPTURE_LOGS
--update-check Periodically check for new releases of Coder and inform the owner. The check is performed once per day.
Consumes $CODER_UPDATE_CHECK
--wildcard-access-url string Specifies the wildcard hostname to use for workspace applications in the form "*.example.com".
Consumes $CODER_WILDCARD_ACCESS_URL
```
| Name | Purpose |
| ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| [<code>create-admin-user</code>](./coder_server_create-admin-user) | Create a new admin user with the given username, email and password and adds it to every organization. |
| [<code>postgres-builtin-serve</code>](./coder_server_postgres-builtin-serve) | Run the built-in PostgreSQL deployment. |
| [<code>postgres-builtin-url</code>](./coder_server_postgres-builtin-url) | Output the connection URL for the built-in PostgreSQL deployment. |
### Options inherited from parent commands
## Flags
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### --access-url
### SEE ALSO
External URL to access your deployment. This must be accessible by all provisioned workspaces.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_ACCESS_URL</code> |
- [coder](coder.md) -
- [coder server create-admin-user](coder_server_create-admin-user.md) - Create a new admin user with the given username, email and password and adds it to every organization.
- [coder server postgres-builtin-serve](coder_server_postgres-builtin-serve.md) - Run the built-in PostgreSQL deployment.
- [coder server postgres-builtin-url](coder_server_postgres-builtin-url.md) - Output the connection URL for the built-in PostgreSQL deployment.
### --api-rate-limit
Maximum number of requests per minute allowed to the API per user, or per IP address for unauthenticated users. Negative values mean no rate limit. Some API endpoints have separate strict rate limits regardless of this value to prevent denial-of-service or brute force attacks.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_API_RATE_LIMIT</code> |
| Default | <code>512</code> |
### --cache-dir
The directory to cache temporary files. If unspecified and $CACHE_DIRECTORY is set, it will be used for compatibility with systemd.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_CACHE_DIRECTORY</code> |
| Default | <code>~/.cache/coder</code> |
### --dangerous-allow-path-app-sharing
Allow workspace apps that are not served from subdomains to be shared. Path-based app sharing is DISABLED by default for security purposes. Path-based apps can make requests to the Coder API and pose a security risk when the workspace serves malicious JavaScript. Path-based apps can be disabled entirely with --disable-path-apps for further security.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_DANGEROUS_ALLOW_PATH_APP_SHARING</code> |
| Default | <code>false</code> |
### --dangerous-allow-path-app-site-owner-access
Allow site-owners to access workspace apps from workspaces they do not own. Owners cannot access path-based apps they do not own by default. Path-based apps can make requests to the Coder API and pose a security risk when the workspace serves malicious JavaScript. Path-based apps can be disabled entirely with --disable-path-apps for further security.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_DANGEROUS_ALLOW_PATH_APP_SITE_OWNER_ACCESS</code> |
| Default | <code>false</code> |
### --dangerous-disable-rate-limits
Disables all rate limits. This is not recommended in production.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_RATE_LIMIT_DISABLE_ALL</code> |
| Default | <code>false</code> |
### --derp-config-path
Path to read a DERP mapping from. See: https://tailscale.com/kb/1118/custom-derp-servers/
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_DERP_CONFIG_PATH</code> |
### --derp-config-url
URL to fetch a DERP mapping on startup. See: https://tailscale.com/kb/1118/custom-derp-servers/
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_DERP_CONFIG_URL</code> |
### --derp-server-enable
Whether to enable or disable the embedded DERP relay server.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_DERP_SERVER_ENABLE</code> |
| Default | <code>true</code> |
### --derp-server-region-code
Region code to use for the embedded DERP server.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_DERP_SERVER_REGION_CODE</code> |
| Default | <code>coder</code> |
### --derp-server-region-id
Region ID to use for the embedded DERP server.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_DERP_SERVER_REGION_ID</code> |
| Default | <code>999</code> |
### --derp-server-region-name
Region name that for the embedded DERP server.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_DERP_SERVER_REGION_NAME</code> |
| Default | <code>Coder Embedded Relay</code> |
### --derp-server-stun-addresses
Addresses for STUN servers to establish P2P connections. Set empty to disable P2P connections.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_DERP_SERVER_STUN_ADDRESSES</code> |
| Default | <code>[stun.l.google.com:19302]</code> |
### --disable-password-auth
Disable password authentication. This is recommended for security purposes in production deployments that rely on an identity provider. Any user with the owner role will be able to sign in with their password regardless of this setting to avoid potential lock out. If you are locked out of your account, you can use the `coder server create-admin` command to create a new admin user directly in the database.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_DISABLE_PASSWORD_AUTH</code> |
| Default | <code>false</code> |
### --disable-path-apps
Disable workspace apps that are not served from subdomains. Path-based apps can make requests to the Coder API and pose a security risk when the workspace serves malicious JavaScript. This is recommended for security purposes if a --wildcard-access-url is configured.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_DISABLE_PATH_APPS</code> |
| Default | <code>false</code> |
### --disable-session-expiry-refresh
Disable automatic session expiry bumping due to activity. This forces all sessions to become invalid after the session expiry duration has been reached.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_DISABLE_SESSION_EXPIRY_REFRESH</code> |
| Default | <code>false</code> |
### --experiments
Enable one or more experiments. These are not ready for production. Separate multiple experiments with commas, or enter '\*' to opt-in to all available experiments.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_EXPERIMENTS</code> |
| Default | <code>[]</code> |
### --http-address
HTTP bind address of the server. Unset to disable the HTTP endpoint.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_HTTP_ADDRESS</code> |
| Default | <code>127.0.0.1:3000</code> |
### --log-human
Output human-readable logs to a given file.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOGGING_HUMAN</code> |
| Default | <code>/dev/stderr</code> |
### --log-json
Output JSON logs to a given file.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOGGING_JSON</code> |
### --log-stackdriver
Output Stackdriver compatible logs to a given file.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_LOGGING_STACKDRIVER</code> |
### --max-token-lifetime
The maximum lifetime duration users can specify when creating an API token.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_MAX_TOKEN_LIFETIME</code> |
| Default | <code>720h0m0s</code> |
### --oauth2-github-allow-everyone
Allow all logins, setting this option means allowed orgs and teams must be empty.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_OAUTH2_GITHUB_ALLOW_EVERYONE</code> |
| Default | <code>false</code> |
### --oauth2-github-allow-signups
Whether new users can sign up with GitHub.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_OAUTH2_GITHUB_ALLOW_SIGNUPS</code> |
| Default | <code>false</code> |
### --oauth2-github-allowed-orgs
Organizations the user must be a member of to Login with GitHub.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_OAUTH2_GITHUB_ALLOWED_ORGS</code> |
| Default | <code>[]</code> |
### --oauth2-github-allowed-teams
Teams inside organizations the user must be a member of to Login with GitHub. Structured as: <organization-name>/<team-slug>.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_OAUTH2_GITHUB_ALLOWED_TEAMS</code> |
| Default | <code>[]</code> |
### --oauth2-github-client-id
Client ID for Login with GitHub.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_OAUTH2_GITHUB_CLIENT_ID</code> |
### --oauth2-github-client-secret
Client secret for Login with GitHub.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_OAUTH2_GITHUB_CLIENT_SECRET</code> |
### --oauth2-github-enterprise-base-url
Base URL of a GitHub Enterprise deployment to use for Login with GitHub.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_OAUTH2_GITHUB_ENTERPRISE_BASE_URL</code> |
### --oidc-allow-signups
Whether new users can sign up with OIDC.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_OIDC_ALLOW_SIGNUPS</code> |
| Default | <code>true</code> |
### --oidc-client-id
Client ID to use for Login with OIDC.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_OIDC_CLIENT_ID</code> |
### --oidc-client-secret
Client secret to use for Login with OIDC.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_OIDC_CLIENT_SECRET</code> |
### --oidc-email-domain
Email domains that clients logging in with OIDC must match.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_OIDC_EMAIL_DOMAIN</code> |
| Default | <code>[]</code> |
### --oidc-icon-url
URL pointing to the icon to use on the OepnID Connect login button
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_OIDC_ICON_URL</code> |
### --oidc-ignore-email-verified
Ignore the email_verified claim from the upstream provider.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_OIDC_IGNORE_EMAIL_VERIFIED</code> |
| Default | <code>false</code> |
### --oidc-issuer-url
Issuer URL to use for Login with OIDC.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_OIDC_ISSUER_URL</code> |
### --oidc-scopes
Scopes to grant when authenticating with OIDC.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_OIDC_SCOPES</code> |
| Default | <code>[openid,profile,email]</code> |
### --oidc-sign-in-text
The text to show on the OpenID Connect sign in button
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_OIDC_SIGN_IN_TEXT</code> |
| Default | <code>OpenID Connect</code> |
### --oidc-username-field
OIDC claim field to use as the username.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_OIDC_USERNAME_FIELD</code> |
| Default | <code>preferred_username</code> |
### --postgres-url
URL of a PostgreSQL database. If empty, PostgreSQL binaries will be downloaded from Maven (https://repo1.maven.org/maven2) and store all data in the config root. Access the built-in database with "coder server postgres-builtin-url".
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_PG_CONNECTION_URL</code> |
### --pprof-address
The bind address to serve pprof.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_PPROF_ADDRESS</code> |
| Default | <code>127.0.0.1:6060</code> |
### --pprof-enable
Serve pprof metrics on the address defined by pprof address.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_PPROF_ENABLE</code> |
| Default | <code>false</code> |
### --prometheus-address
The bind address to serve prometheus metrics.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_PROMETHEUS_ADDRESS</code> |
| Default | <code>127.0.0.1:2112</code> |
### --prometheus-enable
Serve prometheus metrics on the address defined by prometheus address.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_PROMETHEUS_ENABLE</code> |
| Default | <code>false</code> |
### --provisioner-daemon-poll-interval
Time to wait before polling for a new job.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_PROVISIONER_DAEMON_POLL_INTERVAL</code> |
| Default | <code>1s</code> |
### --provisioner-daemon-poll-jitter
Random jitter added to the poll interval.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_PROVISIONER_DAEMON_POLL_JITTER</code> |
| Default | <code>100ms</code> |
### --provisioner-daemons
Number of provisioner daemons to create on start. If builds are stuck in queued state for a long time, consider increasing this.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_PROVISIONER_DAEMONS</code> |
| Default | <code>3</code> |
### --provisioner-force-cancel-interval
Time to force cancel provisioning tasks that are stuck.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_PROVISIONER_FORCE_CANCEL_INTERVAL</code> |
| Default | <code>10m0s</code> |
### --proxy-trusted-headers
Headers to trust for forwarding IP addresses. e.g. Cf-Connecting-Ip, True-Client-Ip, X-Forwarded-For
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_PROXY_TRUSTED_HEADERS</code> |
| Default | <code>[]</code> |
### --proxy-trusted-origins
Origin addresses to respect "proxy-trusted-headers". e.g. 192.168.1.0/24
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_PROXY_TRUSTED_ORIGINS</code> |
| Default | <code>[]</code> |
### --redirect-to-access-url
Specifies whether to redirect requests that do not match the access URL host.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_REDIRECT_TO_ACCESS_URL</code> |
| Default | <code>false</code> |
### --secure-auth-cookie
Controls if the 'Secure' property is set on browser session cookies.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_SECURE_AUTH_COOKIE</code> |
| Default | <code>false</code> |
### --session-duration
The token expiry duration for browser sessions. Sessions may last longer if they are actively making requests, but this functionality can be disabled via --disable-session-expiry-refresh.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_MAX_SESSION_EXPIRY</code> |
| Default | <code>24h0m0s</code> |
### --ssh-keygen-algorithm
The algorithm to use for generating ssh keys. Accepted values are "ed25519", "ecdsa", or "rsa4096".
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_SSH_KEYGEN_ALGORITHM</code> |
| Default | <code>ed25519</code> |
### --strict-transport-security
Controls if the 'Strict-Transport-Security' header is set on all static file responses. This header should only be set if the server is accessed via HTTPS. This value is the MaxAge in seconds of the header.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_STRICT_TRANSPORT_SECURITY</code> |
| Default | <code>0</code> |
### --strict-transport-security-options
Two optional fields can be set in the Strict-Transport-Security header; 'includeSubDomains' and 'preload'. The 'strict-transport-security' flag must be set to a non-zero value for these options to be used.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_STRICT_TRANSPORT_SECURITY_OPTIONS</code> |
| Default | <code>[]</code> |
### --swagger-enable
Expose the swagger endpoint via /swagger.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_SWAGGER_ENABLE</code> |
| Default | <code>false</code> |
### --telemetry
Whether telemetry is enabled or not. Coder collects anonymized usage data to help improve our product.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_TELEMETRY_ENABLE</code> |
| Default | <code>true</code> |
### --telemetry-trace
Whether Opentelemetry traces are sent to Coder. Coder collects anonymized application tracing to help improve our product. Disabling telemetry also disables this option.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_TELEMETRY_TRACE</code> |
| Default | <code>true</code> |
### --tls-address
HTTPS bind address of the server.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_TLS_ADDRESS</code> |
| Default | <code>127.0.0.1:3443</code> |
### --tls-cert-file
Path to each certificate for TLS. It requires a PEM-encoded file. To configure the listener to use a CA certificate, concatenate the primary certificate and the CA certificate together. The primary certificate should appear first in the combined file.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_TLS_CERT_FILE</code> |
| Default | <code>[]</code> |
### --tls-client-auth
Policy the server will follow for TLS Client Authentication. Accepted values are "none", "request", "require-any", "verify-if-given", or "require-and-verify".
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_TLS_CLIENT_AUTH</code> |
| Default | <code>none</code> |
### --tls-client-ca-file
PEM-encoded Certificate Authority file used for checking the authenticity of client
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_TLS_CLIENT_CA_FILE</code> |
### --tls-client-cert-file
Path to certificate for client TLS authentication. It requires a PEM-encoded file.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_TLS_CLIENT_CERT_FILE</code> |
### --tls-client-key-file
Path to key for client TLS authentication. It requires a PEM-encoded file.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_TLS_CLIENT_KEY_FILE</code> |
### --tls-enable
Whether TLS will be enabled.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_TLS_ENABLE</code> |
| Default | <code>false</code> |
### --tls-key-file
Paths to the private keys for each of the certificates. It requires a PEM-encoded file.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_TLS_KEY_FILE</code> |
| Default | <code>[]</code> |
### --tls-min-version
Minimum supported version of TLS. Accepted values are "tls10", "tls11", "tls12" or "tls13"
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_TLS_MIN_VERSION</code> |
| Default | <code>tls12</code> |
### --trace
Whether application tracing data is collected. It exports to a backend configured by environment variables. See: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_TRACE_ENABLE</code> |
| Default | <code>false</code> |
### --trace-honeycomb-api-key
Enables trace exporting to Honeycomb.io using the provided API Key.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_TRACE_HONEYCOMB_API_KEY</code> |
### --trace-logs
Enables capturing of logs as events in traces. This is useful for debugging, but may result in a very large amount of events being sent to the tracing backend which may incur significant costs. If the verbose flag was supplied, debug-level logs will be included.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_TRACE_CAPTURE_LOGS</code> |
| Default | <code>false</code> |
### --update-check
Periodically check for new releases of Coder and inform the owner. The check is performed once per day.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_UPDATE_CHECK</code> |
| Default | <code>false</code> |
### --wildcard-access-url
Specifies the wildcard hostname to use for workspace applications in the form "\*.example.com".
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_WILDCARD_ACCESS_URL</code> |

View File

@ -1,41 +1,54 @@
## coder server create-admin-user
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder server create-admin-user
Create a new admin user with the given username, email and password and adds it to every organization.
```
## Usage
```console
coder server create-admin-user [flags]
```
### Options
## Flags
```
--email string The email of the new user. If not specified, you will be prompted via stdin. Consumes $CODER_EMAIL.
-h, --help help for create-admin-user
--password string The password of the new user. If not specified, you will be prompted via stdin. Consumes $CODER_PASSWORD.
--postgres-url string URL of a PostgreSQL database. If empty, the built-in PostgreSQL deployment will be used (Coder must not be already running in this case). Consumes $CODER_POSTGRES_URL.
--ssh-keygen-algorithm string The algorithm to use for generating ssh keys. Accepted values are "ed25519", "ecdsa", or "rsa4096". Consumes $CODER_SSH_KEYGEN_ALGORITHM. (default "ed25519")
--username string The username of the new user. If not specified, you will be prompted via stdin. Consumes $CODER_USERNAME.
```
### --email
### Options inherited from parent commands
The email of the new user. If not specified, you will be prompted via stdin.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_EMAIL</code> |
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### --password
### SEE ALSO
The password of the new user. If not specified, you will be prompted via stdin.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_PASSWORD</code> |
- [coder server](coder_server.md) - Start a Coder server
### --postgres-url
URL of a PostgreSQL database. If empty, the built-in PostgreSQL deployment will be used (Coder must not be already running in this case).
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_POSTGRES_URL</code> |
### --ssh-keygen-algorithm
The algorithm to use for generating ssh keys. Accepted values are "ed25519", "ecdsa", or "rsa4096".
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_SSH_KEYGEN_ALGORITHM</code> |
| Default | <code>ed25519</code> |
### --username
The username of the new user. If not specified, you will be prompted via stdin.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_USERNAME</code> |

View File

@ -1,37 +1,21 @@
## coder server postgres-builtin-serve
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder server postgres-builtin-serve
Run the built-in PostgreSQL deployment.
```
## Usage
```console
coder server postgres-builtin-serve [flags]
```
### Options
## Flags
```
-h, --help help for postgres-builtin-serve
--raw-url Output the raw connection URL instead of a psql command.
```
### --raw-url
### Options inherited from parent commands
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder server](coder_server.md) - Start a Coder server
Output the raw connection URL instead of a psql command.
<br/>
| | |
| --- | --- |
| Default | <code>false</code> |

View File

@ -1,37 +1,21 @@
## coder server postgres-builtin-url
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder server postgres-builtin-url
Output the connection URL for the built-in PostgreSQL deployment.
```
## Usage
```console
coder server postgres-builtin-url [flags]
```
### Options
## Flags
```
-h, --help help for postgres-builtin-url
--raw-url Output the raw connection URL instead of a psql command.
```
### --raw-url
### Options inherited from parent commands
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder server](coder_server.md) - Start a Coder server
Output the raw connection URL instead of a psql command.
<br/>
| | |
| --- | --- |
| Default | <code>false</code> |

View File

@ -1,36 +1,11 @@
## coder show
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder show
Display details of a workspace's resources and agents
```
## Usage
```console
coder show <workspace> [flags]
```
### Options
```
-h, --help help for show
```
### Options inherited from parent commands
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder](coder.md) -

View File

@ -1,39 +1,37 @@
## coder speedtest
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder speedtest
Run upload and download tests from your machine to a workspace
```
## Usage
```console
coder speedtest <workspace> [flags]
```
### Options
## Flags
```
-d, --direct Specifies whether to wait for a direct connection before testing speed.
--direction string Specifies whether to run in reverse mode where the client receives and the server sends. (up|down) (default "down")
-h, --help help for speedtest
-t, --time duration Specifies the duration to monitor traffic. (default 5s)
```
### --direct, -d
### Options inherited from parent commands
Specifies whether to wait for a direct connection before testing speed.
<br/>
| | |
| --- | --- |
| Default | <code>false</code> |
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### --direction
### SEE ALSO
Specifies whether to run in reverse mode where the client receives and the server sends. (up|down)
<br/>
| | |
| --- | --- |
| Default | <code>down</code> |
- [coder](coder.md) -
### --time, -t
Specifies the duration to monitor traffic.
<br/>
| | |
| --- | --- |
| Default | <code>5s</code> |

View File

@ -1,48 +1,66 @@
## coder ssh
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder ssh
Start a shell into a workspace
```
## Usage
```console
coder ssh <workspace> [flags]
```
### Options
## Flags
```
-A, --forward-agent Specifies whether to forward the SSH agent specified in $SSH_AUTH_SOCK.
Consumes $CODER_SSH_FORWARD_AGENT
-G, --forward-gpg Specifies whether to forward the GPG agent. Unsupported on Windows workspaces, but supports all clients. Requires gnupg (gpg, gpgconf) on both the client and workspace. The GPG agent must already be running locally and will not be started for you. If a GPG agent is already running in the workspace, it will be attempted to be killed.
Consumes $CODER_SSH_FORWARD_GPG
-h, --help help for ssh
--identity-agent string Specifies which identity agent to use (overrides $SSH_AUTH_SOCK), forward agent must also be enabled.
Consumes $CODER_SSH_IDENTITY_AGENT
--no-wait Specifies whether to wait for a workspace to become ready before logging in (only applicable when the login before ready option has not been enabled). Note that the workspace agent may still be in the process of executing the startup script and the workspace may be in an incomplete state.
Consumes $CODER_SSH_NO_WAIT
--stdio Specifies whether to emit SSH output over stdin/stdout.
Consumes $CODER_SSH_STDIO
--workspace-poll-interval duration Specifies how often to poll for workspace automated shutdown.
Consumes $CODER_WORKSPACE_POLL_INTERVAL (default 1m0s)
```
### --forward-agent, -A
### Options inherited from parent commands
Specifies whether to forward the SSH agent specified in $SSH_AUTH_SOCK.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_SSH_FORWARD_AGENT</code> |
| Default | <code>false</code> |
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### --forward-gpg, -G
### SEE ALSO
Specifies whether to forward the GPG agent. Unsupported on Windows workspaces, but supports all clients. Requires gnupg (gpg, gpgconf) on both the client and workspace. The GPG agent must already be running locally and will not be started for you. If a GPG agent is already running in the workspace, it will be attempted to be killed.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_SSH_FORWARD_GPG</code> |
| Default | <code>false</code> |
- [coder](coder.md) -
### --identity-agent
Specifies which identity agent to use (overrides $SSH_AUTH_SOCK), forward agent must also be enabled.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_SSH_IDENTITY_AGENT</code> |
### --no-wait
Specifies whether to wait for a workspace to become ready before logging in (only applicable when the login before ready option has not been enabled). Note that the workspace agent may still be in the process of executing the startup script and the workspace may be in an incomplete state.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_SSH_NO_WAIT</code> |
| Default | <code>false</code> |
### --stdio
Specifies whether to emit SSH output over stdin/stdout.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_SSH_STDIO</code> |
| Default | <code>false</code> |
### --workspace-poll-interval
Specifies how often to poll for workspace automated shutdown.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_WORKSPACE_POLL_INTERVAL</code> |
| Default | <code>1m0s</code> |

View File

@ -1,37 +1,21 @@
## coder start
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder start
Start a workspace
```
## Usage
```console
coder start <workspace> [flags]
```
### Options
## Flags
```
-h, --help help for start
-y, --yes Bypass prompts
```
### --yes, -y
### Options inherited from parent commands
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder](coder.md) -
Bypass prompts
<br/>
| | |
| --- | --- |
| Default | <code>false</code> |

View File

@ -1,38 +1,18 @@
## coder state
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder state
Manually manage Terraform state to fix broken workspaces
```
## Usage
```console
coder state [flags]
```
### Options
## Subcommands
```
-h, --help help for state
```
### Options inherited from parent commands
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder](coder.md) -
- [coder state pull](coder_state_pull.md) -
- [coder state push](coder_state_push.md) -
| Name | Purpose |
| --------------------------------------- | --------------------------------------------- |
| [<code>pull</code>](./coder_state_pull) | Pull a Terraform state file from a workspace. |
| [<code>push</code>](./coder_state_push) | Push a Terraform state file to a workspace. |

View File

@ -1,35 +1,21 @@
## coder state pull
<!-- DO NOT EDIT | GENERATED CONTENT -->
```
# coder state pull
Pull a Terraform state file from a workspace.
## Usage
```console
coder state pull <workspace> [file] [flags]
```
### Options
## Flags
```
-b, --build int Specify a workspace build to target by name.
-h, --help help for pull
```
### --build, -b
### Options inherited from parent commands
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder state](coder_state.md) - Manually manage Terraform state to fix broken workspaces
Specify a workspace build to target by name.
<br/>
| | |
| --- | --- |
| Default | <code>0</code> |

View File

@ -1,35 +1,21 @@
## coder state push
<!-- DO NOT EDIT | GENERATED CONTENT -->
```
# coder state push
Push a Terraform state file to a workspace.
## Usage
```console
coder state push <workspace> <file> [flags]
```
### Options
## Flags
```
-b, --build int Specify a workspace build to target by name.
-h, --help help for push
```
### --build, -b
### Options inherited from parent commands
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder state](coder_state.md) - Manually manage Terraform state to fix broken workspaces
Specify a workspace build to target by name.
<br/>
| | |
| --- | --- |
| Default | <code>0</code> |

View File

@ -1,37 +1,21 @@
## coder stop
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder stop
Stop a workspace
```
## Usage
```console
coder stop <workspace> [flags]
```
### Options
## Flags
```
-h, --help help for stop
-y, --yes Bypass prompts
```
### --yes, -y
### Options inherited from parent commands
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder](coder.md) -
Bypass prompts
<br/>
| | |
| --- | --- |
| Default | <code>false</code> |

View File

@ -1,18 +1,18 @@
## coder templates
<!-- DO NOT EDIT | GENERATED CONTENT -->
Manage templates
### Synopsis
# coder templates
Templates are written in standard Terraform and describe the infrastructure for workspaces
```
## Usage
```console
coder templates [flags]
```
### Examples
## Examples
```
```console
- Create a template for developers to create workspaces:
$ coder templates create
@ -26,40 +26,16 @@ coder templates [flags]
$ coder templates push my-template
```
### Options
## Subcommands
```
-h, --help help for templates
```
### Options inherited from parent commands
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder](coder.md) -
- [coder templates create](coder_templates_create.md) - Create a template from the current directory or as specified by flag
- [coder templates delete](coder_templates_delete.md) - Delete templates
- [coder templates edit](coder_templates_edit.md) - Edit the metadata of a template by name.
- [coder templates init](coder_templates_init.md) - Get started with a templated template.
- [coder templates list](coder_templates_list.md) - List all the templates available for the organization
- [coder templates plan](coder_templates_plan.md) - Plan a template push from the current directory
- [coder templates pull](coder_templates_pull.md) - Download the latest version of a template to a path.
- [coder templates push](coder_templates_push.md) - Push a new template version from the current directory or as specified by flag
- [coder templates versions](coder_templates_versions.md) - Manage different versions of the specified template
| Name | Purpose |
| --------------------------------------------------- | ------------------------------------------------------------------------------ |
| [<code>create</code>](./coder_templates_create) | Create a template from the current directory or as specified by flag |
| [<code>delete</code>](./coder_templates_delete) | Delete templates |
| [<code>edit</code>](./coder_templates_edit) | Edit the metadata of a template by name. |
| [<code>init</code>](./coder_templates_init) | Get started with a templated template. |
| [<code>list</code>](./coder_templates_list) | List all the templates available for the organization |
| [<code>plan</code>](./coder_templates_plan) | Plan a template push from the current directory |
| [<code>pull</code>](./coder_templates_pull) | Download the latest version of a template to a path. |
| [<code>push</code>](./coder_templates_push) | Push a new template version from the current directory or as specified by flag |
| [<code>versions</code>](./coder_templates_versions) | Manage different versions of the specified template |

View File

@ -1,43 +1,67 @@
## coder templates create
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder templates create
Create a template from the current directory or as specified by flag
```
## Usage
```console
coder templates create [name] [flags]
```
### Options
## Flags
```
--default-ttl duration Specify a default TTL for workspaces created from this template. (default 24h0m0s)
-d, --directory string Specify the directory to create from, use '-' to read tar from stdin (default "<current-directory>")
-h, --help help for create
--parameter-file string Specify a file path with parameter values.
--provisioner-tag stringArray Specify a set of tags to target provisioner daemons.
--variable stringArray Specify a set of values for Terraform-managed variables.
--variables-file string Specify a file path with values for Terraform-managed variables.
-y, --yes Bypass prompts
```
### --default-ttl
### Options inherited from parent commands
Specify a default TTL for workspaces created from this template.
<br/>
| | |
| --- | --- |
| Default | <code>24h0m0s</code> |
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### --directory, -d
### SEE ALSO
Specify the directory to create from, use '-' to read tar from stdin
<br/>
| | |
| --- | --- |
| Default | <code>.</code> |
- [coder templates](coder_templates.md) - Manage templates
### --parameter-file
Specify a file path with parameter values.
<br/>
| | |
| --- | --- |
### --provisioner-tag
Specify a set of tags to target provisioner daemons.
<br/>
| | |
| --- | --- |
| Default | <code>[]</code> |
### --variable
Specify a set of values for Terraform-managed variables.
<br/>
| | |
| --- | --- |
| Default | <code>[]</code> |
### --variables-file
Specify a file path with values for Terraform-managed variables.
<br/>
| | |
| --- | --- |
### --yes, -y
Bypass prompts
<br/>
| | |
| --- | --- |
| Default | <code>false</code> |

View File

@ -1,37 +1,21 @@
## coder templates delete
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder templates delete
Delete templates
```
## Usage
```console
coder templates delete [name...] [flags]
```
### Options
## Flags
```
-h, --help help for delete
-y, --yes Bypass prompts
```
### --yes, -y
### Options inherited from parent commands
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder templates](coder_templates.md) - Manage templates
Bypass prompts
<br/>
| | |
| --- | --- |
| Default | <code>false</code> |

View File

@ -1,43 +1,65 @@
## coder templates edit
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder templates edit
Edit the metadata of a template by name.
```
## Usage
```console
coder templates edit <template> [flags]
```
### Options
## Flags
```
--allow-user-cancel-workspace-jobs Allow users to cancel in-progress workspace jobs. (default true)
--default-ttl duration Edit the template default time before shutdown - workspaces created from this template to this value.
--description string Edit the template description
--display-name string Edit the template display name
-h, --help help for edit
--icon string Edit the template icon path
--name string Edit the template name
-y, --yes Bypass prompts
```
### --allow-user-cancel-workspace-jobs
### Options inherited from parent commands
Allow users to cancel in-progress workspace jobs.
<br/>
| | |
| --- | --- |
| Default | <code>true</code> |
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### --default-ttl
### SEE ALSO
Edit the template default time before shutdown - workspaces created from this template to this value.
<br/>
| | |
| --- | --- |
| Default | <code>0s</code> |
- [coder templates](coder_templates.md) - Manage templates
### --description
Edit the template description
<br/>
| | |
| --- | --- |
### --display-name
Edit the template display name
<br/>
| | |
| --- | --- |
### --icon
Edit the template icon path
<br/>
| | |
| --- | --- |
### --name
Edit the template name
<br/>
| | |
| --- | --- |
### --yes, -y
Bypass prompts
<br/>
| | |
| --- | --- |
| Default | <code>false</code> |

View File

@ -1,36 +1,11 @@
## coder templates init
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder templates init
Get started with a templated template.
```
## Usage
```console
coder templates init [directory] [flags]
```
### Options
```
-h, --help help for init
```
### Options inherited from parent commands
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder templates](coder_templates.md) - Manage templates

View File

@ -1,38 +1,29 @@
## coder templates list
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder templates list
List all the templates available for the organization
```
## Usage
```console
coder templates list [flags]
```
### Options
## Flags
```
-c, --column strings Columns to display in table output. Available columns: name, created at, last updated, organization id, provisioner, active version id, used by, default ttl (default [name,last updated,used by])
-h, --help help for list
-o, --output string Output format. Available formats: table, json (default "table")
```
### --column, -c
### Options inherited from parent commands
Columns to display in table output. Available columns: name, created at, last updated, organization id, provisioner, active version id, used by, default ttl
<br/>
| | |
| --- | --- |
| Default | <code>[name,last updated,used by]</code> |
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### --output, -o
### SEE ALSO
- [coder templates](coder_templates.md) - Manage templates
Output format. Available formats: table, json
<br/>
| | |
| --- | --- |
| Default | <code>table</code> |

View File

@ -1,36 +1,11 @@
## coder templates plan
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder templates plan
Plan a template push from the current directory
```
## Usage
```console
coder templates plan <directory> [flags]
```
### Options
```
-h, --help help for plan
```
### Options inherited from parent commands
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder templates](coder_templates.md) - Manage templates

View File

@ -1,38 +1,29 @@
## coder templates pull
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder templates pull
Download the latest version of a template to a path.
```
## Usage
```console
coder templates pull <name> [destination] [flags]
```
### Options
## Flags
```
-h, --help help for pull
--tar output the template as a tar archive to stdout
-y, --yes Bypass prompts
```
### --tar
### Options inherited from parent commands
output the template as a tar archive to stdout
<br/>
| | |
| --- | --- |
| Default | <code>false</code> |
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### --yes, -y
### SEE ALSO
- [coder templates](coder_templates.md) - Manage templates
Bypass prompts
<br/>
| | |
| --- | --- |
| Default | <code>false</code> |

View File

@ -1,44 +1,74 @@
## coder templates push
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder templates push
Push a new template version from the current directory or as specified by flag
```
## Usage
```console
coder templates push [template] [flags]
```
### Options
## Flags
```
--always-prompt Always prompt all parameters. Does not pull parameter values from active template version
-d, --directory string Specify the directory to create from, use '-' to read tar from stdin (default "<current-directory>")
-h, --help help for push
--name string Specify a name for the new template version. It will be automatically generated if not provided.
--parameter-file string Specify a file path with parameter values.
--provisioner-tag stringArray Specify a set of tags to target provisioner daemons.
--variable stringArray Specify a set of values for Terraform-managed variables.
--variables-file string Specify a file path with values for Terraform-managed variables.
-y, --yes Bypass prompts
```
### --always-prompt
### Options inherited from parent commands
Always prompt all parameters. Does not pull parameter values from active template version
<br/>
| | |
| --- | --- |
| Default | <code>false</code> |
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### --directory, -d
### SEE ALSO
Specify the directory to create from, use '-' to read tar from stdin
<br/>
| | |
| --- | --- |
| Default | <code>.</code> |
- [coder templates](coder_templates.md) - Manage templates
### --name
Specify a name for the new template version. It will be automatically generated if not provided.
<br/>
| | |
| --- | --- |
### --parameter-file
Specify a file path with parameter values.
<br/>
| | |
| --- | --- |
### --provisioner-tag
Specify a set of tags to target provisioner daemons.
<br/>
| | |
| --- | --- |
| Default | <code>[]</code> |
### --variable
Specify a set of values for Terraform-managed variables.
<br/>
| | |
| --- | --- |
| Default | <code>[]</code> |
### --variables-file
Specify a file path with values for Terraform-managed variables.
<br/>
| | |
| --- | --- |
### --yes, -y
Bypass prompts
<br/>
| | |
| --- | --- |
| Default | <code>false</code> |

View File

@ -1,45 +1,25 @@
## coder templates versions
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder templates versions
Manage different versions of the specified template
```
## Usage
```console
coder templates versions [flags]
```
### Examples
## Examples
```
```console
- List versions of a specific template:
$ coder templates versions list my-template
```
### Options
## Subcommands
```
-h, --help help for versions
```
### Options inherited from parent commands
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder templates](coder_templates.md) - Manage templates
- [coder templates versions list](coder_templates_versions_list.md) - List all the versions of the specified template
| Name | Purpose |
| ---------------------------------------------------- | ----------------------------------------------- |
| [<code>list</code>](./coder_templates_versions_list) | List all the versions of the specified template |

View File

@ -1,38 +1,29 @@
## coder templates versions list
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder templates versions list
List all the versions of the specified template
```
## Usage
```console
coder templates versions list <template> [flags]
```
### Options
## Flags
```
-c, --column strings Columns to display in table output. Available columns: name, created at, created by, status, active (default [name,created at,created by,status,active])
-h, --help help for list
-o, --output string Output format. Available formats: table, json (default "table")
```
### --column, -c
### Options inherited from parent commands
Columns to display in table output. Available columns: name, created at, created by, status, active
<br/>
| | |
| --- | --- |
| Default | <code>[name,created at,created by,status,active]</code> |
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### --output, -o
### SEE ALSO
- [coder templates versions](coder_templates_versions.md) - Manage different versions of the specified template
Output format. Available formats: table, json
<br/>
| | |
| --- | --- |
| Default | <code>table</code> |

View File

@ -1,18 +1,18 @@
## coder tokens
<!-- DO NOT EDIT | GENERATED CONTENT -->
Manage personal access tokens
### Synopsis
# coder tokens
Tokens are used to authenticate automated clients to Coder.
```
## Usage
```console
coder tokens [flags]
```
### Examples
## Examples
```
```console
- Create a token for automation:
$ coder tokens create
@ -26,34 +26,10 @@ coder tokens [flags]
$ coder tokens rm WuoWs4ZsMX
```
### Options
## Subcommands
```
-h, --help help for tokens
```
### Options inherited from parent commands
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder](coder.md) -
- [coder tokens create](coder_tokens_create.md) - Create a tokens
- [coder tokens list](coder_tokens_list.md) - List tokens
- [coder tokens remove](coder_tokens_remove.md) - Delete a token
| Name | Purpose |
| -------------------------------------------- | --------------- |
| [<code>create</code>](./coder_tokens_create) | Create a tokens |
| [<code>list</code>](./coder_tokens_list) | List tokens |
| [<code>remove</code>](./coder_tokens_remove) | Delete a token |

View File

@ -1,38 +1,22 @@
## coder tokens create
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder tokens create
Create a tokens
```
## Usage
```console
coder tokens create [flags]
```
### Options
## Flags
```
-h, --help help for create
--lifetime duration Specify a duration for the lifetime of the token.
Consumes $CODER_TOKEN_LIFETIME (default 720h0m0s)
```
### --lifetime
### Options inherited from parent commands
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder tokens](coder_tokens.md) - Manage personal access tokens
Specify a duration for the lifetime of the token.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_TOKEN_LIFETIME</code> |
| Default | <code>720h0m0s</code> |

View File

@ -1,38 +1,29 @@
## coder tokens list
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder tokens list
List tokens
```
## Usage
```console
coder tokens list [flags]
```
### Options
## Flags
```
-c, --column strings Columns to display in table output. Available columns: id, last used, expires at, created at (default [id,last used,expires at,created at])
-h, --help help for list
-o, --output string Output format. Available formats: table, json (default "table")
```
### --column, -c
### Options inherited from parent commands
Columns to display in table output. Available columns: id, last used, expires at, created at
<br/>
| | |
| --- | --- |
| Default | <code>[id,last used,expires at,created at]</code> |
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### --output, -o
### SEE ALSO
- [coder tokens](coder_tokens.md) - Manage personal access tokens
Output format. Available formats: table, json
<br/>
| | |
| --- | --- |
| Default | <code>table</code> |

View File

@ -1,36 +1,11 @@
## coder tokens remove
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder tokens remove
Delete a token
```
## Usage
```console
coder tokens remove [id] [flags]
```
### Options
```
-h, --help help for remove
```
### Options inherited from parent commands
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder tokens](coder_tokens.md) - Manage personal access tokens

View File

@ -1,41 +1,37 @@
## coder update
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder update
Update a workspace
```
## Usage
```console
coder update <workspace> [flags]
```
### Options
## Flags
```
--always-prompt Always prompt all parameters. Does not pull parameter values from existing workspace
-h, --help help for update
--parameter-file string Specify a file path with parameter values.
Consumes $CODER_PARAMETER_FILE
--rich-parameter-file string Specify a file path with values for rich parameters defined in the template.
Consumes $CODER_RICH_PARAMETER_FILE
```
### --always-prompt
### Options inherited from parent commands
Always prompt all parameters. Does not pull parameter values from existing workspace
<br/>
| | |
| --- | --- |
| Default | <code>false</code> |
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### --parameter-file
### SEE ALSO
Specify a file path with parameter values.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_PARAMETER_FILE</code> |
- [coder](coder.md) -
### --rich-parameter-file
Specify a file path with values for rich parameters defined in the template.
<br/>
| | |
| --- | --- |
| Consumes | <code>$CODER_RICH_PARAMETER_FILE</code> |

View File

@ -1,41 +1,21 @@
## coder users
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder users
Manage users
```
## Usage
```console
coder users [flags]
```
### Options
## Subcommands
```
-h, --help help for users
```
### Options inherited from parent commands
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder](coder.md) -
- [coder users activate](coder_users_activate.md) - Update a user's status to 'active'. Active users can fully interact with the platform
- [coder users create](coder_users_create.md) -
- [coder users list](coder_users_list.md) -
- [coder users show](coder_users_show.md) - Show a single user. Use 'me' to indicate the currently authenticated user.
- [coder users suspend](coder_users_suspend.md) - Update a user's status to 'suspended'. A suspended user cannot log into the platform
| Name | Purpose |
| ----------------------------------------------- | ------------------------------------------------------------------------------------- |
| [<code>activate</code>](./coder_users_activate) | Update a user's status to 'active'. Active users can fully interact with the platform |
| [<code>create</code>](./coder_users_create) | |
| [<code>list</code>](./coder_users_list) | |
| [<code>show</code>](./coder_users_show) | Show a single user. Use 'me' to indicate the currently authenticated user. |
| [<code>suspend</code>](./coder_users_suspend) | Update a user's status to 'suspended'. A suspended user cannot log into the platform |

View File

@ -1,43 +1,27 @@
## coder users activate
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder users activate
Update a user's status to 'active'. Active users can fully interact with the platform
```
## Usage
```console
coder users activate <username|user_id> [flags]
```
### Examples
## Examples
```
```console
$ coder users activate example_user
```
### Options
## Flags
```
-c, --column stringArray Specify a column to filter in the table. (default [username,email,created_at,status])
-h, --help help for activate
```
### --column, -c
### Options inherited from parent commands
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder users](coder_users.md) - Manage users
Specify a column to filter in the table.
<br/>
| | |
| --- | --- |
| Default | <code>[username,email,created_at,status]</code> |

View File

@ -1,37 +1,32 @@
## coder users create
<!-- DO NOT EDIT | GENERATED CONTENT -->
```
# coder users create
## Usage
```console
coder users create [flags]
```
### Options
## Flags
```
-e, --email string Specifies an email address for the new user.
-h, --help help for create
-p, --password string Specifies a password for the new user.
-u, --username string Specifies a username for the new user.
```
### --email, -e
### Options inherited from parent commands
Specifies an email address for the new user.
<br/>
| | |
| --- | --- |
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### --password, -p
### SEE ALSO
Specifies a password for the new user.
<br/>
| | |
| --- | --- |
- [coder users](coder_users.md) - Manage users
### --username, -u
Specifies a username for the new user.
<br/>
| | |
| --- | --- |

View File

@ -1,36 +1,27 @@
## coder users list
<!-- DO NOT EDIT | GENERATED CONTENT -->
```
# coder users list
## Usage
```console
coder users list [flags]
```
### Options
## Flags
```
-c, --column strings Columns to display in table output. Available columns: id, username, email, created at, status (default [username,email,created_at,status])
-h, --help help for list
-o, --output string Output format. Available formats: table, json (default "table")
```
### --column, -c
### Options inherited from parent commands
Columns to display in table output. Available columns: id, username, email, created at, status
<br/>
| | |
| --- | --- |
| Default | <code>[username,email,created_at,status]</code> |
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### --output, -o
### SEE ALSO
- [coder users](coder_users.md) - Manage users
Output format. Available formats: table, json
<br/>
| | |
| --- | --- |
| Default | <code>table</code> |

View File

@ -1,43 +1,27 @@
## coder users show
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder users show
Show a single user. Use 'me' to indicate the currently authenticated user.
```
## Usage
```console
coder users show <username|user_id|'me'> [flags]
```
### Examples
## Examples
```
```console
$ coder users show me
```
### Options
## Flags
```
-h, --help help for show
-o, --output string Output format. Available formats: table, json (default "table")
```
### --output, -o
### Options inherited from parent commands
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder users](coder_users.md) - Manage users
Output format. Available formats: table, json
<br/>
| | |
| --- | --- |
| Default | <code>table</code> |

View File

@ -1,43 +1,27 @@
## coder users suspend
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder users suspend
Update a user's status to 'suspended'. A suspended user cannot log into the platform
```
## Usage
```console
coder users suspend <username|user_id> [flags]
```
### Examples
## Examples
```
```console
$ coder users suspend example_user
```
### Options
## Flags
```
-c, --column stringArray Specify a column to filter in the table. (default [username,email,created_at,status])
-h, --help help for suspend
```
### --column, -c
### Options inherited from parent commands
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder users](coder_users.md) - Manage users
Specify a column to filter in the table.
<br/>
| | |
| --- | --- |
| Default | <code>[username,email,created_at,status]</code> |

View File

@ -1,36 +1,11 @@
## coder version
<!-- DO NOT EDIT | GENERATED CONTENT -->
# coder version
Show coder version
```
## Usage
```console
coder version [flags]
```
### Options
```
-h, --help help for version
```
### Options inherited from parent commands
```
--global-config coder Path to the global coder config directory.
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
Consumes $CODER_HEADER
--no-feature-warning Suppress warnings about unlicensed features.
Consumes $CODER_NO_FEATURE_WARNING
--no-version-warning Suppress warning when client and server versions do not match.
Consumes $CODER_NO_VERSION_WARNING
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
Consumes $CODER_SESSION_TOKEN
--url string URL to a deployment.
Consumes $CODER_URL
-v, --verbose Enable verbose output.
Consumes $CODER_VERBOSE
```
### SEE ALSO
- [coder](coder.md) -

View File

@ -423,13 +423,9 @@
{
"title": "Command Line",
"description": "Learn how to use Coder CLI",
"path": "./cli/coder.md",
"path": "./cli.md",
"icon_path": "./images/icons/terminal.svg",
"children": [
{
"title": "coder",
"path": "./cli/coder.md"
},
{
"title": "config-ssh",
"path": "./cli/coder_config-ssh.md"

4
go.mod
View File

@ -58,6 +58,7 @@ require (
cdr.dev/slog v1.4.2-0.20220525200111-18dce5c2cd5f
cloud.google.com/go/compute/metadata v0.2.1
github.com/AlecAivazis/survey/v2 v2.3.5
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d
github.com/adrg/xdg v0.4.0
github.com/andybalholm/brotli v1.0.4
github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2
@ -72,6 +73,7 @@ require (
github.com/charmbracelet/lipgloss v0.6.0
github.com/cli/safeexec v1.0.0
github.com/codeclysm/extract v2.2.0+incompatible
github.com/coder/flog v1.0.0
github.com/coder/retry v1.3.1-0.20230210155434-e90a2e1e091d
github.com/coder/terraform-provider-coder v0.6.11
github.com/coreos/go-oidc/v3 v3.4.0
@ -219,7 +221,6 @@ require (
github.com/containerd/console v1.0.3 // indirect
github.com/containerd/continuity v0.3.0 // indirect
github.com/coreos/go-iptables v0.6.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dlclark/regexp2 v1.7.0 // indirect
github.com/docker/cli v20.10.17+incompatible // indirect
@ -312,7 +313,6 @@ require (
github.com/prometheus/procfs v0.9.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect
github.com/rivo/uniseg v0.4.3 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/spf13/cast v1.5.0 // indirect

6
go.sum
View File

@ -165,6 +165,8 @@ github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdko
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ=
github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8=
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8=
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo=
github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4=
github.com/adrg/xdg v0.4.0 h1:RzRqFcjH4nE5C6oTAxhBtoE2IRyjBSa62SCbyPidvls=
github.com/adrg/xdg v0.4.0/go.mod h1:N6ag73EX4wyxeaoeHctc1mas01KZgsj5tYiAIwqJE/E=
@ -365,6 +367,8 @@ github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoC
github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI=
github.com/codeclysm/extract v2.2.0+incompatible h1:q3wyckoA30bhUSiwdQezMqVhwd8+WGE64/GL//LtUhI=
github.com/codeclysm/extract v2.2.0+incompatible/go.mod h1:2nhFMPHiU9At61hz+12bfrlpXSUrOnK+wR+KlGO4Uks=
github.com/coder/flog v1.0.0 h1:gqr4jYDQWYmsvFD0RV6Vs+SAj1Kbn0HGlV7UghfxP+8=
github.com/coder/flog v1.0.0/go.mod h1:UQlQvrkJBvnRGo69Le8E24Tcl5SJleAAR7gYEHzAmdQ=
github.com/coder/glog v1.0.1-0.20220322161911-7365fe7f2cd1 h1:UqBrPWSYvRI2s5RtOul20JukUEpu4ip9u7biBL+ntgk=
github.com/coder/glog v1.0.1-0.20220322161911-7365fe7f2cd1/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4=
github.com/coder/go-scim/pkg/v2 v2.0.0-20230221055123-1d63c1222136 h1:0RgB61LcNs24WOxc3PBvygSNTQurm0PYPujJjLLOzs0=
@ -504,7 +508,6 @@ github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfc
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
@ -1687,7 +1690,6 @@ github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThC
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w=
github.com/ryancurrah/gomodguard v1.2.3/go.mod h1:rYbA/4Tg5c54mV1sv4sQTP5WOPBcoLtnBZ7/TEhXAbg=

View File

@ -0,0 +1,49 @@
<!-- DO NOT EDIT | GENERATED CONTENT -->
# {{ .Name }}
{{ if .Cmd.Long }}
{{ .Cmd.Long }}
{{ else }}
{{ .Cmd.Short }}
{{ end }}
{{- if .Cmd.Runnable}}
## Usage
```console
{{.Cmd.UseLine}}
```
{{end}}
{{- if .Cmd.HasExample}}
## Examples
```console
{{.Cmd.Example}}
```
{{end}}
{{- range $index, $cmd := .VisibleSubcommands }}
{{- if eq $index 0 }}
## Subcommands
| Name | Purpose |
| ---- | ----- |
{{- end }}
| [{{ $cmd.Name | wrapCode }}](./{{if $.AtRoot}}cli/{{end}}{{commandURI $cmd}}) | {{ $cmd.Short }} |
{{- end}}
{{ "" }}
{{- range $index, $flag := .Flags }}
{{- if eq $index 0 }}
## Flags
{{- end }}
### --{{ $flag.Name }}{{ if $flag.Shorthand}}, -{{ $flag.Shorthand }}{{end}}
{{ $flag.Usage | stripEnv | newLinesToBr }}
<br/>
| | |
| --- | --- |
{{- with $flag.Usage | parseEnv }}
| Consumes | {{ . | wrapCode }} |
{{- end }}
{{- with $flag.DefValue }}
| Default | {{" "}} {{- . | wrapCode }} |
{{ "" }}
{{ end }}
{{ "" }}
{{- end}}

173
scripts/clidocgen/gen.go Normal file
View File

@ -0,0 +1,173 @@
package main
import (
"fmt"
"io"
"os"
"path/filepath"
"regexp"
"strings"
"text/template"
"github.com/acarl005/stripansi"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
_ "embed"
"github.com/coder/coder/buildinfo"
"github.com/coder/flog"
)
//go:embed command.tpl
var commandTemplateRaw string
var commandTemplate *template.Template
var envRegex = regexp.MustCompile(`Consumes (\$\w+).?$`)
func parseEnv(flagUsage string) string {
flagUsage = stripansi.Strip(flagUsage)
ss := envRegex.FindStringSubmatch(flagUsage)
if len(ss) == 0 {
return ""
}
return ss[len(ss)-1]
}
func stripEnv(flagUsage string) string {
flagUsage = stripansi.Strip(flagUsage)
ss := envRegex.FindStringSubmatch(flagUsage)
if len(ss) == 0 {
return flagUsage
}
return strings.TrimSpace(strings.ReplaceAll(flagUsage, ss[0], ""))
}
func init() {
commandTemplate = template.Must(
template.New("command.tpl").Funcs(template.FuncMap{
"newLinesToBr": func(s string) string {
return strings.ReplaceAll(s, "\n", "<br/>")
},
"wrapCode": func(s string) string {
return fmt.Sprintf("<code>%s</code>", s)
},
"parseEnv": parseEnv,
"stripEnv": stripEnv,
"commandURI": func(cmd *cobra.Command) string {
return strings.TrimSuffix(
fmtDocFilename(cmd),
".md",
)
},
},
).Parse(strings.TrimSpace(commandTemplateRaw)),
)
}
func writeCommand(w io.Writer, cmd *cobra.Command) error {
var (
flags []*pflag.Flag
inheritedFlags []*pflag.Flag
)
cmd.Flags().VisitAll(func(f *pflag.Flag) {
if f.Hidden {
return
}
flags = append(flags, f)
})
cmd.InheritedFlags().VisitAll(func(f *pflag.Flag) {
if f.Hidden {
return
}
inheritedFlags = append(inheritedFlags, f)
})
var b strings.Builder
err := commandTemplate.Execute(&b, map[string]any{
"Name": fullCommandName(cmd),
"Cmd": cmd,
"Flags": flags,
"InheritedFlags": inheritedFlags,
"AtRoot": cmd.Parent() == nil,
"VisibleSubcommands": func() []*cobra.Command {
var scs []*cobra.Command
for _, sub := range cmd.Commands() {
if sub.Hidden {
continue
}
scs = append(scs, sub)
}
return scs
}(),
})
if err != nil {
return err
}
content := stripansi.Strip(b.String())
// Remove the version and its right space, since during this script running
// there is no build info available
content = strings.ReplaceAll(content, buildinfo.Version()+" ", "")
// Remove references to the current working directory
cwd, err := os.Getwd()
if err != nil {
return err
}
content = strings.ReplaceAll(content, cwd, ".")
_, err = w.Write([]byte(content))
return err
}
func fullCommandName(cmd *cobra.Command) string {
name := cmd.Name()
if cmd.Parent() != nil {
return fullCommandName(cmd.Parent()) + " " + name
}
return name
}
func fmtDocFilename(cmd *cobra.Command) string {
fullName := fullCommandName(cmd)
if fullName == "coder" {
// Special case for index.
return "../cli.md"
}
name := strings.ReplaceAll(fullName, " ", "_")
return fmt.Sprintf("%s.md", name)
}
func generateDocsTree(rootCmd *cobra.Command, basePath string) error {
if rootCmd.Hidden {
return nil
}
// Write out root.
fi, err := os.OpenFile(
filepath.Join(basePath, fmtDocFilename(rootCmd)),
os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0o644,
)
if err != nil {
return err
}
defer fi.Close()
err = writeCommand(fi, rootCmd)
if err != nil {
return err
}
flog.Info("Generated docs for %q at %v", fullCommandName(rootCmd), fi.Name())
// Recursively generate docs.
for _, subcommand := range rootCmd.Commands() {
err = generateDocsTree(subcommand, basePath)
if err != nil {
return err
}
}
return nil
}

View File

@ -0,0 +1,40 @@
package main
import (
_ "embed"
"testing"
)
func Test_parseEnv(t *testing.T) {
t.Parallel()
type args struct {
flagUsage string
}
tests := []struct {
name string
args args
want string
}{
{
"no env",
args{"Perform a trial run with no changes made, showing a diff at the end."},
"",
},
{
"env",
args{`Specifies the path to an SSH config.
Consumes $CODER_SSH_CONFIG_FILE`},
"$CODER_SSH_CONFIG_FILE",
},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
if got := parseEnv(tt.args.flagUsage); got != tt.want {
t.Errorf("parseEnv() = %v, want %v", got, tt.want)
}
})
}
}

View File

@ -4,15 +4,9 @@ import (
"encoding/json"
"log"
"os"
"os/user"
"path"
"regexp"
"strings"
"github.com/spf13/cobra"
"github.com/spf13/cobra/doc"
"github.com/coder/coder/buildinfo"
"github.com/coder/coder/cli"
)
@ -48,11 +42,6 @@ func main() {
}
}
u, err := user.Current()
if err != nil {
log.Fatal("Error on getting the current user: ", err)
}
// Get the cmd CLI
cmd := cli.Root(cli.AGPL())
@ -64,18 +53,8 @@ func main() {
markdownDocsDir := path.Join(basePath, "docs/cli")
manifestFilepath := path.Join(basePath, "docs/manifest.json")
// Disables the "Auto generated by spf13/cobra" tag
var disableAutoGenTag func(cmd *cobra.Command)
disableAutoGenTag = func(cmd *cobra.Command) {
for _, c := range cmd.Commands() {
disableAutoGenTag(c)
}
cmd.DisableAutoGenTag = true
}
disableAutoGenTag(cmd)
// Generate markdown
err = doc.GenMarkdownTree(cmd, markdownDocsDir)
err := generateDocsTree(cmd, markdownDocsDir)
if err != nil {
log.Fatal("Error on generating CLI markdown docs: ", err)
}
@ -96,38 +75,6 @@ func main() {
Title: title,
Path: "./cli/" + file.Name(),
})
filepath := path.Join(markdownDocsDir, file.Name())
openFile, err := os.ReadFile(filepath)
if err != nil {
log.Fatal("Error on open file at ", filepath, ": ", err)
}
content := string(openFile)
// Remove non printable strings from generated markdown
// https://github.com/spf13/cobra/issues/1878
const ansi = "[\u001B\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"
ansiRegex := regexp.MustCompile(ansi)
content = ansiRegex.ReplaceAllString(content, "")
// Remove the version and its right space, since during this script running
// there is no build info available
content = strings.ReplaceAll(content, buildinfo.Version()+" ", "")
// Remove references to the current working directory
dir, err := os.Getwd()
if err != nil {
log.Fatal("Error on getting the current directory:", err)
}
content = strings.ReplaceAll(content, dir, "<current-directory>")
// Remove all absolute home paths.
content = strings.ReplaceAll(content, u.HomeDir, "~")
err = os.WriteFile(filepath, []byte(content), 0o644) // #nosec
if err != nil {
log.Fatal("Error on save file at ", filepath, ": ", err)
}
}
// Read manifest