Skip to content

Commit

Permalink
docs: generate cli reference
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasGentele committed Jun 21, 2022
1 parent 4ddb406 commit f4c1f66
Show file tree
Hide file tree
Showing 63 changed files with 487 additions and 947 deletions.
13 changes: 10 additions & 3 deletions docs/hack/cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (
"github.com/spf13/cobra/doc"
)

const cliDocsDir = "./docs/pages/commands"
const cliDocsDir = "./docs/pages/cli"
const headerTemplate = `---
title: "%s"
title: "%s --help"
sidebar_label: %s
---
Expand Down Expand Up @@ -46,11 +46,14 @@ func main() {
}
}

return fmt.Sprintf(headerTemplate, "Command - "+title, sidebarLabel)
return fmt.Sprintf(headerTemplate, title, sidebarLabel)
}

linkHandler := func(name string) string {
base := strings.TrimSuffix(name, path.Ext(name))
if base == "devspace" {
base = "README"
}
return strings.ToLower(base) + ".md"
}

Expand Down Expand Up @@ -87,6 +90,10 @@ func main() {
return err
}

if info.Name() == "devspace.md" {
os.Rename(path, filepath.Join(cliDocsDir, "..", "cli.md"))
}

return nil
})
if err != nil {
Expand Down
31 changes: 7 additions & 24 deletions docs/pages/commands/devspace.md → docs/pages/cli.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,27 @@
---
title: "Command - devspace"
title: "devspace --help"
sidebar_label: devspace
---

## devspace

Welcome to the DevSpace!

### Synopsis

```
DevSpace accelerates developing, deploying and debugging applications with Docker and Kubernetes. Get started by running the init command in one of your projects:
devspace init
```

### Options

### Global Flags
```
--config string The devspace config file to use
--debug Prints the stack trace if an error occurs
--disable-profile-activation If true will ignore all profile activations
-h, --help help for devspace
--inactivity-timeout int Minutes the current user is inactive (no mouse or keyboard interaction) until DevSpace will exit automatically. 0 to disable. Only supported on windows and mac operating systems (default 180)
--inactivity-timeout int Minutes the current user is inactive (no mouse or keyboard interaction) until DevSpace will exit automatically. 0 to disable. Only supported on windows and mac operating systems
--kube-context string The kubernetes context to use
-n, --namespace string The kubernetes namespace to use
--no-warn If true does not show any warning when deploying into a different namespace or kube-context than before
--override-name string If specified will override the devspace.yaml name
-p, --profile strings The DevSpace profiles to apply. Multiple profiles are applied in the order they are specified
--profile-parent strings One or more profiles that should be applied before the specified profile (e.g. devspace dev --profile-parent=base1 --profile-parent=base2 --profile=my-profile)
--profile-refresh If true will pull and re-download profile parent sources
--restore-vars If true will restore the variables from kubernetes before loading the config
--save-vars If true will save the variables to kubernetes after loading the config
--silent Run in silent mode and prevents any devspace log output except panics & fatals
-s, --switch-context DEPRECATED: Switches and uses the last kube context and namespace that was used to deploy the DevSpace project
-s, --switch-context Switches and uses the last kube context and namespace that was used to deploy the DevSpace project
--var strings Variables to override during execution (e.g. --var=MYVAR=MYVALUE)
--vars-secret string The secret to restore/save the variables from/to, if --restore-vars or --save-vars is enabled (default "devspace-vars")
```

```
```


## Flags
## Global & Inherited Flags
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: "Command - devspace add"
title: "devspace add --help"
sidebar_label: devspace add
---


Convenience command: adds something to devspace.yaml
Adds something to devspace.yaml

## Synopsis

Expand All @@ -27,21 +27,16 @@ Adds config sections to devspace.yaml
## Global & Inherited Flags

```
--config string The devspace config file to use
--debug Prints the stack trace if an error occurs
--disable-profile-activation If true will ignore all profile activations
--inactivity-timeout int Minutes the current user is inactive (no mouse or keyboard interaction) until DevSpace will exit automatically. 0 to disable. Only supported on windows and mac operating systems (default 180)
--inactivity-timeout int Minutes the current user is inactive (no mouse or keyboard interaction) until DevSpace will exit automatically. 0 to disable. Only supported on windows and mac operating systems
--kube-context string The kubernetes context to use
-n, --namespace string The kubernetes namespace to use
--no-warn If true does not show any warning when deploying into a different namespace or kube-context than before
--override-name string If specified will override the devspace.yaml name
-p, --profile strings The DevSpace profiles to apply. Multiple profiles are applied in the order they are specified
--profile-parent strings One or more profiles that should be applied before the specified profile (e.g. devspace dev --profile-parent=base1 --profile-parent=base2 --profile=my-profile)
--profile-refresh If true will pull and re-download profile parent sources
--restore-vars If true will restore the variables from kubernetes before loading the config
--save-vars If true will save the variables to kubernetes after loading the config
--silent Run in silent mode and prevents any devspace log output except panics & fatals
-s, --switch-context DEPRECATED: Switches and uses the last kube context and namespace that was used to deploy the DevSpace project
-s, --switch-context Switches and uses the last kube context and namespace that was used to deploy the DevSpace project
--var strings Variables to override during execution (e.g. --var=MYVAR=MYVALUE)
--vars-secret string The secret to restore/save the variables from/to, if --restore-vars or --save-vars is enabled (default "devspace-vars")
```

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: "Command - devspace add plugin"
title: "devspace add plugin --help"
sidebar_label: devspace add plugin
---


Add a plugin to devspace
Adds a plugin to devspace

## Synopsis

Expand Down Expand Up @@ -35,21 +35,16 @@ devspace add plugin https://github.com/my-plugin/plugin
## Global & Inherited Flags

```
--config string The devspace config file to use
--debug Prints the stack trace if an error occurs
--disable-profile-activation If true will ignore all profile activations
--inactivity-timeout int Minutes the current user is inactive (no mouse or keyboard interaction) until DevSpace will exit automatically. 0 to disable. Only supported on windows and mac operating systems (default 180)
--inactivity-timeout int Minutes the current user is inactive (no mouse or keyboard interaction) until DevSpace will exit automatically. 0 to disable. Only supported on windows and mac operating systems
--kube-context string The kubernetes context to use
-n, --namespace string The kubernetes namespace to use
--no-warn If true does not show any warning when deploying into a different namespace or kube-context than before
--override-name string If specified will override the devspace.yaml name
-p, --profile strings The DevSpace profiles to apply. Multiple profiles are applied in the order they are specified
--profile-parent strings One or more profiles that should be applied before the specified profile (e.g. devspace dev --profile-parent=base1 --profile-parent=base2 --profile=my-profile)
--profile-refresh If true will pull and re-download profile parent sources
--restore-vars If true will restore the variables from kubernetes before loading the config
--save-vars If true will save the variables to kubernetes after loading the config
--silent Run in silent mode and prevents any devspace log output except panics & fatals
-s, --switch-context DEPRECATED: Switches and uses the last kube context and namespace that was used to deploy the DevSpace project
-s, --switch-context Switches and uses the last kube context and namespace that was used to deploy the DevSpace project
--var strings Variables to override during execution (e.g. --var=MYVAR=MYVALUE)
--vars-secret string The secret to restore/save the variables from/to, if --restore-vars or --save-vars is enabled (default "devspace-vars")
```

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Command - devspace analyze"
title: "devspace analyze --help"
sidebar_label: devspace analyze
---

Expand Down Expand Up @@ -41,21 +41,16 @@ devspace analyze --namespace=mynamespace
## Global & Inherited Flags

```
--config string The devspace config file to use
--debug Prints the stack trace if an error occurs
--disable-profile-activation If true will ignore all profile activations
--inactivity-timeout int Minutes the current user is inactive (no mouse or keyboard interaction) until DevSpace will exit automatically. 0 to disable. Only supported on windows and mac operating systems (default 180)
--inactivity-timeout int Minutes the current user is inactive (no mouse or keyboard interaction) until DevSpace will exit automatically. 0 to disable. Only supported on windows and mac operating systems
--kube-context string The kubernetes context to use
-n, --namespace string The kubernetes namespace to use
--no-warn If true does not show any warning when deploying into a different namespace or kube-context than before
--override-name string If specified will override the devspace.yaml name
-p, --profile strings The DevSpace profiles to apply. Multiple profiles are applied in the order they are specified
--profile-parent strings One or more profiles that should be applied before the specified profile (e.g. devspace dev --profile-parent=base1 --profile-parent=base2 --profile=my-profile)
--profile-refresh If true will pull and re-download profile parent sources
--restore-vars If true will restore the variables from kubernetes before loading the config
--save-vars If true will save the variables to kubernetes after loading the config
--silent Run in silent mode and prevents any devspace log output except panics & fatals
-s, --switch-context DEPRECATED: Switches and uses the last kube context and namespace that was used to deploy the DevSpace project
-s, --switch-context Switches and uses the last kube context and namespace that was used to deploy the DevSpace project
--var strings Variables to override during execution (e.g. --var=MYVAR=MYVALUE)
--vars-secret string The secret to restore/save the variables from/to, if --restore-vars or --save-vars is enabled (default "devspace-vars")
```

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Command - devspace attach"
title: "devspace attach --help"
sidebar_label: devspace attach
---

Expand Down Expand Up @@ -32,7 +32,6 @@ devspace attach -n my-namespace
```
-c, --container string Container name within pod where to execute command
-h, --help help for attach
--image string Image is the config name of an image to select in the devspace config (e.g. 'default'), it is NOT a docker image like myuser/myimage
--image-selector string The image to search a pod for (e.g. nginx, nginx:latest, ${runtime.images.app}, nginx:${runtime.images.app.tag})
-l, --label-selector string Comma separated key=value selector list (e.g. release=test)
--pick Select a pod (default true)
Expand All @@ -43,21 +42,16 @@ devspace attach -n my-namespace
## Global & Inherited Flags

