docs: Add CLI docs (#5879)

This commit is contained in:
Bruno Quaresma 2023-01-27 15:10:40 -03:00 committed by GitHub
parent a753703e47
commit e0d48e7d79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
61 changed files with 3005 additions and 0 deletions

View File

@ -418,6 +418,7 @@ gen: \
provisionerd/proto/provisionerd.pb.go \
site/src/api/typesGenerated.ts \
docs/admin/prometheus.md \
docs/cli/coder.md \
docs/admin/audit-logs.md \
coderd/apidoc/swagger.json \
.prettierignore.include \
@ -437,6 +438,7 @@ gen/mark-fresh:
provisionerd/proto/provisionerd.pb.go \
site/src/api/typesGenerated.ts \
docs/admin/prometheus.md \
docs/cli/coder.md \
docs/admin/audit-logs.md \
coderd/apidoc/swagger.json \
.prettierignore.include \
@ -492,6 +494,11 @@ docs/admin/prometheus.md: scripts/metricsdocgen/main.go scripts/metricsdocgen/me
cd site
yarn run format:write:only ../docs/admin/prometheus.md
docs/cli/coder.md: scripts/clidocgen/main.go $(shell find ./cli/ -type f)
BASE_PATH="." go run scripts/clidocgen/main.go
cd site
yarn run format:write:only ../docs/cli/**.md
docs/admin/audit-logs.md: scripts/auditdocgen/main.go enterprise/audit/table.go
go run scripts/auditdocgen/main.go
cd site

72
docs/cli/coder.md Normal file
View File

@ -0,0 +1,72 @@
## 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 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
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,58 @@
## coder config-ssh
Add an SSH Host entry for your workspaces "ssh coder.workspace"
```
coder config-ssh [flags]
```
### Examples
```
- You can use -o (or --ssh-option) so set SSH options to be used for all your
workspaces:
$ coder config-ssh -o ForwardAgent=yes
- You can use --dry-run (or -n) to see the changes that would be made:
$ coder config-ssh --dry-run
```
### Options
```
-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
```
### 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) -
###### Auto generated by spf13/cobra on 27-Jan-2023

49
docs/cli/coder_create.md Normal file
View File

@ -0,0 +1,49 @@
## coder create
Create a workspace
```
coder create [name] [flags]
```
### Options
```
-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
```
### 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) -
###### Auto generated by spf13/cobra on 27-Jan-2023

41
docs/cli/coder_delete.md Normal file
View File

@ -0,0 +1,41 @@
## coder delete
Delete a workspace
```
coder delete <workspace> [flags]
```
### Options
```
-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
```
### 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) -
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,49 @@
## coder dotfiles
Checkout and install a dotfiles repository from a Git URL
```
coder dotfiles [git_repo_url] [flags]
```
### Examples
```
- Check out and install a dotfiles repository without prompts:
$ coder dotfiles --yes git@github.com:example/dotfiles.git
```
### Options
```
-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
```
### 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) -
###### Auto generated by spf13/cobra on 27-Jan-2023

41
docs/cli/coder_list.md Normal file
View File

@ -0,0 +1,41 @@
## coder list
List workspaces
```
coder list [flags]
```
### Options
```
-a, --all Specifies whether all workspaces will be listed or not.
-c, --column stringArray Specify a column to filter in the table. Available columns are: workspace, template, status, last_built, outdated, starts_at, stops_after
-h, --help help for list
--search string Search for a workspace with a query. (default "owner:me")
```
### 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) -
###### Auto generated by spf13/cobra on 27-Jan-2023

46
docs/cli/coder_login.md Normal file
View File

@ -0,0 +1,46 @@
## coder login
Authenticate with Coder deployment
```
coder login <url> [flags]
```
### Options
```
--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
```
### 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) -
###### Auto generated by spf13/cobra on 27-Jan-2023

39
docs/cli/coder_logout.md Normal file
View File

@ -0,0 +1,39 @@
## coder logout
Unauthenticate your local session
```
coder logout [flags]
```
### Options
```
-h, --help help for logout
-y, --yes Bypass prompts
```
### 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) -
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,64 @@
## coder port-forward
Forward ports from machine to a workspace
```
coder port-forward <workspace> [flags]
```
### Examples
```
- Port forward a single TCP port from 1234 in the workspace to port 5678 on
your local machine:
$ coder port-forward <workspace> --tcp 5678:1234
- Port forward a single UDP port from port 9000 to port 9000 on your local
machine:
$ coder port-forward <workspace> --udp 9000
- Port forward multiple TCP ports and a UDP port:
$ coder port-forward <workspace> --tcp 8080:8080 --tcp 9000:3000 --udp 5353:53
- Port forward multiple ports (TCP or UDP) in condensed syntax:
$ coder port-forward <workspace> --tcp 8080,9000:3000,9090-9092,10000-10002:10010-10012
```
### Options
```
-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
```
### 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) -
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,40 @@
## coder publickey
Output your Coder public key used for Git operations
```
coder publickey [flags]
```
### Options
```
-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
```
### 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) -
###### Auto generated by spf13/cobra on 27-Jan-2023

39
docs/cli/coder_rename.md Normal file
View File

@ -0,0 +1,39 @@
## coder rename
Rename a workspace
```
coder rename <workspace> <new name> [flags]
```
### Options
```
-h, --help help for rename
-y, --yes Bypass prompts
```
### 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) -
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,40 @@
## coder reset-password
Directly connect to the database to reset a user's password
```
coder reset-password <username> [flags]
```
### Options
```
-h, --help help for reset-password
--postgres-url string URL of a PostgreSQL database to connect to.
Consumes $CODER_PG_CONNECTION_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) -
###### Auto generated by spf13/cobra on 27-Jan-2023

39
docs/cli/coder_restart.md Normal file
View File

@ -0,0 +1,39 @@
## coder restart
Restart a workspace
```
coder restart <workspace> [flags]
```
### Options
```
-h, --help help for restart
-y, --yes Bypass prompts
```
### 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) -
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,44 @@
## coder scaletest
Run a scale test against the Coder API
### Synopsis
Perform scale tests against the Coder server.
```
coder scaletest [flags]
```
### Options
```
-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
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,48 @@
## coder scaletest cleanup
Cleanup any orphaned scaletest resources
### Synopsis
Cleanup scaletest workspaces, then cleanup scaletest users. The strategy flags will apply to each stage of the cleanup process.
```
coder scaletest cleanup [flags]
```
### Options
```
--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
```
### 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 scaletest](coder_scaletest.md) - Run a scale test against the Coder API
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,100 @@
## coder scaletest create-workspaces
Creates many workspaces and waits for them to be ready
### Synopsis
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.
```
coder scaletest create-workspaces [flags]
```
### Options
```
--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
```
### 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 scaletest](coder_scaletest.md) - Run a scale test against the Coder API
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,42 @@
## coder schedule
Schedule automated start and stop times for workspaces
```
coder schedule { show | start | stop | override } <workspace> [flags]
```
### Options
```
-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
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,52 @@
## coder schedule override-stop
Edit stop time of active workspace
### Synopsis
Override the stop time of a currently running workspace instance.
- The new stop time is calculated from _now_.
- The new stop time must be at least 30 minutes in the future.
- The workspace template may restrict the maximum workspace runtime.
```
coder schedule override-stop <workspace-name> <duration from now> [flags]
```
### Examples
```
$ 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
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,47 @@
## coder schedule show
Show workspace schedule
### Synopsis
Shows the following information for the given workspace:
- The automatic start schedule
- The next scheduled start time
- The duration after which it will stop
- The next scheduled stop time
```
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
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,59 @@
## coder schedule start
Edit workspace start schedule
### Synopsis
Schedules a workspace to regularly start at a specific time.
Schedule format: <start-time> [day-of-week] [location].
- Start-time (required) is accepted either in 12-hour (hh:mm{am|pm}) format, or 24-hour format hh:mm.
- Day-of-week (optional) allows specifying in the cron format, e.g. 1,3,5 or Mon-Fri.
Aliases such as @daily are not supported.
Default: \* (every day)
- Location (optional) must be a valid location in the IANA timezone database.
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.
```
coder schedule start <workspace-name> { <start-time> [day-of-week] [location] | manual } [flags]
```
### Examples
```
- 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
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,61 @@
## coder schedule stop
Edit workspace stop schedule
### Synopsis
Schedules a workspace to stop after a given duration has elapsed.
- Workspace runtime is measured from the time that the workspace build completed.
- The minimum scheduled stop time is 1 minute.
- The workspace template may place restrictions on the maximum shutdown time.
- Changes to workspace schedules only take effect upon the next build of the workspace,
and do not affect a running instance of a workspace.
When enabling scheduled stop, enter a duration in one of the following formats:
- 3h2m (3 hours and two minutes)
- 3h (3 hours)
- 2m (2 minutes)
- 2 (2 minutes)
```
coder schedule stop <workspace-name> { <duration> | manual } [flags]
```
### Examples
```
$ 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
###### Auto generated by spf13/cobra on 27-Jan-2023

172
docs/cli/coder_server.md Normal file
View File

@ -0,0 +1,172 @@
## coder server
Start a Coder server
```
coder server [flags]
```
### Options
```
--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-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
--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 for any user creating a 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-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-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
--secure-auth-cookie Controls if the 'Secure' property is set on browser session cookies.
Consumes $CODER_SECURE_AUTH_COOKIE
--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")
--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")
--tls-redirect-http-to-https Whether HTTP requests will be redirected to the access URL (if it's a https URL and TLS is enabled). Requests to local IP addresses are never redirected regardless of this setting.
Consumes $CODER_TLS_REDIRECT_HTTP (default true)
--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
```
### 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 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.
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,39 @@
## coder server postgres-builtin-serve
Run the built-in PostgreSQL deployment.
```
coder server postgres-builtin-serve [flags]
```
### Options
```
-h, --help help for postgres-builtin-serve
--raw-url Output the raw connection URL instead of a psql command.
```
### 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
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,39 @@
## coder server postgres-builtin-url
Output the connection URL for the built-in PostgreSQL deployment.
```
coder server postgres-builtin-url [flags]
```
### Options
```
-h, --help help for postgres-builtin-url
--raw-url Output the raw connection URL instead of a psql command.
```
### 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
###### Auto generated by spf13/cobra on 27-Jan-2023

38
docs/cli/coder_show.md Normal file
View File

@ -0,0 +1,38 @@
## coder show
Display details of a workspace's resources and agents
```
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) -
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,41 @@
## coder speedtest
Run upload and download tests from your machine to a workspace
```
coder speedtest <workspace> [flags]
```
### Options
```
-d, --direct Specifies whether to wait for a direct connection before testing speed.
-h, --help help for speedtest
-r, --reverse Specifies whether to run in reverse mode where the client receives and the server sends.
-t, --time duration Specifies the duration to monitor traffic. (default 5s)
```
### 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) -
###### Auto generated by spf13/cobra on 27-Jan-2023

50
docs/cli/coder_ssh.md Normal file
View File

@ -0,0 +1,50 @@
## coder ssh
Start a shell into a workspace
```
coder ssh <workspace> [flags]
```
### Options
```
-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 delay login until ready option is 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)
```
### 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) -
###### Auto generated by spf13/cobra on 27-Jan-2023

39
docs/cli/coder_start.md Normal file
View File

@ -0,0 +1,39 @@
## coder start
Start a workspace
```
coder start <workspace> [flags]
```
### Options
```
-h, --help help for start
-y, --yes Bypass prompts
```
### 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) -
###### Auto generated by spf13/cobra on 27-Jan-2023

40
docs/cli/coder_state.md Normal file
View File

@ -0,0 +1,40 @@
## coder state
Manually manage Terraform state to fix broken workspaces
```
coder state [flags]
```
### Options
```
-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) -
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,37 @@
## coder state pull
```
coder state pull <workspace> [file] [flags]
```
### Options
```
-b, --build int Specify a workspace build to target by name.
-h, --help help for pull
```
### 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
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,37 @@
## coder state push
```
coder state push <workspace> <file> [flags]
```
### Options
```
-b, --build int Specify a workspace build to target by name.
-h, --help help for push
```
### 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
###### Auto generated by spf13/cobra on 27-Jan-2023

39
docs/cli/coder_stop.md Normal file
View File

@ -0,0 +1,39 @@
## coder stop
Stop a workspace
```
coder stop <workspace> [flags]
```
### Options
```
-h, --help help for stop
-y, --yes Bypass prompts
```
### 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) -
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,67 @@
## coder templates
Manage templates
### Synopsis
Templates are written in standard Terraform and describe the infrastructure for workspaces
```
coder templates [flags]
```
### Examples
```
- Create a template for developers to create workspaces:
$ coder templates create
- Make changes to your template, and plan the changes:
$ coder templates plan my-template
- Push an update to the template. Your developers can update their workspaces:
$ coder templates push my-template
```
### Options
```
-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
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,43 @@
## coder templates create
Create a template from the current directory or as specified by flag
```
coder templates create [name] [flags]
```
### Options
```
--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.
-y, --yes Bypass prompts
```
### 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
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,39 @@
## coder templates delete
Delete templates
```
coder templates delete [name...] [flags]
```
### Options
```
-h, --help help for delete
-y, --yes Bypass prompts
```
### 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
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,45 @@
## coder templates edit
Edit the metadata of a template by name.
```
coder templates edit <template> [flags]
```
### Options
```
--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
```
### 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
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,38 @@
## coder templates init
Get started with a templated template.
```
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
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,39 @@
## coder templates list
List all the templates available for the organization
```
coder templates list [flags]
```
### Options
```
-c, --column stringArray Specify a column to filter in the table. (default [name,last_updated,used_by])
-h, --help help for list
```
### 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
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,38 @@
## coder templates plan
Plan a template push from the current directory
```
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
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,39 @@
## coder templates pull
Download the latest version of a template to a path.
```
coder templates pull <name> [destination] [flags]
```
### Options
```
-h, --help help for pull
-y, --yes Bypass prompts
```
### 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
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,44 @@
## coder templates push
Push a new template version from the current directory or as specified by flag
```
coder templates push [template] [flags]
```
### Options
```
--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.
-y, --yes Bypass prompts
```
### 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
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,47 @@
## coder templates versions
Manage different versions of the specified template
```
coder templates versions [flags]
```
### Examples
```
- List versions of a specific template:
$ coder templates versions list my-template
```
### Options
```
-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
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,38 @@
## coder templates versions list
List all the versions of the specified template
```
coder templates versions list <template> [flags]
```
### Options
```
-h, --help help for list
```
### 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 versions](coder_templates_versions.md) - Manage different versions of the specified template
###### Auto generated by spf13/cobra on 27-Jan-2023

61
docs/cli/coder_tokens.md Normal file
View File

@ -0,0 +1,61 @@
## coder tokens
Manage personal access tokens
### Synopsis
Tokens are used to authenticate automated clients to Coder.
```
coder tokens [flags]
```
### Examples
```
- Create a token for automation:
$ coder tokens create
- List your tokens:
$ coder tokens ls
- Remove a token by ID:
$ coder tokens rm WuoWs4ZsMX
```
### Options
```
-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
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,40 @@
## coder tokens create
Create a tokens
```
coder tokens create [flags]
```
### Options
```
-h, --help help for create
--lifetime duration Specify a duration for the lifetime of the token.
Consumes $CODER_TOKEN_LIFETIME (default 720h0m0s)
```
### 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
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,38 @@
## coder tokens list
List tokens
```
coder tokens list [flags]
```
### Options
```
-h, --help help for list
```
### 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
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,38 @@
## coder tokens remove
Delete a token
```
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
###### Auto generated by spf13/cobra on 27-Jan-2023

43
docs/cli/coder_update.md Normal file
View File

@ -0,0 +1,43 @@
## coder update
Update a workspace
```
coder update <workspace> [flags]
```
### Options
```
--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
```
### 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) -
###### Auto generated by spf13/cobra on 27-Jan-2023

43
docs/cli/coder_users.md Normal file
View File

@ -0,0 +1,43 @@
## coder users
Manage users
```
coder users [flags]
```
### Options
```
-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
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,45 @@
## coder users activate
Update a user's status to 'active'. Active users can fully interact with the platform
```
coder users activate <username|user_id> [flags]
```
### Examples
```
$ coder users activate example_user
```
### Options
```
-c, --column stringArray Specify a column to filter in the table. (default [username,email,created_at,status])
-h, --help help for activate
```
### 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
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,39 @@
## coder users create
```
coder users create [flags]
```
### Options
```
-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.
```
### 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
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,38 @@
## coder users list
```
coder users list [flags]
```
### Options
```
-c, --column stringArray Specify a column to filter in the table. Available columns are: id, username, email, created_at, status. (default [username,email,created_at,status])
-h, --help help for list
-o, --output string Output format. Available formats are: table, json. (default "table")
```
### 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
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,45 @@
## coder users show
Show a single user. Use 'me' to indicate the currently authenticated user.
```
coder users show <username|user_id|'me'> [flags]
```
### Examples
```
$ coder users show me
```
### Options
```
-h, --help help for show
-o, --output string Output format. Available formats are: table, json. (default "table")
```
### 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
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1,45 @@
## coder users suspend
Update a user's status to 'suspended'. A suspended user cannot log into the platform
```
coder users suspend <username|user_id> [flags]
```
### Examples
```
$ coder users suspend example_user
```
### Options
```
-c, --column stringArray Specify a column to filter in the table. (default [username,email,created_at,status])
-h, --help help for suspend
```
### 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
###### Auto generated by spf13/cobra on 27-Jan-2023

38
docs/cli/coder_version.md Normal file
View File

@ -0,0 +1,38 @@
## coder version
Show coder version
```
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) -
###### Auto generated by spf13/cobra on 27-Jan-2023

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-terminal"><polyline points="4 17 10 11 4 5"></polyline><line x1="12" y1="19" x2="20" y2="19"></line></svg>

After

Width:  |  Height:  |  Size: 310 B

View File

@ -409,6 +409,234 @@
"path": "./api/workspaces.md"
}
]
},
{
"title": "Command Line",
"description": "Learn how to use Coder CLI",
"path": "./cli/coder.md",
"icon_path": "./images/icons/terminal.svg",
"children": [
{
"title": "coder",
"path": "./cli/coder.md"
},
{
"title": "config-ssh",
"path": "./cli/coder_config-ssh.md"
},
{
"title": "create",
"path": "./cli/coder_create.md"
},
{
"title": "delete",
"path": "./cli/coder_delete.md"
},
{
"title": "dotfiles",
"path": "./cli/coder_dotfiles.md"
},
{
"title": "list",
"path": "./cli/coder_list.md"
},
{
"title": "login",
"path": "./cli/coder_login.md"
},
{
"title": "logout",
"path": "./cli/coder_logout.md"
},
{
"title": "port-forward",
"path": "./cli/coder_port-forward.md"
},
{
"title": "publickey",
"path": "./cli/coder_publickey.md"
},
{
"title": "rename",
"path": "./cli/coder_rename.md"
},
{
"title": "reset-password",
"path": "./cli/coder_reset-password.md"
},
{
"title": "restart",
"path": "./cli/coder_restart.md"
},
{
"title": "scaletest",
"path": "./cli/coder_scaletest.md"
},
{
"title": "scaletest cleanup",
"path": "./cli/coder_scaletest_cleanup.md"
},
{
"title": "scaletest create-workspaces",
"path": "./cli/coder_scaletest_create-workspaces.md"
},
{
"title": "schedule",
"path": "./cli/coder_schedule.md"
},
{
"title": "schedule override-stop",
"path": "./cli/coder_schedule_override-stop.md"
},
{
"title": "schedule show",
"path": "./cli/coder_schedule_show.md"
},
{
"title": "schedule start",
"path": "./cli/coder_schedule_start.md"
},
{
"title": "schedule stop",
"path": "./cli/coder_schedule_stop.md"
},
{
"title": "server",
"path": "./cli/coder_server.md"
},
{
"title": "server postgres-builtin-serve",
"path": "./cli/coder_server_postgres-builtin-serve.md"
},
{
"title": "server postgres-builtin-url",
"path": "./cli/coder_server_postgres-builtin-url.md"
},
{
"title": "show",
"path": "./cli/coder_show.md"
},
{
"title": "speedtest",
"path": "./cli/coder_speedtest.md"
},
{
"title": "ssh",
"path": "./cli/coder_ssh.md"
},
{
"title": "start",
"path": "./cli/coder_start.md"
},
{
"title": "state",
"path": "./cli/coder_state.md"
},
{
"title": "state pull",
"path": "./cli/coder_state_pull.md"
},
{
"title": "state push",
"path": "./cli/coder_state_push.md"
},
{
"title": "stop",
"path": "./cli/coder_stop.md"
},
{
"title": "templates",
"path": "./cli/coder_templates.md"
},
{
"title": "templates create",
"path": "./cli/coder_templates_create.md"
},
{
"title": "templates delete",
"path": "./cli/coder_templates_delete.md"
},
{
"title": "templates edit",
"path": "./cli/coder_templates_edit.md"
},
{
"title": "templates init",
"path": "./cli/coder_templates_init.md"
},
{
"title": "templates list",
"path": "./cli/coder_templates_list.md"
},
{
"title": "templates plan",
"path": "./cli/coder_templates_plan.md"
},
{
"title": "templates pull",
"path": "./cli/coder_templates_pull.md"
},
{
"title": "templates push",
"path": "./cli/coder_templates_push.md"
},
{
"title": "templates versions",
"path": "./cli/coder_templates_versions.md"
},
{
"title": "templates versions list",
"path": "./cli/coder_templates_versions_list.md"
},
{
"title": "tokens",
"path": "./cli/coder_tokens.md"
},
{
"title": "tokens create",
"path": "./cli/coder_tokens_create.md"
},
{
"title": "tokens list",
"path": "./cli/coder_tokens_list.md"
},
{
"title": "tokens remove",
"path": "./cli/coder_tokens_remove.md"
},
{
"title": "update",
"path": "./cli/coder_update.md"
},
{
"title": "users",
"path": "./cli/coder_users.md"
},
{
"title": "users activate",
"path": "./cli/coder_users_activate.md"
},
{
"title": "users create",
"path": "./cli/coder_users_create.md"
},
{
"title": "users list",
"path": "./cli/coder_users_list.md"
},
{
"title": "users show",
"path": "./cli/coder_users_show.md"
},
{
"title": "users suspend",
"path": "./cli/coder_users_suspend.md"
},
{
"title": "version",
"path": "./cli/coder_version.md"
}
]
}
]
}

2
go.mod
View File

@ -171,6 +171,7 @@ require (
require (
cloud.google.com/go/longrunning v0.1.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect
github.com/hashicorp/go-hclog v1.2.1 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
@ -181,6 +182,7 @@ require (
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect
github.com/vmihailenco/tagparser v0.1.1 // indirect

2
go.sum
View File

@ -492,6 +492,7 @@ 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=
@ -1646,6 +1647,7 @@ 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=

134
scripts/clidocgen/main.go Normal file
View File

@ -0,0 +1,134 @@
package main
import (
"encoding/json"
"log"
"os"
"path"
"regexp"
"strings"
"github.com/spf13/cobra/doc"
"github.com/coder/coder/buildinfo"
"github.com/coder/coder/cli"
)
type route struct {
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
Path string `json:"path,omitempty"`
IconPath string `json:"icon_path,omitempty"`
State string `json:"state,omitempty"`
Children []route `json:"children,omitempty"`
}
type manifest struct {
Versions []string `json:"versions,omitempty"`
Routes []route `json:"routes,omitempty"`
}
func main() {
// Set default configs for the docs
err := os.Setenv("CODER_CONFIG_DIR", "~/.config/coderv2")
if err != nil {
log.Fatal("Unable to set default value for CODER_CONFIG_DIR: ", err)
}
err = os.Setenv("CODER_CACHE_DIRECTORY", "~/.cache/coder")
if err != nil {
log.Fatal("Unable to set default value for CODER_CACHE_DIRECTORY: ", err)
}
// Get the cmd CLI
cmd := cli.Root(cli.AGPL())
// Get paths
basePath := os.Getenv("BASE_PATH")
if basePath == "" {
log.Fatal("BASE_PATH should be defined")
}
markdownDocsDir := path.Join(basePath, "docs/cli")
manifestFilepath := path.Join(basePath, "docs/manifest.json")
// Generate markdown
err = doc.GenMarkdownTree(cmd, markdownDocsDir)
if err != nil {
log.Fatal("Error on generating CLI markdown docs: ", err)
}
// Create CLI routes
var cliRoutes []route
files, err := os.ReadDir(markdownDocsDir)
if err != nil {
log.Fatal("Error on loading docs/cli files: ", err)
}
for _, file := range files {
// Remove file extension and prefix
title := strings.Replace(file.Name(), ".md", "", 1)
title = strings.Replace(title, "coder_", "", 1)
title = strings.Replace(title, "_", " ", -1)
cliRoutes = append(cliRoutes, route{
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>")
err = os.WriteFile(filepath, []byte(content), 0644) // #nosec
if err != nil {
log.Fatal("Error on save file at ", filepath, ": ", err)
}
}
// Read manifest
jsonFile, err := os.ReadFile(manifestFilepath)
if err != nil {
log.Fatal("Error on open docs/manifest.json: ", err)
}
var manifest manifest
err = json.Unmarshal(jsonFile, &manifest)
if err != nil {
log.Fatal("Error on unmarshal manifest.json: ", err)
}
// Update manifest
for i, r := range manifest.Routes {
if r.Title != "Command Line" {
continue
}
manifest.Routes[i].Children = cliRoutes
break
}
manifestFile, err := json.MarshalIndent(manifest, "", " ")
if err != nil {
log.Fatal("Error on marshal manifest.json: ", err)
}
err = os.WriteFile(manifestFilepath, manifestFile, 0644) // #nosec
if err != nil {
log.Fatal("Error on write update on manifest.json: ", err)
}
}