All Projects → aliyun → Aliyun Cli

aliyun / Aliyun Cli

Licence: apache-2.0
Alibaba Cloud CLI

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Aliyun Cli

Openapi Sdk Php Client
Official repository of the Alibaba Cloud Client for PHP
Stars: ✭ 206 (-63.28%)
Mutual labels:  alibaba, sdk, client
Aliyun Openapi Java Sdk
Alibaba Cloud SDK for Java
Stars: ✭ 1,170 (+108.56%)
Mutual labels:  alibaba, sdk, client
Openapi Core Ruby Sdk
Alibaba Cloud Core SDK for Ruby
Stars: ✭ 29 (-94.83%)
Mutual labels:  alibaba, sdk, client
Aliyun Openapi Net Sdk
Alibaba Cloud SDK for .NET
Stars: ✭ 467 (-16.76%)
Mutual labels:  alibaba, sdk, client
Madonctl
CLI client for the Mastodon social network API
Stars: ✭ 129 (-77.01%)
Mutual labels:  cli, client
Fuego
Fuego is a command line client for the firestore database (https://firebase.google.com/docs/firestore).
Stars: ✭ 110 (-80.39%)
Mutual labels:  cli, client
Client
Knative developer experience, docs, reference Knative CLI implementation
Stars: ✭ 193 (-65.6%)
Mutual labels:  cli, client
Httpie
As easy as /aitch-tee-tee-pie/ 🥧 Modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more. https://twitter.com/httpie
Stars: ✭ 53,052 (+9356.68%)
Mutual labels:  cli, client
Gowebdav
A golang WebDAV client library and command line tool.
Stars: ✭ 97 (-82.71%)
Mutual labels:  cli, client
Jenkins Cli
Jenkins CLI allows you manage your Jenkins as an easy way
Stars: ✭ 245 (-56.33%)
Mutual labels:  cli, client
Devkit
Stars: ✭ 561 (+0%)
Mutual labels:  cli, sdk
Appstoreconnect Cli
An easy to use command-line tool for interacting with the Apple AppStore Connect API
Stars: ✭ 110 (-80.39%)
Mutual labels:  cli, client
Cordless
The Discord terminal client you never knew you wanted.
Stars: ✭ 1,391 (+147.95%)
Mutual labels:  cli, client
Bt
BitTorrent library and client with DHT, magnet links, encryption and more
Stars: ✭ 2,011 (+258.47%)
Mutual labels:  cli, client
Rundeck Cli
CLI tool for Rundeck
Stars: ✭ 98 (-82.53%)
Mutual labels:  cli, client
Zapier Platform Cli
💻 Build Zapier integrations and test locally using the JavaScript tools you already know.
Stars: ✭ 249 (-55.61%)
Mutual labels:  cli, sdk
Globalplatformpro
🌐 🔐 Manage applets and keys on JavaCard-s like a pro (via command line or from your Java project)
Stars: ✭ 409 (-27.09%)
Mutual labels:  cli, sdk
Haxor News
Browse Hacker News like a haxor: A Hacker News command line interface (CLI).
Stars: ✭ 3,342 (+495.72%)
Mutual labels:  cli, client
Openapi Sdk Php
Alibaba Cloud SDK for PHP
Stars: ✭ 423 (-24.6%)
Mutual labels:  alibaba, sdk
Fvm
Flutter Version Management: A simple CLI to manage Flutter SDK versions.
Stars: ✭ 1,293 (+130.48%)
Mutual labels:  cli, sdk

English | 简体中文

Alibaba Cloud CLI

Travis Build Status Appveyor Build Status codecov License Go Report
Latest Stable Version GitHub Release Date
GitHub All Releases

The Alibaba Cloud CLI is an open source tool, you can get the latest version from GitHub. You can also try it out in the Cloud Shell before installing the CLI.

Introduction

The Alibaba Cloud CLI is a tool to manage and use Alibaba Cloud resources through a command line interface. It is written in Go and built on the top of Alibaba Cloud OpenAPI.

Note: Alibaba Cloud CLI access the Alibaba Cloud services through OpenAPI. Before using Alibaba Cloud CLI, make sure that you have activated the service to use and known how to use OpenAPI.

Troubleshoot

Troubleshoot Provide OpenAPI diagnosis service to help developers locate quickly and provide solutions for developers through RequestID or error message.

CLI Releases

The release notes for the CLI can be found in the CHANGELOG

Installation

  • Download installer (Recommended)

    Download the installer, then extract the installer. You can move the extracted aliyun executable file to the /usr/local/bin directory or add it to the $PATH.

    Download link: (3.0.73)

  • Use brew If you have installed brew in your computer, you can use it to install Alibaba Cloud CLI as following:

brew install aliyun-cli

If you need detailed installation steps or compile the installation steps, please visit Installation Guide.

Configure

For detailed configuration instructions, please visit the official website Configuration Alibaba Cloud CLI.

Before using Alibaba Cloud CLI to invoke the services, you need to configure the credential information, region, language, etc.

You can run the aliyun configure command for quick configuration.

$ aliyun configure
Configuring profile 'default' ...
Aliyun Access Key ID [None]: <Your AccessKey ID>
Aliyun Access Key Secret [None]: <Your AccessKey Secret>
Default Region Id [None]: cn-hangzhou
Default output format [json]: json
Default Language [zh]: zh

Configure authentication methods

You can specify the authentication method to use by using the configure command with the --mode <authenticationMethod> option.

The following are supported authentication methods:

Authentication methods Description
AK Use AccessKey ID and Secret to access Alibaba Cloud services
StsToken Use STS token to access Alibaba Cloud services
RamRoleArn Use the AssumeRole to access Alibaba Cloud services
EcsRamRole Use the EcsRamRole to access ECS resources

Use an external program to get credentials

You can use --mode External to specify to obtain credential data through an external program, and CLI will execute the program command and return it as a credential to initiate the call.

Agreement:

  1. The output location of the external program is standard output.
  2. The output format is json string.
  3. The output contains the key fields required by the CLI and credential fields

Key field:

  • mode: Specify the type of credentials returned

Example of the return of each credential type:

  • AK
{
  "mode": "AK",
  "access_key_id": "accessKeyId",
  "access_key_secret": "accessKeySecret"
}
  • StsToken
{
  "mode": "StsToken",
  "access_key_id": "accessKeyId",
  "access_key_secret": "accessKeySecret",
  "sts_token": "stsToken"
}
  • RamRoleArn
{
  "mode": "RamRoleArn",
  "access_key_id": "accessKeyId",
  "access_key_secret": "accessKeySecret",
  "ram_role_arn": "ramRoleArn",
  "ram_session_name": "ramSessionName"
}
  • EcsRamRole
{
    "mode": "EcsRamRole",
    "ram_role_name": "ramRoleName"
}

Example:

$ aliyun configure --mode External --profile externalTest
Configuring profile 'externalTest' in 'External' authenticate mode...
Process Command []: <getCredential ak>
Default Region Id []: cn-hangzhou
Default Output Format [json]: json (Only support json)
Default Language [zh|en] en: 
Saving profile[externalTest] ...Done.

Enable bash/zsh auto completion

  • Use aliyun auto-completion command to enable auto completion in zsh/bash
  • Use aliyun auto-completion --uninstall command to disable auto completion.

Use Alibaba Cloud CLI

Here is the basic usage guidelines. If you need a detailed manual, please visit Use Alibaba Cloud CLI

The Alibaba Cloud OpenAPI has two styles, RPC style and RESTful style. Most of the Alibaba Cloud products use the RPC style. The way of calling an API varies depending on the API style.

You can distinguish the API style from the following characteristics:

  • The API requiring the Action parameter is the RPC style, while the API requiring the PathPattern parameter is the RESTful style.
  • In general, the API style for a product is consistent.
  • Each API only supports one style. If an incorrect calling method is used, another API may be called or an error ApiNotFound is returned.

Call RPC APIs

The following statement shows how to call RPC APIs in the Alibaba Cloud CLI:

aliyun <product> <operation> --parameter1 value1 --parameter2 value2 ...

Examples:

aliyun rds DescribeDBInstances --PageSize 50
aliyun ecs DescribeRegions
aliyun rds DescribeDBInstanceAttribute --DBInstanceId xxxxxx

Call RESTful APIs

APIs of some products such as Container Service are RESTful style. The way to call RESTful APIs is different from RPC APIs.

The following examples show how to call RESTful APIs in the Alibaba Cloud CLI:

  • GET request:

    aliyun cs GET /clusters
    
  • POST request:

    aliyun cs POST /clusters --body "$(cat input.json)"
    
  • DELETE request:

    aliyun cs DELETE /clusters/ce2cdc26227e09c864d0ca0b2d5671a07
    

Get help information

Alibaba Cloud CLI integrates API descriptions for some products, you can get help by using the following commands:

  • aliyun help: get product list

  • aliyun help <product>: get the API information of a specific product

    For example, get help of ECS APIs: $ aliyun help ecs

  • $ aliyun help <product> <apiName>: get the detailed API information of a specific APU

    For example, get the help information of the CreateInstance API: aliyun help ecs CreateInstance

Use the --force option

Alibaba Cloud CLI integrates the product metadata of some products. It will validate API parameters when calling the API. If an API or a parameter that is not included in the metadata is used, an error unknown api or unknown parameter will be returned. You can use the --force option to skip the validation and call the API by force as shown in the following example:

aliyun newproduct --version 2018-01-01 --endpoint newproduct.aliyuncs.com --param1 ... --force

The following two options are required when using the --force option:

  • --version: the API version. You can find the API version in the API documentation. For example, the ECS API version is 2014-05-26.
  • --endpoint: the product endpoint. Get the product endpoint in the corresponding API documentation.

Special argument

When you input some argument like "-PortRange -1/-1", will cause parse error.In this case, you could assign value like this: --PortRange=-1/-1.

Getting Help

We use GitHub issues to track bugs and feature requests for user feedback. Please visit the following site for assistance:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].