Use the CLI¶
These steps apply to the 0.1.0 package on the download page. Complete its installation instructions and check that moi-cli -version works in your terminal. A personal access token is a secret used to authenticate the CLI, not your account password.
Use moi-cli to work with Product resources from a terminal or script. Before starting, go to Download MOI-CLI to obtain the precompiled binary for your operating system.
For all commands and tasks, see CLI.
1. Configure the endpoint and credentials¶
moi-cli config set-endpoint "https://api.moi.matrixorigin.cn/v5"
moi-cli config set-api-key "<personal-access-token>"
Use https://api.moi.matrixorigin.cn/v5 as the endpoint. Pass the personal access token as its original value, without a Bearer prefix. Command-line arguments can be stored in terminal history; configure credentials only in a protected local environment.
2. Find and select a workspace¶
AI Studio CLI features must be used in a workspace. Before using workflows, knowledge bases, data, agents, or other features, select the target workspace and set its workspace ID.
moi-cli -o workspace list
export WORKSPACE_ID='<workspace-id-from-list>'
moi-cli config set-workspace "$WORKSPACE_ID"
A successful workspace-list response confirms that the endpoint and personal access token work. Use the workspace name only to identify the workspace; save and use its ID in subsequent commands.
3. Call example¶
This example calls the List workflows feature. Use the workspace ID from the previous step to list the workflows that the current identity can read:
moi-cli -o workflow list --workspace-id "$WORKSPACE_ID"
On success, the command prints the workflow list as JSON. To inspect the current configuration, run moi-cli config show; api_key should be masked in the output.