All Products
Search
Document Center

Platform For AI:Other commands

Last Updated:Sep 01, 2026

Use the dataset, image, workspace, api, and completion commands in PAI CLI to manage datasets and images, query workspaces, call OpenAPI operations directly, and set up shell auto-completion.

pai dataset

dataset list

pai dataset list [--workspace-id ID] [--page N] [--page-size N] [--columns COLS]

Parameter

Type

Default

Description

--workspace-id

string

config

Workspace ID

--page

int

1

Page number

--page-size

int

20

Entries per page

--columns

string

Custom output columns

dataset get

pai dataset get <dataset-id>

pai image

image list

pai image list [--workspace-id ID] [--type preset|custom] [--page N] [--page-size N]

Parameter

Type

Default

Description

--workspace-id

string

config

Workspace ID

--type

string

Image type: preset (official preset) or custom (custom)

--page

int

1

Page number

--page-size

int

20

Entries per page

--columns

string

Custom output columns

pai workspace

workspace list

pai workspace list [--page N] [--page-size N] [--columns COLS]

Parameter

Type

Default

Description

--page

int

1

Page number

--page-size

int

20

Entries per page

--columns

string

Custom output columns

workspace get

pai workspace get <workspace-id>

pai api — generic OpenAPI invocation

Call any PAI OpenAPI operation directly when the CLI doesn't provide a dedicated subcommand.

pai api <product> <Action> --path PATH --version VERSION [flags]

Parameter

Type

Default

Description

<product>

Positional

Product identifier. Required (e.g., dsw, dlc, aiworkspace, paistudio)

<Action>

Positional

API action name (e.g., GetIdleInstanceCuller)

--method

string

GET

HTTP method: GET, POST, PUT, or DELETE

--path

string

ROA request path. Required (e.g., /api/v2/instances)

--version

string

API version number. Required (e.g., 2022-01-01)

--endpoint

string

automatically inferred

API endpoint address. For products where the endpoint can't be inferred, specify it explicitly (e.g., paistudio.{region}.aliyuncs.com)

--param

stringArray

Query parameters in KEY=VALUE format. Repeat the flag to specify multiple parameters

--body-json

string

Request body JSON (PascalCase field names). Supports inline JSON, @body.json or @body.yaml to read from files, and @- to read from standard input

--override / --override-string / --override-unset

stringArray

Modify request body fields before sending. See --override request body editing for details

Note

Common endpoints: pai-dsw.{region}.aliyuncs.com, pai-dlc.{region}.aliyuncs.com, paistudio.{region}.aliyuncs.com. The auto-inferred endpoint for DSW is inaccurate. When calling the PAI-DSW API, specify --endpoint pai-dsw.{region}.aliyuncs.com explicitly.

pai completion — shell auto-completion

Generate auto-completion scripts for Bash, Zsh, Fish, or PowerShell to speed up command-line usage.

Bash

# Temporary (current session only)
source <(pai completion bash)

# Permanent
pai completion bash > /etc/bash_completion.d/pai    # Linux
pai completion bash > $(brew --prefix)/etc/bash_completion.d/pai   # macOS

Zsh

# Make sure compinit is enabled
echo "autoload -U compinit; compinit" >> ~/.zshrc

# Temporary (current session only)
source <(pai completion zsh)

# Permanent
pai completion zsh > "${fpath[1]}/_pai"    # Linux
pai completion zsh > $(brew --prefix)/share/zsh/site-functions/_pai   # macOS

Fish

pai completion fish > ~/.config/fish/completions/pai.fish

PowerShell

pai completion powershell | Out-String | Invoke-Expression
Note

After installation, reopen your terminal and type pai [Tab] to see auto-completion suggestions for all available commands.