Install and configure the saectl tool

更新时间:
复制 MD 格式

saectl (Serverless Application Engine Control Tool) is a command-line interface for deploying and managing applications on SAE. This guide walks you through installing saectl, configuring credentials, and enabling shell autocompletion.

Prerequisites

Before you begin, make sure you have:

Install saectl

Download the package for your operating system and architecture, then move the binary to your PATH.

macOS

Download

ArchitecturePackage
x86-64saectl-v0.1.10-darwin-amd64.tar.gz
ARM64saectl-v0.1.10-darwin-arm64.tar.gz

Install

  1. Decompress the downloaded package. The decompressed directory contains saectl.

  2. Move the binary to your system tools path:

    mv ./saectl /usr/local/bin

Linux

Download

ArchitecturePackage
x86-64saectl-v0.1.10-linux-amd64.tar.gz
ARM64saectl-v0.1.10-linux-arm64.tar.gz

Install

  1. Decompress the downloaded package:

    tar -zxvf <package-file-name>

    The decompressed directory contains saectl.

  2. Move the binary to your system tools path:

    mv ./saectl /usr/local/bin

Windows

Download

ArchitecturePackage
x86-64saectl-v0.1.10-windows-amd64.zip
ARM64saectl-v0.1.10-windows-arm64.zip

Install

  1. Decompress the downloaded package. The decompressed directory contains saectl.exe.

  2. Add the decompressed directory path to the PATH system environment variable.

Verify the installation

Run the following command:

saectl version

If the command returns the version information for the saectl tool, the tool is installed successfully.

Get help

Use the --help flag with any command to see available options:

  • saectl --help — lists available commands such as get, describe, and apply

  • saectl apply --help — lists parameters for the apply command, such as -f and -o

Release notes

VersionRelease dateChanges
v0.1.102026-01-27Added command autocompletion
v0.1.92025-12-25Fixed a bug in the exec command for the Alibaba Cloud International site
v0.1.82025-11-17Fixed a bug in the convert command
v0.1.72025-07-11Added batch conversion support in the convert command; fixed bugs
v0.1.62025-06-30Added the convert command: saectl convert -f input.yaml -o output.yaml converts a Kubernetes YAML file to an SAE YAML file
v0.1.52025-05-23Added credential-related commands
v0.1.42024-02-07Renamed kubectl-sae to saectl
v0.1.32024-12-24Adjusted client timeout to 60 s to resolve timeout errors
v0.1.22024-11-20Added the saectl upload command; improved saectl version output
v0.1.12024-11-11Added namespace consistency check when -n is specified; uses the namespace from the YAML file when -n is not specified

Configure saectl

saectl requires three environment variables to manage SAE resources: your AccessKey ID, AccessKey secret, and application deployment region.

VariableDescriptionExample
ALICLOUD_ACCESS_KEYYour AccessKey IDLTAI5tXxx...
ALICLOUD_SECRET_KEYYour AccessKey secretxXxXxXx...
ALICLOUD_REGIONYour application deployment regioncn-beijing

Linux or macOS

Run echo $SHELL to check your default shell, then follow the steps for your shell.

Zsh

  1. Append the environment variables to ~/.zshrc:

    echo "export ALICLOUD_ACCESS_KEY='YOUR_ACCESS_KEY_ID'" >> ~/.zshrc
    echo "export ALICLOUD_SECRET_KEY='YOUR_ACCESS_KEY_SECRET'" >> ~/.zshrc
    echo "export ALICLOUD_REGION='cn-beijing'" >> ~/.zshrc

    Replace YOUR_ACCESS_KEY_ID, YOUR_ACCESS_KEY_SECRET, and cn-beijing with your actual values.

  2. Apply the changes:

    source ~/.zshrc
  3. Open a new terminal window and verify the variables are set:

    echo $ALICLOUD_ACCESS_KEY, $ALICLOUD_SECRET_KEY, $ALICLOUD_REGION