```
--config string The devspace config file to use
--debug Prints the stack trace if an error occurs
--disable-profile-activation If true will ignore all profile activations
--inactivity-timeout int Minutes the current user is inactive (no mouse or keyboard interaction) until DevSpace will exit automatically. 0 to disable. Only supported on windows and mac operating systems (default 180)
--inactivity-timeout int Minutes the current user is inactive (no mouse or keyboard interaction) until DevSpace will exit automatically. 0 to disable. Only supported on windows and mac operating systems
--kube-context string The kubernetes context to use
-n, --namespace string The kubernetes namespace to use
--no-warn If true does not show any warning when deploying into a different namespace or kube-context than before
--override-name string If specified will override the devspace.yaml name
-p, --profile strings The DevSpace profiles to apply. Multiple profiles are applied in the order they are specified
--profile-parent strings One or more profiles that should be applied before the specified profile (e.g. devspace dev --profile-parent=base1 --profile-parent=base2 --profile=my-profile)
--profile-refresh If true will pull and re-download profile parent sources
--restore-vars If true will restore the variables from kubernetes before loading the config
--save-vars If true will save the variables to kubernetes after loading the config
--silent Run in silent mode and prevents any devspace log output except panics & fatals
-s, --switch-context DEPRECATED: Switches and uses the last kube context and namespace that was used to deploy the DevSpace project
-s, --switch-context Switches and uses the last kube context and namespace that was used to deploy the DevSpace project
--var strings Variables to override during execution (e.g. --var=MYVAR=MYVALUE)
--vars-secret string The secret to restore/save the variables from/to, if --restore-vars or --save-vars is enabled (default "devspace-vars")
```

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Command - devspace build"
title: "devspace build --help"
sidebar_label: devspace build
---

