From dd8afaa8576b24477390393d7dc58ff4371834cc Mon Sep 17 00:00:00 2001 From: Alexander Jung Date: Fri, 26 Jul 2024 11:44:49 +0200 Subject: [PATCH] fix(cloud): Update platform documentation naming Simultaneously this commit attempts to homogenize the various subcommand texts and descriptions. Signed-off-by: Alexander Jung --- .../cli/kraft/cloud/certificate/certificate.go | 7 +++---- .../cli/kraft/cloud/certificate/get/get.go | 4 ++-- .../kraft/cloud/certificate/remove/remove.go | 11 ++++------- .../cli/kraft/cloud/compose/build/build.go | 6 +++--- internal/cli/kraft/cloud/compose/compose.go | 18 +++++++++--------- .../cli/kraft/cloud/compose/create/create.go | 7 ++----- internal/cli/kraft/cloud/compose/down/down.go | 9 +++------ internal/cli/kraft/cloud/compose/list/list.go | 9 +++------ internal/cli/kraft/cloud/compose/logs/logs.go | 16 +++++++--------- internal/cli/kraft/cloud/compose/ps/ps.go | 7 ++----- internal/cli/kraft/cloud/compose/push/push.go | 7 ++----- .../cli/kraft/cloud/compose/start/start.go | 11 ++++------- internal/cli/kraft/cloud/compose/stop/stop.go | 11 ++++------- internal/cli/kraft/cloud/compose/up/up.go | 11 ++++++----- internal/cli/kraft/cloud/deploy/deploy.go | 16 ++++++++++++++-- internal/cli/kraft/cloud/img/img.go | 9 +++------ internal/cli/kraft/cloud/img/list/list.go | 3 --- .../cli/kraft/cloud/instance/create/create.go | 2 +- internal/cli/kraft/cloud/instance/get/get.go | 6 +++--- internal/cli/kraft/cloud/instance/instance.go | 4 ++-- internal/cli/kraft/cloud/instance/logs/logs.go | 12 ++++++------ .../cli/kraft/cloud/instance/remove/remove.go | 12 ++++++------ .../cli/kraft/cloud/instance/start/start.go | 8 ++++---- internal/cli/kraft/cloud/instance/stop/stop.go | 15 ++++++--------- internal/cli/kraft/cloud/metros/metros.go | 5 +---- internal/cli/kraft/cloud/quotas/quotas.go | 9 +++------ .../kraft/cloud/scale/initialize/initialize.go | 3 +-- .../cli/kraft/cloud/scale/remove/remove.go | 1 - internal/cli/kraft/cloud/scale/reset/reset.go | 1 - internal/cli/kraft/cloud/scale/scale.go | 3 +-- .../cli/kraft/cloud/service/create/create.go | 6 +++--- internal/cli/kraft/cloud/service/get/get.go | 2 +- internal/cli/kraft/cloud/service/list/list.go | 5 +---- .../cli/kraft/cloud/service/remove/remove.go | 3 +-- internal/cli/kraft/cloud/tunnel/tunnel.go | 2 +- .../cli/kraft/cloud/volume/attach/attach.go | 1 - .../cli/kraft/cloud/volume/detach/detach.go | 3 +-- internal/cli/kraft/cloud/volume/get/get.go | 5 +---- .../cli/kraft/cloud/volume/import/import.go | 2 +- internal/cli/kraft/cloud/volume/list/list.go | 2 +- 40 files changed, 116 insertions(+), 158 deletions(-) diff --git a/internal/cli/kraft/cloud/certificate/certificate.go b/internal/cli/kraft/cloud/certificate/certificate.go index 2dc3ff88a..0af8ada54 100644 --- a/internal/cli/kraft/cloud/certificate/certificate.go +++ b/internal/cli/kraft/cloud/certificate/certificate.go @@ -23,10 +23,9 @@ type CertificateOptions struct{} func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&CertificateOptions{}, cobra.Command{ - Short: "Manage KraftCloud TLS certificates", - Use: "certificate SUBCOMMAND", - Aliases: []string{"certificates", "cert", "certs", "crt", "crts"}, - Long: "Manage KraftCloud TLS certificates.", + Short: "Manage TLS certificates", + Use: "cert SUBCOMMAND", + Aliases: []string{"certificate", "certificates", "certs", "crt", "crts"}, Annotations: map[string]string{ cmdfactory.AnnotationHelpGroup: "kraftcloud-certificate", cmdfactory.AnnotationHelpHidden: "true", diff --git a/internal/cli/kraft/cloud/certificate/get/get.go b/internal/cli/kraft/cloud/certificate/get/get.go index cbd8f6e11..ea102750d 100644 --- a/internal/cli/kraft/cloud/certificate/get/get.go +++ b/internal/cli/kraft/cloud/certificate/get/get.go @@ -42,10 +42,10 @@ func NewCmd() *cobra.Command { Args: cobra.ExactArgs(1), Aliases: []string{"status", "info"}, Example: heredoc.Doc(` - # Retrieve information about a kraftcloud certificate by UUID + # Retrieve information about a certificate by UUID $ kraft cloud certificate get fd1684ea-7970-4994-92d6-61dcc7905f2b - # Retrieve information about a kraftcloud certificate by name + # Retrieve information about a certificate by name $ kraft cloud certificate get my-certificate-431342 `), Long: heredoc.Doc(` diff --git a/internal/cli/kraft/cloud/certificate/remove/remove.go b/internal/cli/kraft/cloud/certificate/remove/remove.go index 11cda27cf..b37a40ab4 100644 --- a/internal/cli/kraft/cloud/certificate/remove/remove.go +++ b/internal/cli/kraft/cloud/certificate/remove/remove.go @@ -44,21 +44,18 @@ func NewCmd() *cobra.Command { Aliases: []string{"del", "delete", "rm"}, Args: cobra.ArbitraryArgs, Example: heredoc.Doc(` - # Remove a KraftCloud certificate by UUID + # Remove a certificate by UUID $ kraft cloud certificate remove fd1684ea-7970-4994-92d6-61dcc7905f2b - # Remove a KraftCloud certificate by name + # Remove a certificate by name $ kraft cloud certificate remove my-certificate-431342 - # Remove multiple KraftCloud certificates + # Remove multiple certificates $ kraft cloud certificate remove my-certificate-431342 my-certificate-other-2313 - # Remove all KraftCloud certificates + # Remove all certificates $ kraft cloud certificate remove --all `), - Long: heredoc.Doc(` - Remove a KraftCloud certificate. - `), Annotations: map[string]string{ cmdfactory.AnnotationHelpGroup: "kraftcloud-certificate", }, diff --git a/internal/cli/kraft/cloud/compose/build/build.go b/internal/cli/kraft/cloud/compose/build/build.go index fee29deca..e31104373 100644 --- a/internal/cli/kraft/cloud/compose/build/build.go +++ b/internal/cli/kraft/cloud/compose/build/build.go @@ -44,15 +44,15 @@ type BuildOptions struct { func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&BuildOptions{}, cobra.Command{ - Short: "Build a compose project for KraftCloud", + Short: "Build a compose project", Use: "build [FLAGS] [COMPONENT]", Args: cobra.ArbitraryArgs, Aliases: []string{"b"}, Long: heredoc.Doc(` - Build a compose project for KraftCloud + Build a compose project `), Example: heredoc.Doc(` - # Build a compose project for KraftCloud + # Build a compose project $ kraft cloud compose build # (If applicable) Set or override a runtime for a particular service diff --git a/internal/cli/kraft/cloud/compose/compose.go b/internal/cli/kraft/cloud/compose/compose.go index 10b9e217f..43222dad8 100644 --- a/internal/cli/kraft/cloud/compose/compose.go +++ b/internal/cli/kraft/cloud/compose/compose.go @@ -32,32 +32,32 @@ type ComposeOptions struct { func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&ComposeOptions{}, cobra.Command{ - Short: "Manage deployments on KraftCloud", + Short: "Manage Compose deployments on Unikraft Cloud", Use: "compose", Aliases: []string{"comp"}, Long: heredoc.Doc(` - Mange deployments KraftCloud. + Manage Compose deployments on Unikraft Cloud `), Example: heredoc.Doc(` - # Start the current KraftCloud deployment. + # Deploy the Compose project on Unikraft Cloud $ kraft cloud compose up - # Stop the current KraftCloud deployment. + # Stop the deployment $ kraft cloud compose down - # List the services in a KraftCloud deployment. + # List the Compose services for this project Unikraft Cloud $ kraft cloud compose ps - # Build a KraftCloud deployment service. + # Build a specific service image of a Compose project $ kraft cloud compose build nginx - # Create a service image from a KraftCloud deployment. + # Create a service image of a Compose project $ kraft cloud compose create - # Push a KraftCloud deployment service. + # Push a service image of Compose project $ kraft cloud compose push nginx - # Log a KraftCloud deployment service. + # View logs of a service deployment $ kraft cloud compose log nginx `), Annotations: map[string]string{ diff --git a/internal/cli/kraft/cloud/compose/create/create.go b/internal/cli/kraft/cloud/compose/create/create.go index b9a0700b3..5e488c9eb 100644 --- a/internal/cli/kraft/cloud/compose/create/create.go +++ b/internal/cli/kraft/cloud/compose/create/create.go @@ -26,15 +26,12 @@ type CreateOptions struct { func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&CreateOptions{}, cobra.Command{ - Short: "Create a KraftCloud deployment", + Short: "Create a deployment from a Compose project on Unikraft Cloud", Use: "create [FLAGS] [COMPONENT]", Args: cobra.ArbitraryArgs, Aliases: []string{"cr"}, - Long: heredoc.Doc(` - Create a service image from a KraftCloud deployment. - `), Example: heredoc.Doc(` - # Create a service image from a KraftCloud deployment. + # Create a deployment $ kraft cloud compose create `), Annotations: map[string]string{ diff --git a/internal/cli/kraft/cloud/compose/down/down.go b/internal/cli/kraft/cloud/compose/down/down.go index 0248f2d3d..eed1968a5 100644 --- a/internal/cli/kraft/cloud/compose/down/down.go +++ b/internal/cli/kraft/cloud/compose/down/down.go @@ -35,18 +35,15 @@ type DownOptions struct { func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&DownOptions{}, cobra.Command{ - Short: "Stop and remove the services in a KraftCloud compose project deployment", + Short: "Stop and remove the services in a Unikraft Cloud Compose project deployment", Use: "down [FLAGS] [COMPONENT]", Args: cobra.ArbitraryArgs, Aliases: []string{"d"}, - Long: heredoc.Doc(` - Stop a KraftCloud deployment. - `), Example: heredoc.Doc(` - # Stop a KraftCloud deployment fully. + # Stop a deployment and remove all instances, services and volumes. $ kraft cloud compose down - # Stop a KraftCloud deployment with two specific components. + # Stop and remove two specific instances. $ kraft cloud compose down nginx component2 `), Annotations: map[string]string{ diff --git a/internal/cli/kraft/cloud/compose/list/list.go b/internal/cli/kraft/cloud/compose/list/list.go index c8eba6ba1..3a69f2f8e 100644 --- a/internal/cli/kraft/cloud/compose/list/list.go +++ b/internal/cli/kraft/cloud/compose/list/list.go @@ -29,18 +29,15 @@ type ListOptions struct { func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&ListOptions{}, cobra.Command{ - Short: "List KraftCloud deployments at a given path", + Short: "List service deployments at a given path", Use: "ls [FLAGS] [PATH]", Args: cobra.MaximumNArgs(1), Aliases: []string{"l", "ls"}, - Long: heredoc.Doc(` - List KraftCloud deployments at a given path. - `), Example: heredoc.Doc(` - # List KraftCloud deployments at a given path. + # List service deployments at a given path. $ kraft cloud compose ls /path/to/deployment - # List KraftCloud deployments in the current directory. + # List service deployments in the current directory. $ kraft cloud compose ls `), Annotations: map[string]string{ diff --git a/internal/cli/kraft/cloud/compose/logs/logs.go b/internal/cli/kraft/cloud/compose/logs/logs.go index 4966bda42..23a5b41ee 100644 --- a/internal/cli/kraft/cloud/compose/logs/logs.go +++ b/internal/cli/kraft/cloud/compose/logs/logs.go @@ -37,19 +37,17 @@ type LogsOptions struct { func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&LogsOptions{}, cobra.Command{ - Short: "Log the services in a KraftCloud compose project deployment", + Short: "View logs of services in a Unikraft Cloud Compose project deployment", Use: "log [FLAGS]", Args: cobra.ArbitraryArgs, - Aliases: []string{"logs", "l"}, - Long: heredoc.Doc(` - Log the services in a KraftCloud deployment. - `), + Aliases: []string{"log", "l"}, Example: heredoc.Doc(` - # Log the services in a KraftCloud deployment. - $ kraft cloud compose log + # Follow the logs of all service services in a Unikraft Cloud Compose + # project deployment. + $ kraft cloud compose logs -f - # Log a service in a KraftCloud deployment. - $ kraft cloud compose log nginx + # Follow the logs of a specific service + $ kraft cloud compose logs -f nginx `), Annotations: map[string]string{ cmdfactory.AnnotationHelpGroup: "kraftcloud-compose", diff --git a/internal/cli/kraft/cloud/compose/ps/ps.go b/internal/cli/kraft/cloud/compose/ps/ps.go index 9bb610b9f..f08245477 100644 --- a/internal/cli/kraft/cloud/compose/ps/ps.go +++ b/internal/cli/kraft/cloud/compose/ps/ps.go @@ -35,14 +35,11 @@ type PsOptions struct { func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&PsOptions{}, cobra.Command{ - Short: "List the services of compose project deployed to KraftCloud", + Short: "List the active services of Unikraft Cloud Compose project", Use: "ps [FLAGS]", Args: cobra.NoArgs, - Long: heredoc.Doc(` - List the services of compose project deployed to KraftCloud. - `), Example: heredoc.Doc(` - # List the services in a KraftCloud deployment. + # List all active services $ kraft cloud compose ps `), Annotations: map[string]string{ diff --git a/internal/cli/kraft/cloud/compose/push/push.go b/internal/cli/kraft/cloud/compose/push/push.go index 271b78969..c5eb70094 100644 --- a/internal/cli/kraft/cloud/compose/push/push.go +++ b/internal/cli/kraft/cloud/compose/push/push.go @@ -38,15 +38,12 @@ type PushOptions struct { func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&PushOptions{}, cobra.Command{ - Short: "Push a KraftCloud deployment service", + Short: "Push the images services to Unikraft Cloud from a Compose project", Use: "push [FLAGS] [COMPONENT]", Args: cobra.ArbitraryArgs, Aliases: []string{"p"}, - Long: heredoc.Doc(` - Push a KraftCloud deployment service. - `), Example: heredoc.Doc(` - # Push a KraftCloud deployment service. + # Push the nginx service image to Unikraft Cloud $ kraft cloud compose push nginx `), Annotations: map[string]string{ diff --git a/internal/cli/kraft/cloud/compose/start/start.go b/internal/cli/kraft/cloud/compose/start/start.go index 34e9aa16b..c4be5fcf1 100644 --- a/internal/cli/kraft/cloud/compose/start/start.go +++ b/internal/cli/kraft/cloud/compose/start/start.go @@ -35,19 +35,16 @@ type StartOptions struct { func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&StartOptions{}, cobra.Command{ - Short: "Start a KraftCloud deployment", + Short: "Start services in a Unikraft Cloud Compose project deployment", Use: "start [FLAGS] [COMPONENT]", Args: cobra.ArbitraryArgs, Aliases: []string{"str"}, - Long: heredoc.Doc(` - Start an existing KraftCloud deployment. - `), Example: heredoc.Doc(` - # Stop an existing KraftCloud deployment fully. + # Start all services in a Unikraft Cloud Compose project. $ kraft cloud compose start - # Stop an existing KraftCloud deployment with two specific components. - $ kraft cloud compose start nginx component2 + # Start the nginx service + $ kraft cloud compose start nginx `), Annotations: map[string]string{ cmdfactory.AnnotationHelpGroup: "kraftcloud-compose", diff --git a/internal/cli/kraft/cloud/compose/stop/stop.go b/internal/cli/kraft/cloud/compose/stop/stop.go index d92476170..1c1d90a06 100644 --- a/internal/cli/kraft/cloud/compose/stop/stop.go +++ b/internal/cli/kraft/cloud/compose/stop/stop.go @@ -39,19 +39,16 @@ type StopOptions struct { func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&StopOptions{}, cobra.Command{ - Short: "Stop a KraftCloud deployment", + Short: "Stop services in a Unikraft Cloud Compose project deployment", Use: "stop [FLAGS] [COMPONENT]", Args: cobra.ArbitraryArgs, Aliases: []string{"s"}, - Long: heredoc.Doc(` - Stop a KraftCloud deployment. - `), Example: heredoc.Doc(` - # Stop a KraftCloud deployment fully. + # Stop all services in a Unikraft Cloud Compose project. $ kraft cloud compose stop - # Stop a KraftCloud deployment with two specific components. - $ kraft cloud compose stop nginx component2 + # Stop the nginx service + $ kraft cloud compose stop nginx `), Annotations: map[string]string{ cmdfactory.AnnotationHelpGroup: "kraftcloud-compose", diff --git a/internal/cli/kraft/cloud/compose/up/up.go b/internal/cli/kraft/cloud/compose/up/up.go index 6a5da48ac..ef51eee33 100644 --- a/internal/cli/kraft/cloud/compose/up/up.go +++ b/internal/cli/kraft/cloud/compose/up/up.go @@ -51,24 +51,25 @@ type UpOptions struct { func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&UpOptions{}, cobra.Command{ - Short: "Deploy services in a compose project to KraftCloud", + Short: "Deploy services in a compose project to Unikraft Cloud", Use: "up [FLAGS] [COMPONENT]", Args: cobra.ArbitraryArgs, Aliases: []string{"u"}, Long: heredoc.Docf(` - Deploy services in a compose project to KraftCloud + Deploy services in a compose project to Unikraft Cloud Use an existing %[1]sComposefile%[1]s or %[1]sdocker-compose.yaml%[1]s file to start a - number of services as instances on KraftCloud. + number of services as instances on Unikraft Cloud. Note that this is an experimental command and not all attributes of the %[1]sComposefile%[1]s are supported nor are all flags identical. `, "`"), Example: heredoc.Doc(` - # Start a KraftCloud deployment fully. + # Build and deploy a Compose project on Unikraft Cloud. $ kraft cloud compose up - # Start a KraftCloud deployment with two specific components. + # Build and deploy the nginx service from a Compose project on + # Unikraft Cloud. $ kraft cloud compose up nginx component # (If applicable) Set or override a runtime for a particular service diff --git a/internal/cli/kraft/cloud/deploy/deploy.go b/internal/cli/kraft/cloud/deploy/deploy.go index 6e580bb16..597c00751 100644 --- a/internal/cli/kraft/cloud/deploy/deploy.go +++ b/internal/cli/kraft/cloud/deploy/deploy.go @@ -83,7 +83,7 @@ type DeployOptions struct { func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&DeployOptions{}, cobra.Command{ Short: "Deploy your application", - Use: "deploy", + Use: "deploy [ARGS] [CONTEXT] [-- [APP ARGS]]", Aliases: []string{"launch", "run"}, Annotations: map[string]string{ cmdfactory.AnnotationHelpGroup: "kraftcloud", @@ -94,8 +94,20 @@ func NewCmd() *cobra.Command { with a single command. `), Example: heredoc.Docf(` - # Run an image from KraftCloud's catalog: + # Deploy a working directory with a Kraftfile or Dockerfile: + $ kraft cloud --metro fra0 deploy -p 443:8080 + + # Run an image from Unikraft Cloud's image catalog: $ kraft cloud --metro fra0 deploy -p 443:8080 caddy:latest + + # Supply arguments to the instance of the existing image + $ kraft cloud --metro fra0 deploy -p 443:8080 caddy:latest -- /bin/server --debug + + # Supply arguments to the instance of the project (overriding the cmd): + $ kraft cloud --metro fra0 deploy -p 443:8080 . -- /bin/server --debug + + # Immediately start following the log tail + $ kraft cloud --metro fra0 deploy -p 443:8080 -f caddy:latest `), }) if err != nil { diff --git a/internal/cli/kraft/cloud/img/img.go b/internal/cli/kraft/cloud/img/img.go index b8f2b585d..3a539a0c3 100644 --- a/internal/cli/kraft/cloud/img/img.go +++ b/internal/cli/kraft/cloud/img/img.go @@ -22,12 +22,9 @@ type ImgOptions struct{} func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&ImgOptions{}, cobra.Command{ - Short: "Manage images on KraftCloud", - Use: "image", - Aliases: []string{"img"}, - Long: heredoc.Doc(` - Mange images on KraftCloud. - `), + Short: "Manage images", + Use: "img SUBCOMMAND", + Aliases: []string{"image"}, Example: heredoc.Doc(` # List images in your account. $ kraft cloud image list diff --git a/internal/cli/kraft/cloud/img/list/list.go b/internal/cli/kraft/cloud/img/list/list.go index 49eb00ef1..d08c09a7b 100644 --- a/internal/cli/kraft/cloud/img/list/list.go +++ b/internal/cli/kraft/cloud/img/list/list.go @@ -43,9 +43,6 @@ func NewCmd() *cobra.Command { Use: "list", Args: cobra.NoArgs, Aliases: []string{"ls"}, - Long: heredoc.Doc(` - List all images at a metro for your account. - `), Example: heredoc.Doc(` # List images in your account. $ kraft cloud image list diff --git a/internal/cli/kraft/cloud/instance/create/create.go b/internal/cli/kraft/cloud/instance/create/create.go index 43bb3c088..cca410356 100644 --- a/internal/cli/kraft/cloud/instance/create/create.go +++ b/internal/cli/kraft/cloud/instance/create/create.go @@ -695,7 +695,7 @@ func NewCmd() *cobra.Command { nginx:latest `), Long: heredoc.Doc(` - Create an instance on KraftCloud from an image. + Create an instance on Unikraft Cloud from an image. `), Annotations: map[string]string{ cmdfactory.AnnotationHelpGroup: "kraftcloud-instance", diff --git a/internal/cli/kraft/cloud/instance/get/get.go b/internal/cli/kraft/cloud/instance/get/get.go index 158baa494..57796a00c 100644 --- a/internal/cli/kraft/cloud/instance/get/get.go +++ b/internal/cli/kraft/cloud/instance/get/get.go @@ -37,15 +37,15 @@ func Get(ctx context.Context, opts *GetOptions, args ...string) error { func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&GetOptions{}, cobra.Command{ - Short: "Retrieve the state of an instance", + Short: "Retrieve the state of instances", Use: "get [FLAGS] UUID|NAME", Args: cobra.ExactArgs(1), Aliases: []string{"status", "info"}, Example: heredoc.Doc(` - # Retrieve information about a kraftcloud instance by UUID + # Retrieve information about a instance by UUID $ kraft cloud instance get fd1684ea-7970-4994-92d6-61dcc7905f2b - # Retrieve information about a kraftcloud instance by name + # Retrieve information about a instance by name $ kraft cloud instance get my-instance-431342 `), Long: heredoc.Doc(` diff --git a/internal/cli/kraft/cloud/instance/instance.go b/internal/cli/kraft/cloud/instance/instance.go index 9724c0714..660521800 100644 --- a/internal/cli/kraft/cloud/instance/instance.go +++ b/internal/cli/kraft/cloud/instance/instance.go @@ -26,10 +26,10 @@ type InstanceOptions struct{} func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&InstanceOptions{}, cobra.Command{ - Short: "Manage KraftCloud instances", + Short: "Manage instances", Use: "instance SUBCOMMAND", Aliases: []string{"inst", "instances", "vm", "vms"}, - Long: "Manage KraftCloud instances.", + Long: "Manage instances on Unikraft Cloud.", Annotations: map[string]string{ cmdfactory.AnnotationHelpGroup: "kraftcloud-instance", cmdfactory.AnnotationHelpHidden: "true", diff --git a/internal/cli/kraft/cloud/instance/logs/logs.go b/internal/cli/kraft/cloud/instance/logs/logs.go index 10b0a9016..998252b4e 100644 --- a/internal/cli/kraft/cloud/instance/logs/logs.go +++ b/internal/cli/kraft/cloud/instance/logs/logs.go @@ -49,24 +49,24 @@ func Log(ctx context.Context, opts *LogOptions, args ...string) error { func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&LogOptions{}, cobra.Command{ - Short: "Get console output of an instance", + Short: "Get console output of instances", Use: "logs [FLAG] UUID|NAME", Args: cobra.MinimumNArgs(1), Aliases: []string{"log"}, Example: heredoc.Doc(` - # Get all console output of a kraftcloud instance by UUID + # Get all console output of a instance by UUID $ kraft cloud instance logs 77d0316a-fbbe-488d-8618-5bf7a612477a - # Get all console output of a kraftcloud instance by name + # Get all console output of a instance by name $ kraft cloud instance logs my-instance-431342 - # Get the last 20 lines of a kraftcloud instance by name + # Get the last 20 lines of a instance by name $ kraft cloud instance logs my-instance-431342 --tail 20 - # Get the last lines of a kraftcloud instance by name continuously + # Get the last lines of a instance by name continuously $ kraft cloud instance logs my-instance-431342 --follow - # Get the last 10 lines of a kraftcloud instance by name continuously + # Get the last 10 lines of a instance by name continuously $ kraft cloud instance logs my-instance-431342 --follow --tail 10 `), Long: heredoc.Doc(` diff --git a/internal/cli/kraft/cloud/instance/remove/remove.go b/internal/cli/kraft/cloud/instance/remove/remove.go index b96055299..061ca056b 100644 --- a/internal/cli/kraft/cloud/instance/remove/remove.go +++ b/internal/cli/kraft/cloud/instance/remove/remove.go @@ -32,24 +32,24 @@ type RemoveOptions struct { func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&RemoveOptions{}, cobra.Command{ - Short: "Remove an instance", + Short: "Remove instances", Use: "remove [FLAGS] [UUID|NAME [UUID|NAME]...]", Aliases: []string{"del", "delete", "rm"}, Args: cobra.ArbitraryArgs, Example: heredoc.Doc(` - # Remove a KraftCloud instance by UUID + # Remove an instance by UUID $ kraft cloud instance remove fd1684ea-7970-4994-92d6-61dcc7905f2b - # Remove a KraftCloud instance by name + # Remove an instance by name $ kraft cloud instance remove my-instance-431342 - # Remove multiple KraftCloud instances + # Remove multiple instances $ kraft cloud instance remove my-instance-431342 my-instance-other-2313 - # Remove all KraftCloud instances + # Remove all instances $ kraft cloud instance remove --all - # Remove all stopped KraftCloud instances + # Remove all stopped instances $ kraft cloud instance remove --stopped `), Long: heredoc.Doc(` diff --git a/internal/cli/kraft/cloud/instance/start/start.go b/internal/cli/kraft/cloud/instance/start/start.go index b0b3fe22a..3f81ee668 100644 --- a/internal/cli/kraft/cloud/instance/start/start.go +++ b/internal/cli/kraft/cloud/instance/start/start.go @@ -32,18 +32,18 @@ type StartOptions struct { func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&StartOptions{}, cobra.Command{ - Short: "Start an instance", + Short: "Start instances", Use: "start [FLAGS] [UUID|NAME [UUID|NAME]...]", Args: cobra.MinimumNArgs(1), Aliases: []string{"str"}, Example: heredoc.Doc(` - # Start a KraftCloud instance by UUID + # Start an instance by UUID $ kraft cloud instance start 77d0316a-fbbe-488d-8618-5bf7a612477a - # Start a KraftCloud instance by name + # Start an instance by name $ kraft cloud instance start my-instance-431342 - # Start multiple KraftCloud instances + # Start multiple instances $ kraft cloud instance start my-instance-431342 my-instance-other-2313 `), Long: heredoc.Doc(` diff --git a/internal/cli/kraft/cloud/instance/stop/stop.go b/internal/cli/kraft/cloud/instance/stop/stop.go index b81392901..5326e0f8d 100644 --- a/internal/cli/kraft/cloud/instance/stop/stop.go +++ b/internal/cli/kraft/cloud/instance/stop/stop.go @@ -34,29 +34,26 @@ type StopOptions struct { func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&StopOptions{}, cobra.Command{ - Short: "Stop an instance", + Short: "Stop instances", Use: "stop [FLAGS] [UUID|NAME [UUID|NAME]...]", Args: cobra.ArbitraryArgs, Aliases: []string{"st"}, Example: heredoc.Doc(` - # Stop a KraftCloud instance by UUID + # Stop an instance by UUID $ kraft cloud instance stop 77d0316a-fbbe-488d-8618-5bf7a612477a - # Stop a KraftCloud instance by name + # Stop an instance by name $ kraft cloud instance stop my-instance-431342 - # Stop multiple KraftCloud instances + # Stop multiple instances $ kraft cloud instance stop my-instance-431342 my-instance-other-2313 - # Stop all KraftCloud instances + # Stop all instances $ kraft cloud instance stop --all - # Stop a KraftCloud instanace by name and wait for connections to drain for 5s + # Stop an instanace by name and wait for connections to drain for 5s $ kraft cloud instance stop --wait 5s my-instance-431342 `), - Long: heredoc.Doc(` - Stop a KraftCloud instance. - `), Annotations: map[string]string{ cmdfactory.AnnotationHelpGroup: "kraftcloud-instance", }, diff --git a/internal/cli/kraft/cloud/metros/metros.go b/internal/cli/kraft/cloud/metros/metros.go index 341b67bb5..7395c49a0 100644 --- a/internal/cli/kraft/cloud/metros/metros.go +++ b/internal/cli/kraft/cloud/metros/metros.go @@ -21,12 +21,9 @@ type MetrosOptions struct{} func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&MetrosOptions{}, cobra.Command{ - Short: "Inspect metros on KraftCloud", + Short: "Inspect Unikraft Cloud metros and regions", Use: "metro", Aliases: []string{"metros", "m"}, - Long: heredoc.Doc(` - Inspect metros on KraftCloud. - `), Example: heredoc.Doc(` # List metros available. $ kraft cloud metro list diff --git a/internal/cli/kraft/cloud/quotas/quotas.go b/internal/cli/kraft/cloud/quotas/quotas.go index a6528856d..b454b09c3 100644 --- a/internal/cli/kraft/cloud/quotas/quotas.go +++ b/internal/cli/kraft/cloud/quotas/quotas.go @@ -30,21 +30,18 @@ type QuotasOptions struct { func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&QuotasOptions{}, cobra.Command{ - Short: "View your resource quota on KraftCloud", + Short: "View your resource quota on Unikraft Cloud", Use: "quotas", Args: cobra.NoArgs, Aliases: []string{"q", "quota"}, Annotations: map[string]string{ cmdfactory.AnnotationHelpGroup: "kraftcloud", }, - Long: heredoc.Doc(` - View your resource quota on KraftCloud. - `), Example: heredoc.Doc(` - # View your resource quota on KraftCloud + # View your resource quota on Unikraft Cloud $ kraft cloud quota - # View your resource quota on KraftCloud in JSON format + # View your resource quota on Unikraft Cloud in JSON format $ kraft cloud quota -o json `), }) diff --git a/internal/cli/kraft/cloud/scale/initialize/initialize.go b/internal/cli/kraft/cloud/scale/initialize/initialize.go index 6f7181e54..edc0f6e28 100644 --- a/internal/cli/kraft/cloud/scale/initialize/initialize.go +++ b/internal/cli/kraft/cloud/scale/initialize/initialize.go @@ -42,10 +42,9 @@ func NewCmd() *cobra.Command { Use: "init [FLAGS] NAME|UUID", Args: cobra.ExactArgs(1), Aliases: []string{"init", "initialise", "initialize", "i"}, - Long: "Initialize autoscale configuration for a service.", Example: heredoc.Doc(` # Initialize an autoscale configuration - kraft cloud scale init my-service \ + $ kraft cloud scale init my-service \ --master my-instance-name \ --min-size 1 \ --max-size 10 \ diff --git a/internal/cli/kraft/cloud/scale/remove/remove.go b/internal/cli/kraft/cloud/scale/remove/remove.go index 3b38123cf..2b428331c 100644 --- a/internal/cli/kraft/cloud/scale/remove/remove.go +++ b/internal/cli/kraft/cloud/scale/remove/remove.go @@ -33,7 +33,6 @@ func NewCmd() *cobra.Command { Use: "remove [FLAGS] UUID NAME", Args: cobra.ExactArgs(2), Aliases: []string{"delete", "del", "rm"}, - Long: "Delete an autoscale configuration policy.", Example: heredoc.Doc(` # Delete an autoscale configuration policy by UUID $ kraft cloud scale remove fd1684ea-7970-4994-92d6-61dcc7905f2b my-policy diff --git a/internal/cli/kraft/cloud/scale/reset/reset.go b/internal/cli/kraft/cloud/scale/reset/reset.go index 544ed9ead..ba4da6b1c 100644 --- a/internal/cli/kraft/cloud/scale/reset/reset.go +++ b/internal/cli/kraft/cloud/scale/reset/reset.go @@ -33,7 +33,6 @@ func NewCmd() *cobra.Command { Use: "reset [FLAGS] UUID|NAME", Args: cobra.ExactArgs(1), Aliases: []string{"rs", "delconfig", "deinit", "rmconfig"}, - Long: "Reset autoscale configuration of a service.", Example: heredoc.Doc(` # Reset an autoscale configuration by UUID $ kraft cloud scale reset fd1684ea-7970-4994-92d6-61dcc7905f2b diff --git a/internal/cli/kraft/cloud/scale/scale.go b/internal/cli/kraft/cloud/scale/scale.go index 26c573230..2fcbc983c 100644 --- a/internal/cli/kraft/cloud/scale/scale.go +++ b/internal/cli/kraft/cloud/scale/scale.go @@ -25,10 +25,9 @@ type ScaleOptions struct{} func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&ScaleOptions{}, cobra.Command{ - Short: "Manage instance autoscale on KraftCloud", + Short: "Manage instance autoscale policies", Use: "scale SUBCOMMAND", Aliases: []string{"autoscale", "scl"}, - Long: "Manage instance autoscale on KraftCloud.", Example: heredoc.Doc(` # Add an autoscale configuration to a service $ kraft cloud scale add my-service my-policy diff --git a/internal/cli/kraft/cloud/service/create/create.go b/internal/cli/kraft/cloud/service/create/create.go index f8f225079..27871cf03 100644 --- a/internal/cli/kraft/cloud/service/create/create.go +++ b/internal/cli/kraft/cloud/service/create/create.go @@ -215,13 +215,13 @@ func Create(ctx context.Context, opts *CreateOptions, args ...string) (*kcservic func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&CreateOptions{}, cobra.Command{ Short: "Create a service", - Use: "create [FLAGS] EXTERNAL:INTERNAL[/HANDLER[+HANDLER...]]", - Args: cobra.MinimumNArgs(1), + Use: "create [FLAGS] NAME", + Args: cobra.ExactArgs(1), Aliases: []string{"new"}, Long: "Create a service.", Example: heredoc.Doc(` # Create a service with a single service listening on port 443 named "my-service" - $ kraft cloud service create --name my-service 443:8080/http+tls + $ kraft cloud service create -p 443:8080/http+tls my-service `), Annotations: map[string]string{ cmdfactory.AnnotationHelpGroup: "kraftcloud-svc", diff --git a/internal/cli/kraft/cloud/service/get/get.go b/internal/cli/kraft/cloud/service/get/get.go index 05f043736..0596504c4 100644 --- a/internal/cli/kraft/cloud/service/get/get.go +++ b/internal/cli/kraft/cloud/service/get/get.go @@ -37,7 +37,7 @@ func Get(ctx context.Context, opts *GetOptions, args ...string) error { func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&GetOptions{}, cobra.Command{ - Short: "Retrieve the state of a service", + Short: "Retrieve the state of services", Use: "get [FLAGS] UUID|NAME", Args: cobra.ExactArgs(1), Aliases: []string{"gt"}, diff --git a/internal/cli/kraft/cloud/service/list/list.go b/internal/cli/kraft/cloud/service/list/list.go index 6e5de911e..bf0382742 100644 --- a/internal/cli/kraft/cloud/service/list/list.go +++ b/internal/cli/kraft/cloud/service/list/list.go @@ -29,13 +29,10 @@ type ListOptions struct { func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&ListOptions{}, cobra.Command{ - Short: "List all service at a metro for your account", + Short: "List services", Use: "list [FLAGS]", Args: cobra.NoArgs, Aliases: []string{"ls"}, - Long: heredoc.Doc(` - List all service in your account. - `), Example: heredoc.Doc(` # List all service in your account. $ kraft cloud service list diff --git a/internal/cli/kraft/cloud/service/remove/remove.go b/internal/cli/kraft/cloud/service/remove/remove.go index ce6618f48..d25a3e6b9 100644 --- a/internal/cli/kraft/cloud/service/remove/remove.go +++ b/internal/cli/kraft/cloud/service/remove/remove.go @@ -33,11 +33,10 @@ type RemoveOptions struct { func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&RemoveOptions{}, cobra.Command{ - Short: "Delete a service", + Short: "Delete services", Use: "remove [FLAGS] [NAME|UUID [NAME|UUID]...]", Args: cobra.ArbitraryArgs, Aliases: []string{"delete", "del", "rm"}, - Long: "Delete a service.", Example: heredoc.Doc(` # Remove a service from your account by UUID. $ kraft cloud service remove fd1684ea-7970-4994-92d6-61dcc7905f2b diff --git a/internal/cli/kraft/cloud/tunnel/tunnel.go b/internal/cli/kraft/cloud/tunnel/tunnel.go index 759c84585..fe146aa24 100644 --- a/internal/cli/kraft/cloud/tunnel/tunnel.go +++ b/internal/cli/kraft/cloud/tunnel/tunnel.go @@ -51,7 +51,7 @@ type TunnelOptions struct { func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&TunnelOptions{}, cobra.Command{ - Short: "Forward a local port to an unexposed instance through an intermediate TLS tunnel service", + Short: "Forward a local port to an unexposed instance", Long: heredoc.Docf(` Forward a local port to an unexposed instance through an intermediate TLS tunnel service. diff --git a/internal/cli/kraft/cloud/volume/attach/attach.go b/internal/cli/kraft/cloud/volume/attach/attach.go index d21b8f5ff..dec382b83 100644 --- a/internal/cli/kraft/cloud/volume/attach/attach.go +++ b/internal/cli/kraft/cloud/volume/attach/attach.go @@ -79,7 +79,6 @@ func NewCmd() *cobra.Command { Use: "attach [FLAGS] UUID|NAME", Args: cobra.ExactArgs(1), Aliases: []string{"at"}, - Long: "Attach a persistent volume to an instance.", Example: heredoc.Doc(` # Attach the volume data to the instance nginx to the path /mnt/data $ kraft cloud vol attach data --to nginx --at /mnt/data diff --git a/internal/cli/kraft/cloud/volume/detach/detach.go b/internal/cli/kraft/cloud/volume/detach/detach.go index 8f428ecc5..560a88a60 100644 --- a/internal/cli/kraft/cloud/volume/detach/detach.go +++ b/internal/cli/kraft/cloud/volume/detach/detach.go @@ -32,11 +32,10 @@ type DetachOptions struct { func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&DetachOptions{}, cobra.Command{ - Short: "Detach a volume from an instance", + Short: "Detach a persistent volume from an instance", Use: "detach [FLAGS] UUID|NAME", Args: cobra.ExactArgs(1), Aliases: []string{"det"}, - Long: "Detach a volume from an instance.", Example: heredoc.Doc(` # Detach a volume from all instances $ kraft cloud volume detach 77d0316a-fbbe-488d-8618-5bf7a612477a diff --git a/internal/cli/kraft/cloud/volume/get/get.go b/internal/cli/kraft/cloud/volume/get/get.go index a46618b14..44a650bb0 100644 --- a/internal/cli/kraft/cloud/volume/get/get.go +++ b/internal/cli/kraft/cloud/volume/get/get.go @@ -37,13 +37,10 @@ func Status(ctx context.Context, opts *GetOptions, args ...string) error { func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&GetOptions{}, cobra.Command{ - Short: "Retrieve the state of an volume", + Short: "Retrieve the state of persistent volumes", Use: "get [FLAGS] UUID|NAME", Args: cobra.ExactArgs(1), Aliases: []string{"gt"}, - Long: heredoc.Doc(` - Retrieve the state of an volume. - `), Example: heredoc.Doc(` # Retrieve information about a kraftcloud volume by UUID $ kraft cloud volume get fd1684ea-7970-4994-92d6-61dcc7905f2b diff --git a/internal/cli/kraft/cloud/volume/import/import.go b/internal/cli/kraft/cloud/volume/import/import.go index 88c39c588..0877be09b 100644 --- a/internal/cli/kraft/cloud/volume/import/import.go +++ b/internal/cli/kraft/cloud/volume/import/import.go @@ -46,7 +46,7 @@ const volimportPort uint16 = 42069 func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&ImportOptions{}, cobra.Command{ - Short: "Import local data to a volume", + Short: "Import local data to a persistent volume", Use: "import [FLAGS]", Args: cobra.NoArgs, Example: heredoc.Doc(` diff --git a/internal/cli/kraft/cloud/volume/list/list.go b/internal/cli/kraft/cloud/volume/list/list.go index 7782cb18c..cf47e98ab 100644 --- a/internal/cli/kraft/cloud/volume/list/list.go +++ b/internal/cli/kraft/cloud/volume/list/list.go @@ -29,7 +29,7 @@ type ListOptions struct { func NewCmd() *cobra.Command { cmd, err := cmdfactory.New(&ListOptions{}, cobra.Command{ - Short: "List all volumes at a metro for your account", + Short: "List persistent volumes", Use: "list", Args: cobra.NoArgs, Aliases: []string{"ls"},