As the command-line interface (CLI) of Web App Service (Web+), wpctl enables you to easily create and manage Web+ applications and deployment environments on a terminal. This topic describes the core CLI commands of Web+. You can view all CLI commands by running the wpctl --help, wpctl help, or wpctl h command on the terminal.

Application-related commands

Query applications

You can run this command to query applications under the current account.

Usage:
  wpctl app:list

Example:
  wpctl app:list

Switch to an application

After querying applications, you can run this command to switch to an application.

Usage:
  wpctl app:use ID/Name

Example:
  wpctl app:use app-demo
Parameter Flag
ID/Name: the ID or name of the application to switch to. None

Delete an application

Before deleting an application, you need to release all deployment environments of the application.

Usage:
  wpctl app:delete ID/Name

Example:
  wpctl app:delete app-demo
Parameter Flag
ID/Name: the ID or name of the application to delete. None

Environment-related commands

apply command

You can run the apply command to create an application or deployment environment or update a deployment environment. You can run the apply --help command to view the information about the working directory.

Usage:
    wpctl env:apply [Wpfile] [*.zip] [flags]

Flags:
  --package-id  set the package id
  --package,-p  set the package url
  --label,-l    set the label of package
  --template,-t set the template id(only) to apply
  --type        set the default env type, 'HighAvailability' [HA] or 'StandAlone' [SA]
  --app,-a      set the application
  --env,-e      set the env
  --category    set the category of the new application('Tomcat', or 'Java')
  --stack-id    set the stackId of the new application
  --quiet,-q    run quietly
  --json,-j     result return as json
  --create-on-absent,-C create application or environment on absent, combine with --app/env flags
  --help        print help
`wpctl apply
  --app target_app (--create-on-absent to create when it doesn't exist)
  --env target_env (--create-on-absent to create when it doesn't exist)
  --package https://*** --label v1 (or just using existed package with --pkgId)`
`wpctl apply --template template***
  --app app_template_belongs_to
  --env new_env_name --create-on-absent

You can directly run the apply command without specifying parameters. You can also use a Wpfile file or a ZIP file to specify parameters.

Flag Description
--package-id Specifies the version of the existing deployment package.
--package or -p Specifies the deployment package.
--label or -l Specifies the name of the deployment package.
--template or -t Specifies the ID of the deployment environment configuration template.
--type Specifies the mode of the deployment environment configuration. Valid values:
  • HighAvailability or HA
  • LowCost or LC
--app or -a Specifies the application.
--env or -e Specifies the deployment environment.
--category Specifies the platform type of the application. Valid values: Tomcat or Java.
--stack-id Specifies the technology stack ID of the application. Valid values:
  • Tomcat 8.5 / OpenJDK 8 / Aliyun Linux 2.1903 : ws-6c937c98a9c0296d0c4823983
  • Tomcat 8.5 / Dragonwell 8 / Aliyun Linux 2.1903 : ws-6c937c98a9c0296d0c482398d
  • OpenJDK 8 / Aliyun Linux 2.1903 : ws-6c937c98a9c0296d0c4823984
  • Dragonwell 8 / Aliyun Linux 2.1903 : ws-6c937c98a9c0296d0c482398c
  • Node.js 8.16.0 / Aliyun Linux 2.1903 : ws-6c937c98a9c0296d0c4823985
  • Node.js 10.16.0 / Aliyun Linux 2.1903 : ws-6c937c98a9c0296d0c4823986
  • Native / Aliyun Linux 2.1903 : ws-6c937c98a9c0296d0c4823987
  • Go 1.12.7 / Aliyun Linux 2.1903 : ws-6c937c98a9c0296d0c4823988
  • PHP 7.3 / Aliyun Linux 2.1903 : ws-6c937c98a9c0296d0c4823989
  • Python 3.7.4 / Aliyun Linux 2.1903 : ws-6c937c98a9c0296d0c482398a
  • Python 2.7.16 / Aliyun Linux 2.1903 : ws-6c937c98a9c0296d0c482398b
  • ASP.NET Core 2.2 / Aliyun Linux 2.1903 : ws-6c937c98a9c0296d0c482398e
  • ASP.NET Core 3.0 / Aliyun Linux 2.1903 : ws-6c937c98a9c0296d0c4823990
  • ASP.NET Core 3.1 / Aliyun Linux 2.1903 : ws-6c937c98a9c0296d0c4823991
  • Ruby 2.6.3 / Aliyun Linux 2.1903 : ws-6c937c98a9c0296d0c482398f
--quiet or -q Specifies that the command is run quietly, without any process messages or command output. If you need to display the command output, use the --json flag.
--json or -j Displays the command output in JSON format.
--create-on-absent or -C Specifies that Web+ creates an application or deployment environment if the specified application or deployment environment does not exist. You must use this flag together with the --app or --env flag.

Initialize a deployment environment

You can run this command to initialize the working directory of a deployment environment, including the region, default application, and default deployment environment.

Usage:
  wpctl init

Query environments

You can run this command to query the deployment environments of the current application.

Usage:
  wpctl env:list  [flags]

Flags:
  --app,-a set the application
  --help   print help

Example:
  wpctl env:list --app appName

Switch to a deployment environment

After querying the deployment environments of the current application, you can run this command to switch to a deployment environment.

Usage:
  wpctl env:use id/name

Flags:
  --app,-a set the application
  --help   print help
Parameter Flag
id/name: the ID or name of the application to query. --app or -a: specifies the ID or name of the application to which the target deployment environment belongs.

Display environment information

Usage:
  wpctl env:info  [flags]

Flags:
  --env,-e set the env
  --app,-a set the application
  --json,-j result return as json
  --help   print help

Example:
  wpctl env:info --env envName
Parameter Flag
None
  • --env or -e: specifies the ID or name of the target deployment environment.
  • --app or -a: specifies the ID or name of the application to which the target deployment environment belongs.
  • --json or -j: displays information in JSON format.

Start a deployment environment

Usage:
  wpctl env:start  [flags]

Flags:
  --app,-a set the application
  --env,-e set the env
  --help   print help

Example:
  wpctl env:start --env envId/name
Parameter Flag
None
  • --env or -e: specifies the ID or name of the target deployment environment.
  • --app or -a: specifies the ID or name of the application to which the target deployment environment belongs.

Stop a deployment environment

Usage:
  wpctl env:stop  [flags]

Flags:
  --app,-a set the application
  --env,-e set the env
  --help   print help

Example:
  wpctl env:stop --env envId/name
Parameter Flag
None
  • --env or -e: specifies the ID or name of the target deployment environment.
  • --app or -a: specifies the ID or name of the application to which the target deployment environment belongs.

Release a deployment environment

Usage:
  wpctl env:terminate [flags]

Flags:
  --app,-a   set the application
  --env,-e   set the env
  --help     print help

Example:
  wbnx env:terminate
Parameter Flag
None
  • --env or -e: specifies the ID or name of the target deployment environment.
  • --app or -a: specifies the ID or name of the application to which the target deployment environment belongs.

Resize a deployment environment

Usage:
  wpctl env:scale instanceNum [flags]

Flags:
  --app,-a set the application
  --env,-e set the env
  --help   print help

Example:
  wbnx env:scale 1
Parameter Flag
instanceNum: the target number of Elastic Compute Service (ECS) instances. Valid values: 0 to 100.
  • --env or -e: specifies the ID or name of the target deployment environment.
  • --app or -a: specifies the ID or name of the application to which the target deployment environment belongs.

Delete a deployment environment

Usage:
  wpctl env:delete ID/Name [flags]

Flags:
  --app,-a set the application
  --help   print help

Example:
  wpctl env:delete env-demo
Parameter Flag
ID/Name: the ID or name of the deployment environment to delete. --app or -a: specifies the ID or name of the application to which the target deployment environment belongs.

Generate an environment configuration template

Usage:
  wpctl env:save [flags]

Flags:
  --name,-n set the name
  --app,-a  set the application
  --env,-e  set the env
  --help    print help

Example:
  wpctl env:save --name templateName
Parameter Flag
None
  • --env or -e: specifies the ID or name of the target deployment environment.
  • --app or -a: specifies the ID or name of the application to which the target deployment environment belongs.
  • --name or -n: specifies the name of the template to be generated.

Download the deployment environment configuration

Usage:
  wpctl env:dump [flags]

Flags:
  --env,-e set the env
  --app,-a set the application
  --help   print help

Example:
  wpctl env:dump --env envName
Parameter Flag
None
  • --env or -e: specifies the ID or name of the target deployment environment.
  • --app or -a: specifies the ID or name of the application to which the target deployment environment belongs.

Check environment health

Usage:
  wpctl env:health  [flags]

Flags:
  --env,-e set the env
  --app,-a set the application
  --help   print help

Example:
  wpctl env:health --env envName --app appName
Parameter Flag
None
  • --env or -e: specifies the ID or name of the target deployment environment.
  • --app or -a: specifies the ID or name of the application to which the target deployment environment belongs.

Monitor a deployment environment

Usage:
  wpctl env:top  [flags]

Flags:
  --env,-e set the env
  --app,-a set the application
  --help   print help

Example:
  wpctl env:top --env envName
Parameter Flag
None
  • --env or -e: specifies the ID or name of the target deployment environment.
  • --app or -a: specifies the ID or name of the application to which the target deployment environment belongs.

View environment events

Usage:
  wpctl env:events  [flags]

Flags:
  --env,-e    set the env
  --app,-a    set the application
  --change,-c set the changeId
  --help      print help

Example:
  wpctl env:events --env envName
Parameter Flag
None
  • --env or -e: specifies the ID or name of the target deployment environment.
  • --app or -a: specifies the ID or name of the application to which the target deployment environment belongs.
  • --change or -c: specifies the event of a change to be viewed. The ID of the change must be specified.

Update the environment deployment package

Usage:
  wpctl env:deploy package [flags]

Flags:
  --label,-l set the label of package
  --app,-a   set the application
  --env,-e   set the env
  --help     print help

Example:
  wpctl env:deploy *.war --label v2
Parameter Flag
package: the deployment package used for the update.
  • --env or -e: specifies the ID or name of the target deployment environment.
  • --app or -a: specifies the ID or name of the application to which the target deployment environment belongs.
  • --label or -l: specifies the name of the deployment package to upload.

Access a deployment environment

Usage:
  wpctl env:open [flags]

Flags:
  --app,-a set the application
  --env,-e set the env
  --help   print help

Example:
  wpctl env:open --env envId/name
Parameter Flag
None
  • --env or -e: specifies the ID or name of the target deployment environment.
  • --app or -a: specifies the ID or name of the application to which the target deployment environment belongs.

Instance-related commands

Log on to an instance

You can run this command to log on to an ECS instance in a deployment environment through Secure Shell (SSH).

Usage:
  wpctl env:ssh envName/ID [flags]

Flags:
  --app,-a set the application
  --help   print help

Example:
  wpctl env:ssh envName/ID --app appName/ID
Parameter Flag
envName/ID: the ID or name of the deployment environment to log on to. --app or -a: specifies the ID or name of the application to which the target deployment environment belongs.

Run commands on an instance in a deployment environment

Usage:
  wpctl env:exec <selector> <shell_command>[flags]
  :selector - `envName/id`
  The command will be execute by `root`

Flags:
  --quiet,-q   run quietly
  --timeout,-t execution timeout (in seconds, max is 86400)
  --json,-j    output as json (result will be base64 encoded)
  --force,-f   force to run command on all available servers
  --help       print help

Example:
  wpctl env:exec envName 'echo hello'

Template-related commands

Query templates

Usage:
  wpctl template:list [flags]

Flags:
  --app,-a set the application
  --help   print hel

Example:
  wpctl template:list
Parameter Flag
None --app or -a: specifies the ID or name of the application to query.

Delete a template

Usage:
  wpctl template:delete id/name [flags]

Flags:
  --app,-a set the application
  --help   print help

Example:
  wpctl template:delete templateName/ID
Parameter Flag
id/name: the ID or name of the template to delete. --app or -a: specifies the ID or name of the application to which the target template belongs.

Start a template

Usage:
  wpctl template:launch

Flags:
  --app,-a set the application
  --env,-e set the env
  --create-on-absent,-C create application or environment on absent, combine with --app/env flags
  --help   print help

Example:
  wpctl template:launch templateName/id
Parameter Flag
templateName/id: the ID or name of the template to start.
  • --env or -e: specifies the name of the deployment environment to create and start by using the template.
  • --app or -a: specifies the ID or name of the application to which the target template belongs.
  • --create-on-absent or -C: creates an application or deployment environment if the specified application or deployment environment does not exist. You must use this flag together with the --app or --env flag.

Other commands

Query deployment packages

Usage:
  wpctl pkg:list [flags]

Flags:
  --app,-a set the application
  --help   print help

Example:
  wpctl pkg:list --app appName
Parameter Flag
None --app or -a: specifies the ID or name of the application to query.

Configure an account

Usage:
  wpctl configure --mode <AuthenticateMode> --profile <profileName>

Commands:
  set    set config in non interactive mode
  list   list all config profile
  delete delete config profile

Flags:
   --language          use `--language [en|zh]` to assign language
  --region            use `--region <regionId>` to assign region
  --access-key-id     use `--access-key-id <AccessKeyId>` to assign AccessKeyId, required in AK/StsToken/RamRoleArn mode
  --access-key-secret use `--access-key-secret <AccessKeySecret>` to assign AccessKeySecret
  --help        print help

Automatically complete commands

When you run a script to install the CLI on a terminal, you enable the Tab key of the terminal to automatically complete commands. However, if you switch to another terminal, this feature becomes invalid. In this case, you can run this command to automatically complete commands.

Usage:
  wpctl auto-completion [flags]

Flags:
  --uninstall uninstall auto completion
  --help      print help
Parameter Flag
None --uninstall: disables the automatic command completion feature.

Query the CLI version

Usage:
  wpctl version

Example:
  wpctl version

Update the CLI version

Usage:
  wpctl upgrade

Example:
  wpctl upgrade

Collect CLI information

Usage:
  wpctl collect [flags]

Flags:
  --all  collect all log
  --help print help

Example:
  wpctl collect
Parameter Flag
None --all: collects all log information.

Verify the activation of Web+ and associated services, and required permissions

Usage:
  wpctl doctor

Example:
  wpctl doctor