Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e0d48e7

Browse files
docs: Add CLI docs (#5879)
1 parent a753703 commit e0d48e7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+3005
-0
lines changed

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ gen: \
418418
provisionerd/proto/provisionerd.pb.go \
419419
site/src/api/typesGenerated.ts \
420420
docs/admin/prometheus.md \
421+
docs/cli/coder.md \
421422
docs/admin/audit-logs.md \
422423
coderd/apidoc/swagger.json \
423424
.prettierignore.include \
@@ -437,6 +438,7 @@ gen/mark-fresh:
437438
provisionerd/proto/provisionerd.pb.go \
438439
site/src/api/typesGenerated.ts \
439440
docs/admin/prometheus.md \
441+
docs/cli/coder.md \
440442
docs/admin/audit-logs.md \
441443
coderd/apidoc/swagger.json \
442444
.prettierignore.include \
@@ -492,6 +494,11 @@ docs/admin/prometheus.md: scripts/metricsdocgen/main.go scripts/metricsdocgen/me
492494
cd site
493495
yarn run format:write:only ../docs/admin/prometheus.md
494496

497+
docs/cli/coder.md: scripts/clidocgen/main.go $(shell find ./cli/ -type f)
498+
BASE_PATH="." go run scripts/clidocgen/main.go
499+
cd site
500+
yarn run format:write:only ../docs/cli/**.md
501+
495502
docs/admin/audit-logs.md: scripts/auditdocgen/main.go enterprise/audit/table.go
496503
go run scripts/auditdocgen/main.go
497504
cd site

docs/cli/coder.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
## coder
2+
3+
### Synopsis
4+
5+
Coder — A tool for provisioning self-hosted development environments with Terraform.
6+
7+
```
8+
coder [flags]
9+
```
10+
11+
### Examples
12+
13+
```
14+
- Start a Coder server:
15+
16+
$ coder server
17+
18+
- Get started by creating a template from an example:
19+
20+
$ coder templates init
21+
```
22+
23+
### Options
24+
25+
```
26+
--global-config coder Path to the global coder config directory.
27+
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
28+
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
29+
Consumes $CODER_HEADER
30+
-h, --help help for coder
31+
--no-feature-warning Suppress warnings about unlicensed features.
32+
Consumes $CODER_NO_FEATURE_WARNING
33+
--no-version-warning Suppress warning when client and server versions do not match.
34+
Consumes $CODER_NO_VERSION_WARNING
35+
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
36+
Consumes $CODER_SESSION_TOKEN
37+
--url string URL to a deployment.
38+
Consumes $CODER_URL
39+
-v, --verbose Enable verbose output.
40+
Consumes $CODER_VERBOSE
41+
```
42+
43+
### SEE ALSO
44+
45+
- [coder config-ssh](coder_config-ssh.md) - Add an SSH Host entry for your workspaces "ssh coder.workspace"
46+
- [coder create](coder_create.md) - Create a workspace
47+
- [coder delete](coder_delete.md) - Delete a workspace
48+
- [coder dotfiles](coder_dotfiles.md) - Checkout and install a dotfiles repository from a Git URL
49+
- [coder list](coder_list.md) - List workspaces
50+
- [coder login](coder_login.md) - Authenticate with Coder deployment
51+
- [coder logout](coder_logout.md) - Unauthenticate your local session
52+
- [coder port-forward](coder_port-forward.md) - Forward ports from machine to a workspace
53+
- [coder publickey](coder_publickey.md) - Output your Coder public key used for Git operations
54+
- [coder rename](coder_rename.md) - Rename a workspace
55+
- [coder reset-password](coder_reset-password.md) - Directly connect to the database to reset a user's password
56+
- [coder restart](coder_restart.md) - Restart a workspace
57+
- [coder scaletest](coder_scaletest.md) - Run a scale test against the Coder API
58+
- [coder schedule](coder_schedule.md) - Schedule automated start and stop times for workspaces
59+
- [coder server](coder_server.md) - Start a Coder server
60+
- [coder show](coder_show.md) - Display details of a workspace's resources and agents
61+
- [coder speedtest](coder_speedtest.md) - Run upload and download tests from your machine to a workspace
62+
- [coder ssh](coder_ssh.md) - Start a shell into a workspace
63+
- [coder start](coder_start.md) - Start a workspace
64+
- [coder state](coder_state.md) - Manually manage Terraform state to fix broken workspaces
65+
- [coder stop](coder_stop.md) - Stop a workspace
66+
- [coder templates](coder_templates.md) - Manage templates
67+
- [coder tokens](coder_tokens.md) - Manage personal access tokens
68+
- [coder update](coder_update.md) - Update a workspace
69+
- [coder users](coder_users.md) - Manage users
70+
- [coder version](coder_version.md) - Show coder version
71+
72+
###### Auto generated by spf13/cobra on 27-Jan-2023

docs/cli/coder_config-ssh.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
## coder config-ssh
2+
3+
Add an SSH Host entry for your workspaces "ssh coder.workspace"
4+
5+
```
6+
coder config-ssh [flags]
7+
```
8+
9+
### Examples
10+
11+
```
12+
- You can use -o (or --ssh-option) so set SSH options to be used for all your
13+
workspaces:
14+
15+
$ coder config-ssh -o ForwardAgent=yes
16+
17+
- You can use --dry-run (or -n) to see the changes that would be made:
18+
19+
$ coder config-ssh --dry-run
20+
```
21+
22+
### Options
23+
24+
```
25+
-n, --dry-run Perform a trial run with no changes made, showing a diff at the end.
26+
-h, --help help for config-ssh
27+
--ssh-config-file string Specifies the path to an SSH config.
28+
Consumes $CODER_SSH_CONFIG_FILE (default "~/.ssh/config")
29+
-o, --ssh-option stringArray Specifies additional SSH options to embed in each host stanza.
30+
--use-previous-options Specifies whether or not to keep options from previous run of config-ssh.
31+
Consumes $CODER_SSH_USE_PREVIOUS_OPTIONS
32+
-y, --yes Bypass prompts
33+
```
34+
35+
### Options inherited from parent commands
36+
37+
```
38+
--global-config coder Path to the global coder config directory.
39+
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
40+
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
41+
Consumes $CODER_HEADER
42+
--no-feature-warning Suppress warnings about unlicensed features.
43+
Consumes $CODER_NO_FEATURE_WARNING
44+
--no-version-warning Suppress warning when client and server versions do not match.
45+
Consumes $CODER_NO_VERSION_WARNING
46+
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
47+
Consumes $CODER_SESSION_TOKEN
48+
--url string URL to a deployment.
49+
Consumes $CODER_URL
50+
-v, --verbose Enable verbose output.
51+
Consumes $CODER_VERBOSE
52+
```
53+
54+
### SEE ALSO
55+
56+
- [coder](coder.md) -
57+
58+
###### Auto generated by spf13/cobra on 27-Jan-2023

docs/cli/coder_create.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
## coder create
2+
3+
Create a workspace
4+
5+
```
6+
coder create [name] [flags]
7+
```
8+
9+
### Options
10+
11+
```
12+
-h, --help help for create
13+
--parameter-file string Specify a file path with parameter values.
14+
Consumes $CODER_PARAMETER_FILE
15+
--rich-parameter-file string Specify a file path with values for rich parameters defined in the template.
16+
Consumes $CODER_RICH_PARAMETER_FILE
17+
--start-at coder schedule start --help Specify the workspace autostart schedule. Check coder schedule start --help for the syntax.
18+
Consumes $CODER_WORKSPACE_START_AT
19+
--stop-after duration Specify a duration after which the workspace should shut down (e.g. 8h).
20+
Consumes $CODER_WORKSPACE_STOP_AFTER (default 8h0m0s)
21+
-t, --template string Specify a template name.
22+
Consumes $CODER_TEMPLATE_NAME
23+
-y, --yes Bypass prompts
24+
```
25+
26+
### Options inherited from parent commands
27+
28+
```
29+
--global-config coder Path to the global coder config directory.
30+
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
31+
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
32+
Consumes $CODER_HEADER
33+
--no-feature-warning Suppress warnings about unlicensed features.
34+
Consumes $CODER_NO_FEATURE_WARNING
35+
--no-version-warning Suppress warning when client and server versions do not match.
36+
Consumes $CODER_NO_VERSION_WARNING
37+
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
38+
Consumes $CODER_SESSION_TOKEN
39+
--url string URL to a deployment.
40+
Consumes $CODER_URL
41+
-v, --verbose Enable verbose output.
42+
Consumes $CODER_VERBOSE
43+
```
44+
45+
### SEE ALSO
46+
47+
- [coder](coder.md) -
48+
49+
###### Auto generated by spf13/cobra on 27-Jan-2023

docs/cli/coder_delete.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
## coder delete
2+
3+
Delete a workspace
4+
5+
```
6+
coder delete <workspace> [flags]
7+
```
8+
9+
### Options
10+
11+
```
12+
-h, --help help for delete
13+
--orphan Delete a workspace without deleting its resources. This can delete a
14+
workspace in a broken state, but may also lead to unaccounted cloud resources.
15+
-y, --yes Bypass prompts
16+
```
17+
18+
### Options inherited from parent commands
19+
20+
```
21+
--global-config coder Path to the global coder config directory.
22+
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
23+
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
24+
Consumes $CODER_HEADER
25+
--no-feature-warning Suppress warnings about unlicensed features.
26+
Consumes $CODER_NO_FEATURE_WARNING
27+
--no-version-warning Suppress warning when client and server versions do not match.
28+
Consumes $CODER_NO_VERSION_WARNING
29+
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
30+
Consumes $CODER_SESSION_TOKEN
31+
--url string URL to a deployment.
32+
Consumes $CODER_URL
33+
-v, --verbose Enable verbose output.
34+
Consumes $CODER_VERBOSE
35+
```
36+
37+
### SEE ALSO
38+
39+
- [coder](coder.md) -
40+
41+
###### Auto generated by spf13/cobra on 27-Jan-2023

docs/cli/coder_dotfiles.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
## coder dotfiles
2+
3+
Checkout and install a dotfiles repository from a Git URL
4+
5+
```
6+
coder dotfiles [git_repo_url] [flags]
7+
```
8+
9+
### Examples
10+
11+
```
12+
- Check out and install a dotfiles repository without prompts:
13+
14+
$ coder dotfiles --yes [email protected]:example/dotfiles.git
15+
```
16+
17+
### Options
18+
19+
```
20+
-h, --help help for dotfiles
21+
--symlink-dir string Specifies the directory for the dotfiles symlink destinations. If empty will use $HOME.
22+
Consumes $CODER_SYMLINK_DIR
23+
-y, --yes Bypass prompts
24+
```
25+
26+
### Options inherited from parent commands
27+
28+
```
29+
--global-config coder Path to the global coder config directory.
30+
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
31+
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
32+
Consumes $CODER_HEADER
33+
--no-feature-warning Suppress warnings about unlicensed features.
34+
Consumes $CODER_NO_FEATURE_WARNING
35+
--no-version-warning Suppress warning when client and server versions do not match.
36+
Consumes $CODER_NO_VERSION_WARNING
37+
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
38+
Consumes $CODER_SESSION_TOKEN
39+
--url string URL to a deployment.
40+
Consumes $CODER_URL
41+
-v, --verbose Enable verbose output.
42+
Consumes $CODER_VERBOSE
43+
```
44+
45+
### SEE ALSO
46+
47+
- [coder](coder.md) -
48+
49+
###### Auto generated by spf13/cobra on 27-Jan-2023

docs/cli/coder_list.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
## coder list
2+
3+
List workspaces
4+
5+
```
6+
coder list [flags]
7+
```
8+
9+
### Options
10+
11+
```
12+
-a, --all Specifies whether all workspaces will be listed or not.
13+
-c, --column stringArray Specify a column to filter in the table. Available columns are: workspace, template, status, last_built, outdated, starts_at, stops_after
14+
-h, --help help for list
15+
--search string Search for a workspace with a query. (default "owner:me")
16+
```
17+
18+
### Options inherited from parent commands
19+
20+
```
21+
--global-config coder Path to the global coder config directory.
22+
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
23+
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
24+
Consumes $CODER_HEADER
25+
--no-feature-warning Suppress warnings about unlicensed features.
26+
Consumes $CODER_NO_FEATURE_WARNING
27+
--no-version-warning Suppress warning when client and server versions do not match.
28+
Consumes $CODER_NO_VERSION_WARNING
29+
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
30+
Consumes $CODER_SESSION_TOKEN
31+
--url string URL to a deployment.
32+
Consumes $CODER_URL
33+
-v, --verbose Enable verbose output.
34+
Consumes $CODER_VERBOSE
35+
```
36+
37+
### SEE ALSO
38+
39+
- [coder](coder.md) -
40+
41+
###### Auto generated by spf13/cobra on 27-Jan-2023

docs/cli/coder_login.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
## coder login
2+
3+
Authenticate with Coder deployment
4+
5+
```
6+
coder login <url> [flags]
7+
```
8+
9+
### Options
10+
11+
```
12+
--first-user-email string Specifies an email address to use if creating the first user for the deployment.
13+
Consumes $CODER_FIRST_USER_EMAIL
14+
--first-user-password string Specifies a password to use if creating the first user for the deployment.
15+
Consumes $CODER_FIRST_USER_PASSWORD
16+
--first-user-trial Specifies whether a trial license should be provisioned for the Coder deployment or not.
17+
Consumes $CODER_FIRST_USER_TRIAL
18+
--first-user-username string Specifies a username to use if creating the first user for the deployment.
19+
Consumes $CODER_FIRST_USER_USERNAME
20+
-h, --help help for login
21+
```
22+
23+
### Options inherited from parent commands
24+
25+
```
26+
--global-config coder Path to the global coder config directory.
27+
Consumes $CODER_CONFIG_DIR (default "~/.config/coderv2")
28+
--header stringArray HTTP headers added to all requests. Provide as "Key=Value".
29+
Consumes $CODER_HEADER
30+
--no-feature-warning Suppress warnings about unlicensed features.
31+
Consumes $CODER_NO_FEATURE_WARNING
32+
--no-version-warning Suppress warning when client and server versions do not match.
33+
Consumes $CODER_NO_VERSION_WARNING
34+
--token string Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.
35+
Consumes $CODER_SESSION_TOKEN
36+
--url string URL to a deployment.
37+
Consumes $CODER_URL
38+
-v, --verbose Enable verbose output.
39+
Consumes $CODER_VERBOSE
40+
```
41+
42+
### SEE ALSO
43+
44+
- [coder](coder.md) -
45+
46+
###### Auto generated by spf13/cobra on 27-Jan-2023

0 commit comments

Comments
 (0)