This article follows the official documentation. We haven’t tested this tool for a hands-on review.
A coding agent with shell access to a Linode account can use the Linode CLI to inspect and manage cloud resources. The CLI is a command-line program that sends requests to Linode’s cloud API. Its --json option returns structured data that an agent can read and summarize.
For a low-risk starting task, have the agent list existing Linode instances and report their labels, regions, and statuses. Listing is a read-only request; creating or changing a resource is a separate action. The commands below come from Akamai’s CLI documentation and the CLI’s README. They were not run for this article.
Install and authenticate
The project’s README recommends installing the CLI with pipx, a tool that puts each Python program in its own environment:
pipx install linode-cli
Akamai’s getting-started guide also lists pip3 install linode-cli --upgrade. The README says pipx also works on systems where pip install fails because the system Python is marked as externally managed.
Then configure the CLI with a token you create yourself:
linode-cli configure --token
Running linode-cli configure without --token opens a sign-in in your web browser. With --token, the CLI asks for a personal access token. You create that token in Cloud Manager under API Tokens. For each product, you pick an access level from No Access up to Read Write. For an inventory task, give the token Read Only access to Linodes and no access to anything else. After the token step, the CLI asks for optional defaults such as a region. Keep the token in the CLI’s local configuration, outside the agent prompt and source files. Akamai also documents a LINODE_CLI_TOKEN environment variable for setups without prompts.
Install and configure the CLI on the machine that runs the agent. When the agent runs a cloud command, the CLI sends a request to Linode over the network. A token with write permissions allows commands to make changes, so use a read-only token for inspection tasks.
List instances as JSON
Run this command to request the account’s Linode instances:
linode-cli linodes list --json
The CLI contacts Linode and prints the returned instance records as JSON. The agent can read each instance’s label, region, and status directly from the JSON, without working through a table formatted for people. The command lists resources; it does not create or modify them.
A practical agent prompt is:
Run
linode-cli linodes list --json. Summarize each instance’s label, region, and status. Do not run commands that create, update, or delete Linode resources.
If the command fails, check that the agent’s shell environment has the CLI installed and that its local configuration has a valid token with permission to read Linodes. Do not paste the token into the prompt to resolve an authentication error.
Check commands and permissions
The commands an agent can run depend on the token’s permissions and on the API endpoints the CLI knows. According to its README, the CLI is generated from the OpenAPI specification of Linode’s API, so its commands follow the API’s endpoints. Akamai’s instance commands page points to linode-cli linodes --help for the full list of instance actions. Adding --help after an action shows its options and which fields you can filter on.
The current source code is in the linode/linode-cli repository, which is active. An older repository named linode/cli is archived and describes itself as the deprecated Linode CLI. Use the linode-cli package and Akamai’s current documentation when you build new automation.