diff --git a/docs/coder_envs.md b/docs/coder_envs.md index 82897598..86b01596 100644 --- a/docs/coder_envs.md +++ b/docs/coder_envs.md @@ -22,6 +22,7 @@ Perform operations on the Coder environments owned by the active user. * [coder](coder.md) - coder provides a CLI for working with an existing Coder Enterprise installation * [coder envs create](coder_envs_create.md) - create a new environment. +* [coder envs create-from-config](coder_envs_create-from-config.md) - create a new environment from a template * [coder envs edit](coder_envs_edit.md) - edit an existing environment and initiate a rebuild. * [coder envs ls](coder_envs_ls.md) - list all environments owned by the active user * [coder envs rebuild](coder_envs_rebuild.md) - rebuild a Coder environment diff --git a/docs/coder_envs_create-from-config.md b/docs/coder_envs_create-from-config.md new file mode 100644 index 00000000..e90e7bfe --- /dev/null +++ b/docs/coder_envs_create-from-config.md @@ -0,0 +1,43 @@ +## coder envs create-from-config + +create a new environment from a template + +### Synopsis + +Create a new Coder environment using a Workspaces As Code template. + +``` +coder envs create-from-config [flags] +``` + +### Examples + +``` +# create a new environment from git repository +coder envs create-from-config --name="dev-env" --repo-url https://github.com/cdr/m --ref my-branch +coder envs create-from-config --name="dev-env" -f coder.yaml +``` + +### Options + +``` + -f, --filepath string path to local template file. + --follow follow buildlog after initiating rebuild + -h, --help help for create-from-config + --name string name of the environment to be created + -o, --org string name of the organization the environment should be created under. + --provider string name of Workspace Provider with which to create the environment + --ref string git reference to pull template from. May be a branch, tag, or commit hash. (default "master") + -r, --repo-url string URL of the git repository to pull the config from. Config file must live in '.coder/coder.yaml'. +``` + +### Options inherited from parent commands + +``` + -v, --verbose show verbose output +``` + +### SEE ALSO + +* [coder envs](coder_envs.md) - Interact with Coder environments + diff --git a/internal/cmd/envs.go b/internal/cmd/envs.go index 2ed190c0..4a0c0101 100644 --- a/internal/cmd/envs.go +++ b/internal/cmd/envs.go @@ -36,7 +36,7 @@ func envsCmd() *cobra.Command { watchBuildLogCommand(), rebuildEnvCommand(), createEnvCmd(), - createEnvFromRepoCmd(), + createEnvFromConfigCmd(), editEnvCmd(), ) return cmd @@ -291,7 +291,7 @@ coder envs create my-new-powerful-env --cpu 12 --disk 100 --memory 16 --image ub return cmd } -func createEnvFromRepoCmd() *cobra.Command { +func createEnvFromConfigCmd() *cobra.Command { var ( ref string repo string @@ -303,12 +303,11 @@ func createEnvFromRepoCmd() *cobra.Command { ) cmd := &cobra.Command{ - Use: "create-from-config", - Short: "create a new environment from a config file.", - Long: "Create a new Coder environment from a config file.", - Hidden: true, - Example: `# create a new environment from git repository template -coder envs create-from-config --name="dev-env" --repo-url github.com/cdr/m --ref my-branch + Use: "create-from-config", + Short: "create a new environment from a template", + Long: "Create a new Coder environment using a Workspaces As Code template.", + Example: `# create a new environment from git repository +coder envs create-from-config --name="dev-env" --repo-url https://github.com/cdr/m --ref my-branch coder envs create-from-config --name="dev-env" -f coder.yaml`, RunE: func(cmd *cobra.Command, args []string) error { ctx := cmd.Context()