odpscmd
TLDR
Start the command-line with a custom configuration file
[Interactive] Switch current project
[Interactive] Show tables in the current project
[Interactive] Describe a table
[Interactive] Show table partitions
[Interactive] Describe a partition
SYNOPSIS
odpscmd [options] [command [arguments...]]
PARAMETERS
-h, --help
Display help message and exit
-v, --verbose
Enable verbose output
--version
Print version information
-p <project>, --project-name <project>
Specify MaxCompute project name
-D <database>, --database <database>
Set default database
--endpoint <url>
MaxCompute service endpoint URL
--access-key-id <id>
Alibaba Cloud AccessKey ID
--access-key-secret <secret>
Alibaba Cloud AccessKey Secret
-e <sql>, --execute <sql>
Execute single SQL statement
-f <file>, --file <file>
Execute SQL from file
-c <cluster>, --cluster <cluster>
Specify compute cluster name
-d, --dry-run
Simulate execution without running
--output-format <format>
Set output format (e.g., csv, table)
DESCRIPTION
odpscmd is the official command-line interface (CLI) for Alibaba Cloud's MaxCompute service, formerly known as ODPS (Open Data Processing Service). It enables users to interact with MaxCompute clusters for big data processing tasks, including submitting SQL queries, managing projects, tables, partitions, functions, resources, and packages.
Users can execute SQL statements directly via the -e option, run scripts from files with -f, or enter an interactive shell mode for multi-statement sessions. It supports project switching, database selection, and endpoint configuration for different regions or clusters. odpscmd is essential for developers and data analysts automating workflows, testing queries, or performing administrative tasks without the web console.
Authentication relies on Alibaba Cloud AccessKey pairs, typically configured in ~/.odpscmd.config. Output can be formatted as CSV or visualized in tables. It's lightweight, scriptable, and integrates well with shell pipelines for ETL processes.
CAVEATS
Requires valid Alibaba Cloud credentials; not for public Linux distros—install via MaxCompute console download. Interactive mode may timeout on long sessions. SQL dialect is MaxCompute-specific, not standard SQL.
CONFIGURATION
Default config in ~/.odpscmd.config with sections for [common], [projects], endpoints, and keys. Use SET commands in interactive mode.
SUBCOMMANDS
Common: list projects/tables/partitions, show create table, desc table, run for scripts, tunnel upload/download for data transfer.
INSTALLATION
Download binary from Alibaba Cloud MaxCompute console; unzip and add to PATH. Supports Linux x86_64.
HISTORY
Developed by Alibaba Cloud for ODPS (launched ~2011), rebranded to MaxCompute CLI around 2016. Evolved with tunnel commands for data upload/download and support for serverless compute.


