-
Notifications
You must be signed in to change notification settings - Fork 0
Development Setup
The following guide outlines to the process for setting up the Linode CLI for development.
The Linode CLI repository can be cloned locally using the following command:
git clone [email protected]:linode/linode-cli.gitIf you do not have an SSH key configured, you can alternatively use the following command:
git clone https://github.com/linode/linode-cli.gitA virtual env allows you to create virtual Python environment which can prevent potential Python dependency conflicts.
To create a VirtualEnv, run the following:
python3 -m venv .venvTo enter the VirtualEnv, run the following command (NOTE: This needs to be run every time you open your shell):
source .venv/bin/activateAll Linode CLI Python requirements can be installed by running the following command:
make requirementsThe Linode CLI can be built and installed using the make install target:
make installAlternatively you can build but not install the CLI using the make build target:
make buildOptionally you can validate that you have installed a local version of the CLI using the linode-cli --version command:
linode-cli --version
# Output:
# linode-cli 0.0.0
# Built from spec version 4.173.0
#
# The 0.0.0 implies this is a locally built version of the CLIIn some cases, you may want to build the CLI using a custom or modified OpenAPI specification.
This can be achieved using the SPEC Makefile argument, for example:
# Download the OpenAPI spec
curl -o openapi.yaml https://raw.githubusercontent.com/linode/linode-api-docs/development/openapi.yaml
# Many arbitrary changes to the spec
# Build & install the CLI using the modified spec
make SPEC=$PWD/openapi.yaml installTo continue to the next step of this guide, continue to the Testing page.