cli

command module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2025 License: MIT Imports: 1 Imported by: 0

README

Equinix CLI

equinix is the command line interface (CLI) for interacting with Equinix resources and services.

Installation

Install from GitHub Releases

Equinix CLI releases contain precompiled binaries for a variety of operating systems and architectures.

  1. Download the appropriate zip archive for your platform from the desired Equinix CLI release
  2. Run unzip <zip file name> to expand the zip archive you downloaded
  3. You can run the command immediately as ./equinix or, if you prefer, cp equinix <directory> where <directory> is a location on your local filesystem that is already included in your PATH.
Install with Homebrew

If you prefer, you can also install equinix with Homebrew by running the following commands:

brew tap equinix/homebrew-tap
brew install equinix

Usage

The full CLI documentation can be found in the docs directory.

Dynamic Command Registration

The CLI uses reflection to automatically register commands from the Equinix SDK. This approach:

  • Automatically discovers all API services in the SDK client
  • Generates commands for each service and method at build time
  • Reduces maintenance - new SDK services are automatically available
  • Ensures consistency - command structure mirrors the SDK structure

Development

Adding New Services

To onboard a new Equinix service (e.g., fabricv5), use the onboard target:

make onboard SERVICE=fabricv5

This will scaffold:

  • cmd/<service>.go - Command registration
  • internal/api/<service>.go - API client setup
  • cmd/descriptions/<service>.json - Field descriptions to embed for help

After scaffolding, you'll need to:

  1. Review and adjust the generated files
  2. Ensure the SDK package exists in github.com/equinix/equinix-sdk-go/services/<service>
  3. Run make build to verify the integration
Building
make build
Linting
make lint
Generating Documentation
make docs

Documentation

Overview

Copyright © 2025 Equinix

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Directories

Path Synopsis
cmd
extract-descriptions command
Package main provides a CLI tool to extract SDK descriptions
Package main provides a CLI tool to extract SDK descriptions
internal
api
Package api provides a set of Equinix API clients that can be used to make arbitrary requests to Equinix APIs.
Package api provides a set of Equinix API clients that can be used to make arbitrary requests to Equinix APIs.
parser
Package parser provides utilities for extracting SDK documentation from Go source files using go/ast, go/parser, and go/token.
Package parser provides utilities for extracting SDK documentation from Go source files using go/ast, go/parser, and go/token.
register
Package register provides utilities for dynamically registering Cobra commands based on API client structs using reflection.
Package register provides utilities for dynamically registering Cobra commands based on API client structs using reflection.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL