Skip to content
Neutree Documentation

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.

  1. Download the version 1.0.1 Neutree CLI tool for your server’s CPU architecture.

  2. Grant executable permissions to the CLI tool.

    Terminal window
    chmod +x neutree-cli-<arch>
  3. Create an API key and save it securely.

Use the apply command to create or update resources from a YAML file:

Terminal window
neutree-cli-<arch> apply -f <resources.yaml> \
--api-key <api_key> \
--server-url <server_url>

Parameters:

ParameterDescription
<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.

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:

ParameterDescription
<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.
--watchOptional; monitors resource status changes in real time.

Use the wait command to wait for a resource to meet a specified condition:

Terminal window
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.
  • delete: Wait for the resource to be deleted.
  • jsonpath=.path=value: Wait for a JSON path on the resource to equal the specified value, for example jsonpath=.status.phase=Running.
<api_key> The API key created in the prerequisites.
<server_url> The access address of the control plane, for example http://localhost:3000.

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:

ParameterDescription
<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.
--watchOptional; monitors resource status changes in real time.
--forceOptional; skips the graceful shutdown process and forcibly deletes the resource.
--waitOptional; waits for the resource to be fully deleted. Enabled by default.
--timeoutOptional; wait timeout. Defaults to 5 minutes.
--ignore-not-foundOptional; 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:

Terminal window
neutree-cli-<arch> cleanup \
--api-key <api_key> \
--server-url <server_url>

Parameters:

ParameterDescription
<api_key>The API key created in the prerequisites.
<server_url>The access address of the control plane, for example http://localhost:3000.