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 1 commit
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
Prev Previous commit
Next Next commit
Fix variable values
  • Loading branch information
BrunoQuaresma committed Jan 27, 2023
commit c93bcb82a9f14eb6f1720328ba80dce4bf8080fc
2 changes: 1 addition & 1 deletion docs/cli/coder_server.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ coder server [flags]
--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 "/home/coder/.cache/coder")
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.
Expand Down
2 changes: 1 addition & 1 deletion docs/cli/coder_templates_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ coder templates create [name] [flags]

```
--default-ttl duration Specify a default TTL for workspaces created from this template. (default 24h0m0s)
-d, --directory string Specify the directory to create from, use '-' to read tar from stdin (default "/home/coder/coder")
-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.
Expand Down
2 changes: 1 addition & 1 deletion docs/cli/coder_templates_push.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ coder templates push [template] [flags]

```
--always-prompt Always prompt all parameters. Does not pull parameter values from active template version
-d, --directory string Specify the directory to create from, use '-' to read tar from stdin (default "/home/coder/coder")
-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.
Expand Down
11 changes: 11 additions & 0 deletions scripts/clidocgen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ func main() {
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())
Expand Down Expand Up @@ -86,6 +90,13 @@ func main() {
// 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)
Expand Down