The MaxCompute client (odpscmd) is a command-line interface (CLI) that runs on your local machine. Use it to run SQL statements, manage resources, and interact with MaxCompute projects directly from the terminal.
Prerequisites
Before you begin, ensure that you have:
Java 8 or later installed on your machine
A MaxCompute project created. See Create a MaxCompute project
Your RAM user added to the DataWorks workspace that the MaxCompute project belongs to. See Grant permissions to a RAM user
Limitations
Client V0.28.0 and later: Support Java Development Kit (JDK) 1.8 and JDK 1.9.
Client earlier than V0.28.0: Supports JDK 1.8 only.
Client V0.27.0 and later: Support the MaxCompute V2.0 data type edition, which is the recommended edition. See MaxCompute V2.0 data type edition.
Install and configure the client
Step 1: Download the installation package
Download the latest odpscmd_public.zip from the MaxCompute client releases page on GitHub.
If you cannot access GitHub, download odpscmd_public_0.48.0.zip directly.
Step 2: Extract the package
Extract odpscmd_public.zip. The package contains four folders: bin, conf, lib, and plugins.
Step 3: Configure odps_config.ini
Open conf/odps_config.ini. Lines starting with # are comments.
The following is a minimal working configuration. Replace the placeholder values before starting the client:
# The name of the MaxCompute project to connect to.
# For workspaces in standard mode, development environment project names end with _dev.
# To find your project name: log in to the MaxCompute console, go to Workspace > Projects.
project_name=<your-project-name>
# AccessKey ID of your Alibaba Cloud account or RAM user.
# To get your AccessKey ID: click your profile picture in the MaxCompute console, then select AccessKey Management.
access_id=<your-accesskey-id>
# AccessKey secret corresponding to the AccessKey ID above.
access_key=<your-accesskey-secret>
# Endpoint of the MaxCompute service.
# This is the MaxCompute service endpoint, not the MaxCompute Tunnel endpoint.
# Choose the endpoint that matches your project region and network type.
# See Endpoints: https://www.alibabacloud.com/help/en/document_detail/34951.html
end_point=http://service.cn-hangzhou.maxcompute.aliyun.com/apiInvalid parameter values cause a project connection failure — double-check all required parameters before starting the client.
The following optional parameters are available:
| Parameter | Description | Example |
|---|---|---|
log_view_host | LogView URL for viewing job runtime information and troubleshooting errors. Recommended: set to http://logview.odps.aliyun.com. Without this parameter, you cannot identify the cause of job failures. | http://logview.odps.aliyun.com |
https_check | Enables HTTPS encryption for requests. Default: False. | True |
data_size_confirm | Maximum input data size in GB. You can set this parameter to any value. Recommended: 100. | 100 |
update_url | Reserved. Leave blank. | — |
use_instance_tunnel | Uses InstanceTunnel to download SQL execution results. Default: False. | True |
instance_tunnel_max_record | Maximum number of records returned for SQL results. Required when use_instance_tunnel is True. Maximum: 10000. | 10000 |
tunnel_endpoint | Public endpoint of MaxCompute Tunnel. If not set, traffic is automatically routed to the Tunnel endpoint matching your network. See Endpoints. | http://dt.cn-hangzhou.maxcompute.aliyun.com |
set.<key> | MaxCompute project properties. See Properties. | set.odps.sql.decimal.odps2=true |
Start the client
Windows
Navigate to the bin folder, then choose one of the following methods:
Double-click
odpscmd.batto start the client in a new window.Run from the command prompt: go to the
binfolder and run:odpscmd
macOS
Navigate to the bin folder, then choose one of the following methods:
Double-click
odpscmdin Finder to start the client.Run from the terminal: go to the
binfolder and run:sh odpscmd
Linux
In a terminal, go to the bin folder and run:
sh odpscmdOn Ubuntu, sh odpscmd may return an error. Run ./odpscmd instead.
Verify the connection
If the information shown in the following figure is returned, the MaxCompute project is connected.

To pass startup parameters when launching from the CLI, see Specify startup parameters.
What's next
After connecting to your MaxCompute project, you can:
Create tables in the project
Upload resources such as files and JAR packages
References
MaxCompute client (odpscmd) — full command reference and common errors