Bash

  1. Append the environment variables to ~/.bashrc:

    echo "export ALICLOUD_ACCESS_KEY='YOUR_ACCESS_KEY_ID'" >> ~/.bashrc
    echo "export ALICLOUD_SECRET_KEY='YOUR_ACCESS_KEY_SECRET'" >> ~/.bashrc
    echo "export ALICLOUD_REGION='cn-beijing'" >> ~/.bashrc

    Replace YOUR_ACCESS_KEY_ID, YOUR_ACCESS_KEY_SECRET, and cn-beijing with your actual values.

  2. Apply the changes:

    source ~/.bashrc
  3. Open a new terminal window and verify the variables are set:

    echo $ALICLOUD_ACCESS_KEY, $ALICLOUD_SECRET_KEY, $ALICLOUD_REGION

Windows

This example uses Command Prompt (CMD).

  1. Run the following commands:

    setx ALICLOUD_ACCESS_KEY "YOUR_ACCESS_KEY_ID"
    setx ALICLOUD_SECRET_KEY "YOUR_ACCESS_KEY_SECRET"
    setx ALICLOUD_REGION "cn-beijing"

    Replace YOUR_ACCESS_KEY_ID, YOUR_ACCESS_KEY_SECRET, and cn-beijing with your actual values.

  2. Open a new Command Prompt window and verify the variables are set:

    echo %ALICLOUD_ACCESS_KEY%, %ALICLOUD_SECRET_KEY%, %ALICLOUD_REGION%

Verify the configuration

Run the following command:

saectl get ns

If the command returns the namespace information for the specified application deployment region in your account, the saectl tool is configured successfully.

Set up shell autocompletion

saectl supports autocompletion for Bash, Zsh, Fish, and PowerShell. After setup, press Tab to complete commands, resource types, resource names, and parameters.

Install autocompletion

Bash

# Generate the completion script
saectl completion bash > ~/.saectl-completion.bash

# Add it to .bashrc
echo 'source ~/.saectl-completion.bash' >> ~/.bashrc

# Apply the changes immediately
source ~/.bashrc
The default Bash on macOS is outdated. Use Zsh, or upgrade Bash with Homebrew:
brew install bash-completion@2
saectl completion bash > $(brew --prefix)/etc/bash_completion.d/saectl

Zsh

# Generate the completion script
saectl completion bash > ~/.saectl-completion.bash

# Add it to .zshrc (using bashcompinit compatibility mode)
cat >> ~/.zshrc << 'EOF'
autoload -U +X bashcompinit && bashcompinit
source ~/.saectl-completion.bash
EOF

# Apply the changes immediately
source ~/.zshrc

Fish

# Generate the completion script (takes effect automatically)
saectl completion fish > ~/.config/fish/completions/saectl.fish

PowerShell

# Generate the completion script
saectl completion powershell | Out-String | Invoke-Expression

# Add it to your profile to make it permanent
saectl completion powershell >> $PROFILE

Use autocompletion

After installation, enter saectl in the terminal and press Tab to trigger autocompletion. The following completions are supported:

TypeHow to triggerExamples
Commandssaectl + Tabget, create, delete, apply, describe, logs, exec
Resource typessaectl get + Tabnamespaces, deployments, pods, services, configmaps, secrets, ingresses
Resource namesAfter a resource type, press TabSpecific resource names in the current namespace
Parameters-- + Tab--namespace, --output, --all-namespaces, --selector
Container namesWhen using logs or exec, press TabContainer names in the pod

Troubleshoot autocompletion

If autocompletion is not working, purge the completion cache:

# Zsh
rm -f ~/.zcompdump*
exec zsh

# Bash
hash -r

Remove autocompletion

  • Bash: Delete ~/.saectl-completion.bash and remove the source line from ~/.bashrc.

  • Zsh: Delete ~/.saectl-completion.bash and remove the related lines from ~/.zshrc.

  • Fish: Delete ~/.config/fish/completions/saectl.fish.