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

Skip to content

docs: Add CLI docs #5879

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Jan 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand Down Expand Up @@ -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
Expand Down
72 changes: 72 additions & 0 deletions docs/cli/coder.md
Original file line number Diff line number Diff line change
@@ -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
58 changes: 58 additions & 0 deletions docs/cli/coder_config-ssh.md
Original file line number Diff line number Diff line change
@@ -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 changes: 49 additions & 0 deletions docs/cli/coder_create.md
Original file line number Diff line number Diff line change
@@ -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 changes: 41 additions & 0 deletions docs/cli/coder_delete.md
Original file line number Diff line number Diff line change
@@ -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
49 changes: 49 additions & 0 deletions docs/cli/coder_dotfiles.md
Original file line number Diff line number Diff line change
@@ -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 [email protected]: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 changes: 41 additions & 0 deletions docs/cli/coder_list.md
Original file line number Diff line number Diff line change
@@ -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 changes: 46 additions & 0 deletions docs/cli/coder_login.md
Original file line number Diff line number Diff line change
@@ -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
Loading