Expand All @@ -26,37 +26,37 @@ Builds all defined images and pushes them

```
--build-sequential Builds the images one after another instead of in parallel
--dependency strings Builds only the specific named dependencies
-b, --force-build Forces to build every image
--force-dependencies Forces to re-evaluate dependencies (use with --force-build --force-deploy to actually force building & deployment of dependencies) (default true)
--dependency strings Deploys only the specified named dependencies
-b, --force-build Forces to build every image (default true)
-d, --force-deploy Forces to deploy every deployment
--force-purge Forces to purge every deployment even though it might be in use by another DevSpace project
-h, --help help for build
--max-concurrent-builds int The maximum number of image builds built in parallel (0 for infinite)
--skip-dependency strings Skips building the following dependencies
--pipeline string The pipeline to execute (default "build")
--render If true will render manifests and print them instead of actually deploying them
--show-ui Shows the ui server
--skip-build Skips building of images
--skip-dependency strings Skips the following dependencies for deployment
--skip-deploy If enabled will skip deploying
--skip-push Skips image pushing, useful for minikube deployment
--skip-push-local-kube Skips image pushing, if a local kubernetes environment is detected
-t, --tag strings Use the given tag for all built images
--verbose-dependencies Builds the dependencies verbosely (default true)
```


## Global & Inherited Flags

```
--config string The devspace config file to use
--debug Prints the stack trace if an error occurs
--disable-profile-activation If true will ignore all profile activations
--inactivity-timeout int Minutes the current user is inactive (no mouse or keyboard interaction) until DevSpace will exit automatically. 0 to disable. Only supported on windows and mac operating systems (default 180)
--inactivity-timeout int Minutes the current user is inactive (no mouse or keyboard interaction) until DevSpace will exit automatically. 0 to disable. Only supported on windows and mac operating systems
--kube-context string The kubernetes context to use
-n, --namespace string The kubernetes namespace to use
--no-warn If true does not show any warning when deploying into a different namespace or kube-context than before
--override-name string If specified will override the devspace.yaml name
-p, --profile strings The DevSpace profiles to apply. Multiple profiles are applied in the order they are specified
--profile-parent strings One or more profiles that should be applied before the specified profile (e.g. devspace dev --profile-parent=base1 --profile-parent=base2 --profile=my-profile)
--profile-refresh If true will pull and re-download profile parent sources
--restore-vars If true will restore the variables from kubernetes before loading the config
--save-vars If true will save the variables to kubernetes after loading the config
--silent Run in silent mode and prevents any devspace log output except panics & fatals
-s, --switch-context DEPRECATED: Switches and uses the last kube context and namespace that was used to deploy the DevSpace project
-s, --switch-context Switches and uses the last kube context and namespace that was used to deploy the DevSpace project
--var strings Variables to override during execution (e.g. --var=MYVAR=MYVALUE)
--vars-secret string The secret to restore/save the variables from/to, if --restore-vars or --save-vars is enabled (default "devspace-vars")
```

Loading

0 comments on commit f4c1f66

Please sign in to comment.