Command overview

Updated at:

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 --help

Commands at a glance

CommandWhat it does
loginLogs on to Compute Nest.
list-projectsLists supported service templates.
init-projectInitializes a project by specifying a project name.
importCreates or updates a service from a configuration file.
generateGenerates project files into a specified output directory.
service-testManages 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

ParameterRequiredDescriptionExample
--access_key_idYesThe AccessKey ID.AKID1234567890
--access_key_secretYesThe AccessKey secret.secret1234567890
--security_tokenNoThe Security Token required for authentication.security_token_value

Example

computenest-cli login \
  --access_key_id AKID1234567890 \
  --access_key_secret secret1234567890

list-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

ParameterRequiredDescriptionDefault
--service_typeNoFilters results by deployment type. Valid values:None
  • private — private deployment

  • managed — fully managed deployment

Example

computenest-cli list-projects --service_type private

init-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

ParameterRequiredDescriptionExampleDefault
--project_nameYesThe name of the project template to download.springboot-package-ecs-demo—
--output_pathYesThe local directory where project files are saved./path/to/output.

Example

computenest-cli init-project \
  --project_name springboot-package-ecs-demo \
  --output_path

import

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

ParameterRequiredDescriptionExampleDefault
--file_pathNoThe path to the configuration file. If omitted, the CLI looks for config.yaml or .computenest/config.yaml in the current directory.config1.yamlconfig.yaml
--region_idNoThe region where the service is deployed.cn-hangzhoucn-hangzhou
--service_idNoThe 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_nameNoThe service name. Used to identify the service when --service_id is not specified.my-service—
--service_infoNoA JSON array describing service metadata for each supported locale. Each entry must include Locale, ShortDescription, Image, and Name.See examples below—
--version_nameNoA label for the service version.v1.0—
--descNoA brief description of the service.Example service—
--update_artifactNoSpecifies whether to update the deployment artifact. Set to True to update, or False to keep the existing one.TrueFalse
--iconNoThe 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—
--parametersNoA 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_pathNoPath to a JSON or YAML parameter file. Overrides --parameters. Used when creating a managed service./path/to/parameters.json—
Run import from the project root directory (the directory that contains .computenest/). The --file_path parameter is resolved relative to that directory.

Examples

To create a service with default settings

computenest-cli import --service_name=my-service-test1

To update an existing service and refresh the deployment artifact

computenest-cli import --service_name=my-service-test1 --update_artifact=True

To 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.json

generate

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

ParameterRequiredDescriptionExampleDefault
--output_pathYesThe directory where generated files are saved./path/to/output.computenest
--file_pathNoPath to a specific file to generate./path/to/file.txt.
--parametersNoA JSON object of generation parameters. If both --parameters and --parameter_path are specified, --parameter_path takes precedence.{"key1": "value1"}{}
--parameter_pathNoPath to a JSON or YAML parameter file. Overrides --parameters./path/to/parameters.json—
--overwrite, -yNoOverwrites 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

ParameterRequiredDescriptionExampleDefault
--service_idNoThe service ID.service-xxx—
--service_nameNoThe service name.my-test—
--version_nameNoThe service version. If omitted, the default version is used.draftDefault version
--cases_pathNoDirectory where test case files are stored./path/to/test/cases—
--region_idNoThe region ID.cn-hangzhou—
--overwriteNoOverwrites 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/cases

import

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

ParameterRequiredDescriptionExampleDefault
--service_idNoThe service ID.service-xxx—
--service_nameNoThe service name.my-test—
--version_nameNoThe service version. If omitted, the default version is used.draftDefault version
--cases_pathNoDirectory containing the test case files to import./path/to/test/cases—
--region_idNoThe region ID.cn-hangzhou—

Example

computenest-cli service-test import \
  --service_id service-f99b********46f \
  --cases_path path/to/your/test/cases

execute

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

ParameterRequiredDescriptionExampleDefault
--task_nameYesA name for the test task.task-2025—
--task_region_idNoThe region where the task runs. If omitted, the system randomly selects a supported region.cn-hangzhouThe system randomly selects a supported region.
--version_nameNoThe service version. If omitted, the default version is used.draftDefault version
--cases_pathNoDirectory containing the test case files to run./path/to/test/cases—
--region_idNoThe 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/cases

export

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

ParameterRequiredDescriptionExampleDefault
--service_idNoThe service ID.service-xxx—
--service_nameNoThe service name.my-test—
--version_nameNoThe service version. If omitted, the default version is used.draftDefault version
--cases_pathNoDirectory where exported test case files are saved./path/to/test/cases—
--region_idNoThe region ID.cn-hangzhou—

Example

computenest-cli service-test export \
  --service_id service-f99b********46f \
  --cases_path path/to/your/test/cases