CLI tool
Neutree CLI tool is used not only for deploying the Neutree management plane, manually importing container images, managing models, and managing engines, but also supports declarative resource management commands to manage clusters, endpoints, and other resources through YAML files.
Prerequisites
Section titled “Prerequisites”-
Download the version 1.0.1 Neutree CLI tool for your server’s CPU architecture.
-
Grant executable permissions to the CLI tool.
Terminal window chmod +x neutree-cli-<arch> -
Create an API key and save it securely.
Creating or updating resources
Section titled “Creating or updating resources”Use the apply command to create or update resources from a YAML file:
neutree-cli-<arch> apply -f <resources.yaml> \ --api-key <api_key> \ --server-url <server_url>Parameters:
| Parameter | Description |
|---|---|
<resources.yaml> | Path to the resource definition YAML file. |
<api_key> | The API key created in the prerequisites. |
<server_url> | The access address of the control plane, for example http://localhost:3000. |
YAML files support multi-document format. Resources are created in dependency order (workspace → cluster → endpoint). If a resource already exists, it is automatically updated.
Querying resources
Section titled “Querying resources”Use the get command to query resources:
-
List all resources of a specified type
Terminal window neutree-cli-<arch> get <KIND> \-w [workspace] \-o [table|json|yaml] \--api-key <api_key> \--server-url <server_url> \[--watch] -
Query a resource by name
Terminal window neutree-cli-<arch> get <KIND> <NAME> \-w [workspace] \-o [table|json|yaml] \--api-key <api_key> \--server-url <server_url> \[--watch]
Parameters:
| Parameter | Description |
|---|---|
<KIND> | Resource type, such as Cluster, Endpoint, ModelRegistry, Workspace. Supports case variations and plurals, such as endpoints. |
<NAME> | Resource name. Optional; if specified, queries a single resource; if omitted, lists all resources. |
[workspace] | Workspace name. Optional; defaults to the default workspace if not specified. |
[table|json|yaml] | Output format. Optional; can be table, json, or yaml. Defaults to table. |
<api_key> | The API key created in the prerequisites. |
<server_url> | The access address of the control plane, for example http://localhost:3000. |
--watch | Optional; monitors resource status changes in real time. |
Waiting for resources to become ready
Section titled “Waiting for resources to become ready”Use the wait command to wait for a resource to meet a specified condition:
neutree-cli-<arch> wait <KIND> <NAME> \ -w [workspace] \ --for <condition> \ --timeout [5m] \ --api-key <api_key> \ --server-url <server_url>Parameters:
| Parameter | Description |
|---|---|
| <KIND> | Resource type, such as Cluster, Endpoint, ModelRegistry, Workspace. Supports case variations and plurals, such as endpoints. |
| <NAME> | Resource name. Optional; if specified, queries a single resource; if omitted, lists all resources. |
| [workspace] | Workspace name. Optional; defaults to the default workspace if not specified. |
| <condition> | Wait condition.
|
| <api_key> | The API key created in the prerequisites. |
| <server_url> | The access address of the control plane, for example http://localhost:3000. |
Deleting resources
Section titled “Deleting resources”Use the delete command to delete resources:
-
Delete by name
Terminal window neutree-cli-<arch> delete <KIND> <NAME> \-w [workspace] \--api-key <api_key> \--server-url <server_url> \[--force] \[--wait] \[--timeout] \[--ignore-not-found] -
Delete from a YAML file
Terminal window neutree-cli-<arch> delete -f <resources.yaml> \--api-key <api_key> \--server-url <server_url> \[--force] \[--wait] \[--timeout] \[--ignore-not-found]
Parameters:
| Parameter | Description |
|---|---|
<KIND> | Resource type, such as Cluster, Endpoint, ModelRegistry, Workspace. Supports case variations and plurals, such as endpoints. |
<NAME> | Resource name. Optional; if specified, queries a single resource; if omitted, lists all resources. |
<resources.yaml> | Path to the resource definition YAML file. |
[workspace] | Workspace name. Optional; defaults to the default workspace if not specified. |
<api_key> | The API key created in the prerequisites. |
<server_url> | The access address of the control plane, for example http://localhost:3000. |
--watch | Optional; monitors resource status changes in real time. |
--force | Optional; skips the graceful shutdown process and forcibly deletes the resource. |
--wait | Optional; waits for the resource to be fully deleted. Enabled by default. |
--timeout | Optional; wait timeout. Defaults to 5 minutes. |
--ignore-not-found | Optional; suppresses errors when the resource does not exist. |
Cleaning up resources deployed with launch
Section titled “Cleaning up resources deployed with launch”Use the cleanup command to clean up resources deployed with the launch command:
neutree-cli-<arch> cleanup \ --api-key <api_key> \ --server-url <server_url>Parameters:
| Parameter | Description |
|---|---|
<api_key> | The API key created in the prerequisites. |
<server_url> | The access address of the control plane, for example http://localhost:3000. |