Skip to content

metal-stack/cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

metal-stack CLI V2

Markdown Docs Go Version Go Report Card

This is the official V2 CLI for accessing the API of metal-stack.io.

WORK IN PROGRESS, not compatible with current metal-api

Installation

Download locations:

Installation on Linux

curl -LO https://github.com/metal-stack/cli/releases/latest/download/metalctlv2-linux-amd64
chmod +x metalctlv2-linux-amd64
sudo mv metalctlv2-linux-amd64 /usr/local/bin/metalctlv2

Installation on MacOS

For x86 based Macs:

curl -LO https://github.com/metal-stack/cli/releases/latest/download/metalctlv2-darwin-amd64
chmod +x metalctlv2-darwin-amd64
sudo mv metalctlv2-darwin-amd64 /usr/local/bin/metalctlv2

For Apple Silicon (M1) based Macs:

curl -LO https://github.com/metal-stack/cli/releases/latest/download/metalctlv2-darwin-arm64
chmod +x metalctlv2-darwin-arm64
sudo mv metalctlv2-darwin-arm64 /usr/local/bin/metalctlv2

Installation on Windows

curl -LO https://github.com/metal-stack/cli/releases/latest/download/metalctlv2-windows-amd64
copy metalctlv2-windows-amd64 metalctlv2.exe

Usage

All commands follow a general form:

metalctlv2 <entity> [<category>] <command> <argument> [<flags>]

For example:

metalctlv2 tenant member list --api-token <your-token> --api-url <api-url>
metalctlv2 ctx add <context-name>

The api-token, api-url and project-id are defaulted by the context, if one exists, and can be omitted.

In addition to the standard API services, there are also admin services that require an admin token for execution.

You can access help for every service and command by using --help or -h. If you encounter any issues not covered in the help prompt, or if you have suggestions for improvement, please feel free to contact us or open an issue in this repository. Your feedback is greatly appreciated!

A list of all available services (excluding admin topics). For their associated commands, arguments and flags visit the correct documentation.

Entity Description Documentation
api-methods show available api-methods of the metal-stack.io api metal api-methods
completion generate the autocompletion script for the specified shell metal completion
context manage cli contexts metal context
health print the client and server health information metal health
ip manage ip entities metal ip
markdown create markdown documentation metal completion
project manage project entities metal project
tenant manage tenant entities metal tenant
token manage token entities metal token
user manage user entities metal user
version print the client and server version information metal version
login login with oidc and write api-token to the configuration metal login

Autocompletion

To successfully set up autocompletion follow this guide.

Authentication and Configuration

To work with this CLI, it's necessary to create an api-token, this can be done with the login command.

$ metalctlv2 login
Starting server at http://127.0.0.1:35287...
✔ login successful! Updated and activated context "local"

The project's ID can be copied from the UI, the button is located right next to the project title in the project dashboard. The default API-URL of metal-stack is https://api.metal-stack.io.

$ metalctlv2 ctx add <context-name> --activate --default-project <project-uuid> --api-token <your-token>
✔ added context "<context-name>"

The configuration file is by default written to ~/.metal-stack/config.yaml.

About

metal-apiserver cli v2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages