Command overview
ComputeNest CLI provides commands to log on, scaffold projects, publish services, and run automated tests — all from the command line.
For help on any command, append --help:
computenest-cli import --helpCommands at a glance
| Command | What it does |
|---|---|
login | Logs on to Compute Nest. |
list-projects | Lists supported service templates. |
init-project | Initializes a project by specifying a project name. |
import | Creates or updates a service from a configuration file. |
generate | Generates project files into a specified output directory. |
service-test | Manages service test cases: generate, import, execute, export. |
login
Authenticates with Compute Nest using your Alibaba Cloud credentials.
Synopsis
computenest-cli login
--access_key_id <value>
--access_key_secret <value>
[--security_token <value>]Parameters
| Parameter | Required | Description | Example |
|---|---|---|---|
--access_key_id | Yes | The AccessKey ID. | AKID1234567890 |
--access_key_secret | Yes | The AccessKey secret. | secret1234567890 |
--security_token | No | The Security Token required for authentication. | security_token_value |
Example
computenest-cli login \
--access_key_id AKID1234567890 \
--access_key_secret secret1234567890list-projects
Lists supported service templates and their project names. Use the returned project names with init-project to scaffold a local project.
Synopsis
computenest-cli list-projects
[--service_type <value>]Parameters
| Parameter | Required | Description | Default |
|---|---|---|---|
--service_type | No | Filters results by deployment type. Valid values: | None |
private— private deploymentmanaged— fully managed deployment
Example
computenest-cli list-projects --service_type privateinit-project
Initializes a project by specifying a project name. Use this command to download the specified project to the output path. After initialization, switch to the output directory and run computenest-cli import to create a Compute Nest service.
Synopsis
computenest-cli init-project
--project_name <value>
--output_path <value>Parameters
| Parameter | Required | Description | Example | Default |
|---|---|---|---|---|
--project_name | Yes | The name of the project template to download. | springboot-package-ecs-demo | — |
--output_path | Yes | The local directory where project files are saved. | /path/to/output | . |
Example
computenest-cli init-project \
--project_name springboot-package-ecs-demo \
--output_pathimport
Creates or updates a Compute Nest service from a configuration file.
Synopsis
computenest-cli import
[--file_path <value>]
[--region_id <value>]
[--service_id <value>]
[--service_name <value>]
[--service_info <value>]
[--version_name <value>]
[--desc <value>]
[--update_artifact <value>]
[--icon <value>]
[--parameters <value>]
[--parameter_path <value>]Parameters
| Parameter | Required | Description | Example | Default |
|---|---|---|---|---|
--file_path | No | The path to the configuration file. If omitted, the CLI looks for config.yaml or .computenest/config.yaml in the current directory. | config1.yaml | config.yaml |
--region_id | No | The region where the service is deployed. | cn-hangzhou | cn-hangzhou |
--service_id | No | The service ID. If specified, it takes precedence over --service_name for identifying the service and allows you to update the service name. | service-12345 | — |
--service_name | No | The service name. Used to identify the service when --service_id is not specified. | my-service | — |
--service_info | No | A JSON array describing service metadata for each supported locale. Each entry must include Locale, ShortDescription, Image, and Name. | See examples below | — |
--version_name | No | A label for the service version. | v1.0 | — |
--desc | No | A brief description of the service. | Example service | — |
--update_artifact | No | Specifies whether to update the deployment artifact. Set to True to update, or False to keep the existing one. | True | False |
--icon | No | The URL of the service icon. Accepts a relative path, absolute path, or a publicly accessible URL such as an Object Storage Service (OSS) URL. | https://example.com/icon.png | — |
--parameters | No | A JSON object of parameters passed to the service configuration. Used when creating a managed service. If both --parameters and --parameter_path are specified, --parameter_path takes precedence. | {"key1": "value1"} | {} |
--parameter_path | No | Path to a JSON or YAML parameter file. Overrides --parameters. Used when creating a managed service. | /path/to/parameters.json | — |
Runimportfrom the project root directory (the directory that contains.computenest/). The--file_pathparameter is resolved relative to that directory.
Examples
To create a service with default settings
computenest-cli import --service_name=my-service-test1To update an existing service and refresh the deployment artifact
computenest-cli import --service_name=my-service-test1 --update_artifact=TrueTo configure localized service metadata
computenest-cli import --service_info '[{"Locale": "en-US", "ShortDescription": "An example service for demonstration purposes.", "Image": "https://service-info-public.oss-cn-hangzhou.aliyuncs.com/5141674772595072/service-image/ca7d10d9-1aa0-4bb5-913d-b347f71804a4.png", "Name": "ExampleServiceXYZ"}, {"Locale": "zh-CN", "ShortDescription": "This service is used to demonstrate how to configure and deploy.", "Image": "https://service-info-public.oss-cn-hangzhou.aliyuncs.com/1853370294850618/service-image/bfd30cc4-e959-4093-b5cb-77a05058b911.png", "Name": "Example service test-anxh"}]'To specify a configuration file and multiple parameters
computenest-cli import \
--region_id cn-hangzhou \
--file_path config1.yaml \
--update_artifact True \
--service_id service-12345 \
--service_name my-service \
--version_name new_version \
--icon https://xxx/icon.png \
--desc "Sample service" \
--parameter_path /path/to/parameters.jsongenerate
Generates project files into a specified output directory.
Synopsis
computenest-cli generate
--output_path <value>
[--file_path <value>]
[--parameters <value>]
[--parameter_path <value>]
[-y]Parameters
| Parameter | Required | Description | Example | Default |
|---|---|---|---|---|
--output_path | Yes | The directory where generated files are saved. | /path/to/output | .computenest |
--file_path | No | Path to a specific file to generate. | /path/to/file.txt | . |
--parameters | No | A JSON object of generation parameters. If both --parameters and --parameter_path are specified, --parameter_path takes precedence. | {"key1": "value1"} | {} |
--parameter_path | No | Path to a JSON or YAML parameter file. Overrides --parameters. | /path/to/parameters.json | — |
--overwrite, -y | No | Overwrites existing output files without prompting for confirmation. | (flag) | False |
Example
To generate configuration files for a Docker Compose-based project
computenest-cli generate -y \
--parameters '{
"ArtifactSourceType": "DockerCompose",
"RepoName": "ztjhz/BetterChatGPT",
"Platform": "github",
"Branch": "main",
"ServiceType": "private",
"DockerComposeYamlPath": "docker-compose.yml",
"DockerComposeEnvPath": ".env.example",
"RegionId": "cn-hangzhou",
"ServiceBuildRegion": "ap-southeast-1"
}'service-test
Manages the full lifecycle of service test cases. The command accepts four subcommands:
computenest-cli service-test <generate|import|execute|export> [parameters]generate
Generates a test case file for each template found in the specified path.
Synopsis
computenest-cli service-test generate
[--service_id <value>]
[--service_name <value>]
[--version_name <value>]
[--cases_path <value>]
[--region_id <value>]
[--overwrite]Parameters
| Parameter | Required | Description | Example | Default |
|---|---|---|---|---|
--service_id | No | The service ID. | service-xxx | — |
--service_name | No | The service name. | my-test | — |
--version_name | No | The service version. If omitted, the default version is used. | draft | Default version |
--cases_path | No | Directory where test case files are stored. | /path/to/test/cases | — |
--region_id | No | The region ID. | cn-hangzhou | — |
--overwrite | No | Overwrites existing test cases in --cases_path. | (flag) | True |
Example
computenest-cli service-test generate \
--service_id service-f99b********46f \
--cases_path path/to/your/test/casesimport
Imports a collection of test case files from a local directory into the current service version.
Synopsis
computenest-cli service-test import
[--service_id <value>]
[--service_name <value>]
[--version_name <value>]
[--cases_path <value>]
[--region_id <value>]Parameters
| Parameter | Required | Description | Example | Default |
|---|---|---|---|---|
--service_id | No | The service ID. | service-xxx | — |
--service_name | No | The service name. | my-test | — |
--version_name | No | The service version. If omitted, the default version is used. | draft | Default version |
--cases_path | No | Directory containing the test case files to import. | /path/to/test/cases | — |
--region_id | No | The region ID. | cn-hangzhou | — |
Example
computenest-cli service-test import \
--service_id service-f99b********46f \
--cases_path path/to/your/test/casesexecute
Runs test cases from the specified directory as a task.
Synopsis
computenest-cli service-test execute
--task_name <value>
[--task_region_id <value>]
[--version_name <value>]
[--cases_path <value>]
[--region_id <value>]Parameters
| Parameter | Required | Description | Example | Default |
|---|---|---|---|---|
--task_name | Yes | A name for the test task. | task-2025 | — |
--task_region_id | No | The region where the task runs. If omitted, the system randomly selects a supported region. | cn-hangzhou | The system randomly selects a supported region. |
--version_name | No | The service version. If omitted, the default version is used. | draft | Default version |
--cases_path | No | Directory containing the test case files to run. | /path/to/test/cases | — |
--region_id | No | The region ID. | cn-hangzhou | — |
Example
computenest-cli service-test execute \
--task_name task-2025 \
--service_id service-f99b********46f \
--cases_path path/to/your/test/casesexport
Exports test case files to a local directory.
Synopsis
computenest-cli service-test export
[--service_id <value>]
[--service_name <value>]
[--version_name <value>]
[--cases_path <value>]
[--region_id <value>]Parameters
| Parameter | Required | Description | Example | Default |
|---|---|---|---|---|
--service_id | No | The service ID. | service-xxx | — |
--service_name | No | The service name. | my-test | — |
--version_name | No | The service version. If omitted, the default version is used. | draft | Default version |
--cases_path | No | Directory where exported test case files are saved. | /path/to/test/cases | — |
--region_id | No | The region ID. | cn-hangzhou | — |
Example
computenest-cli service-test export \
--service_id service-f99b********46f \
--cases_path path/to/your/test/cases