CLI - Get Started
The Linode CLI is a wrapper around the Linode API that allows you to manage your Linode account from the command line. Virtually any task that can be done through the Linode Manager can be done through the CLI, making it an excellent tool for scripting.
This guide describes the basics of installing and working with the CLI. It also offers examples illustrating how to complete common tasks using the CLI.
Install the CLI
The easiest way to install the CLI is through Pip:
Install the CLI:
pip3 install linode-cli --upgrade
You need a Personal Access Token to use the CLI. Use the Linode Cloud Manager to obtain a token.
linode-cli configure --tokencommand, you will be prompted with the CLI’s configuration script. Paste your access token (which will then be used by default for all requests made through the CLI) at the prompt. You will be prompted to choose defaults for Linodes created through the CLI (region, type, and image). These are optional, and can be overridden for individual commands. Update these defaults at any time by running
Welcome to the Linode CLI. This will walk you through some initial setup. First, we need a Personal Access Token. To get one, please visit https://cloud.linode.com/profile/tokens and click "Create a Personal Access Token". The CLI needs access to everything on your account to work correctly. Personal Access Token:
NoteThe CLI installs a bash completion file. On OSX, you may have to source this file before it can be used. To do this, add
source /etc/bash_completion.d/linode-cli.shto your
View information about any part of the CLI, including available actions and required parameters, with the
linode-cli --help linode-cli linodes --help linode-cli linodes create --help
Customize Output Fields
By default, the CLI displays a set of pre-selected fields for each type of response. If you would like to see all available fields, use the
linode-cli linodes list --all
Specify exactly which fields you would like to receive with the
linode-cli linodes list --format 'id,region,memory'
The CLI returns output in tabulated format for easy readability. If you prefer to work with JSON, use the
--json flag. Adding the
--pretty flag formats the JSON output to make it more readable:
linode-cli regions list --json --pretty
Machine Readable Output
You can also display the output as plain text. By default, tabs are used as a delimiter, but you can specify another character with the
linode-cli regions list --text
linode-cli regions list --text --delimiter ";"
This page was originally published on