CLI Overview

The exc CLI is a powerful command-line interface designed to help you manage cloud resources on Excloud. With this CLI, you can create, configure, and manage virtual machines (VMs), security groups, SSH keys, and much more, directly from your terminal.

Getting Started

To use the exc CLI, you need to have it installed and configured. If you haven’t installed it yet, refer to the installation instructions in the Getting Started Guide. Once installed, ensure you log in to the CLI with your credentials.

Key Features

The exc CLI offers a variety of commands and subcommands to manage different cloud resources. Here is an overview of the core features and capabilities:

1. Compute Resources

  • Create Compute Instance: Easily create new virtual machines with customizable options such as instance type, image, subnet, security groups, etc.

    exc compute create --name <vm-name> --image_id <image-id> --instance_type <instance-type> --subnet_id <subnet-id> --security_group_id <security-group-id> --ssh_pubkey <ssh-key-name>

    Flags such as --allocate_public_ipv4 and --project_id allow further customization during the instance creation process.

  • List Instances: List all your existing virtual machines and view their details.

    exc compute list

    Example output:

    ID  NAME       STATUS    INSTANCE_TYPE  IMAGE           ZONE
    1   vm-test-1  running   n1.2c          ubuntu-24.04    zone-1
    2   vm-test-2  stopped   n1.4c          ollama-ubuntu   zone-1
  • List Available Images: List all available images to use when creating a VM.

    exc compute image list

    Example output:

    ID  NAME                 MIN_CPU  MIN_MEMORY  MIN_DISK
    1   ubuntu-24.04         0vCPU    0GB         0GB
    5   ollama-ubuntu-24.04  4vCPU    16GB        200GB
  • Start, Stop, Restart, or Terminate Instances: Manage the lifecycle of your VMs using simple commands like start, stop, restart, and terminate.

    exc compute start --vm_id <vm-id>
    exc compute stop --vm_id <vm-id>
    exc compute restart --vm_id <vm-id>
    exc compute terminate --vm_id <vm-id>

2. SSH Keys

  • Create or List SSH Keys: Create SSH keys for secure access to your VMs or list the existing keys.

    exc compute key create --name <key-name> --ssh-public-key <public-key>
    exc compute key create --name <key-name> --ssh-public-key-path <path-to-public-key>
    exc compute key list

    Note: You can use the --ssh-public-key-path flag to provide the path to your SSH public key file instead of directly specifying the key.

3. Security Groups

  • Manage Security Groups: Create, list, and manage security groups to control access to your VMs.
    exc securitygroup create --name <security-group-name> --description <description>
    exc securitygroup list
    You can also manage security group rules for ingress and egress traffic.
    exc securitygroup rule ingress create --cidr <cidr> --protocol <protocol> --port_range <port-range> --security_group_id <security-group-id>
    exc securitygroup rule egress create --cidr <cidr> --protocol <protocol> --port_range <port-range> --security_group_id <security-group-id>

4. Configs Management

  • Manage CLI Configurations: Set or list CLI configurations such as the default account and organization.
    exc config set --account <account-id> --org <organization-id>
    exc config list

5. Orgs Management

  • Manage User Organizations: List user organizations and view organizational information.
    exc org list

6. Login and Authentication

  • Log in to the Service: Before using the CLI, you must log in with your credentials.
    exc login

Full Command List

Below is a summary of the available commands and their subcommands:

  • compute: Manage compute resources (instances, images, SSH keys, etc.).
    • create, list, start, stop, restart, terminate
    • image list, instancetype list, key create, key list
  • config: Manage CLI configurations (list, set).
  • login: Log in to the Excloud service.
  • org: Manage user organizations (list).
  • securitygroup: Manage security groups (create, delete, list, rule ingress create, rule egress create).

For detailed information on each command, including all available flags and their descriptions, use the --help flag:

exc <command> --help