https://github.com/metal-stack/cli
metal-apiserver cli v2
https://github.com/metal-stack/cli
Last synced: 8 months ago
JSON representation
metal-apiserver cli v2
- Host: GitHub
- URL: https://github.com/metal-stack/cli
- Owner: metal-stack
- License: mit
- Created: 2025-03-08T08:54:42.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-05-07T06:08:40.000Z (8 months ago)
- Last Synced: 2025-05-07T12:56:13.464Z (8 months ago)
- Language: Go
- Size: 95.7 KB
- Stars: 0
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# metal-stack CLI V2
[](./docs/metalctlv2.md)

[](https://goreportcard.com/report/github.com/metal-stack/cli)
This is the official V2 CLI for accessing the API of [metal-stack.io](https://metal-stack.io).
***WORK IN PROGRESS, not compatible with current metal-api***
## Installation
Download locations:
- [metalctlv2-linux-amd64](https://github.com/metal-stack/cli/releases/latest/download/metalctlv2-linux-amd64)
- [metalctlv2-darwin-amd64](https://github.com/metal-stack/cli/releases/latest/download/metalctlv2-darwin-amd64)
- [metalctlv2-darwin-arm64](https://github.com/metal-stack/cli/releases/latest/download/metalctlv2-darwin-arm64)
- [metalctlv2-windows-amd64](https://github.com/metal-stack/cli/releases/latest/download/metalctlv2-windows-amd64)
### Installation on Linux
```bash
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:
```bash
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:
```bash
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
```bash
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:
```bash
metalctlv2 [] []
```
For example:
```bash
metalctlv2 tenant member list --api-token --api-url
metalctlv2 ctx add
```
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](mailto:support@metal-stack.io) 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](./docs/metal.md).
| Entity | Description | Documentation |
|---------------|------------------------------------------------------------|-------------------------------------------------------|
| `api-methods` | show available api-methods of the metal-stack.io api | [metal api-methods](./docs/metalctlv2_api-methods.md) |
| `completion` | generate the autocompletion script for the specified shell | [metal completion](./docs/metalctlv2_completion.md) |
| `context` | manage cli contexts | [metal context](./docs/metalctlv2_context.md) |
| `health` | print the client and server health information | [metal health](./docs/metalctlv2_health.md) |
| `ip` | manage ip entities | [metal ip](./docs/metalctlv2_ip.md) |
| `markdown` | create markdown documentation | [metal completion](./docs/metalctlv2_completion.md) |
| `project` | manage project entities | [metal project](./docs/metalctlv2_project.md) |
| `tenant` | manage tenant entities | [metal tenant](./docs/metalctlv2_tenant.md) |
| `token` | manage token entities | [metal token](./docs/metalctlv2_token.md) |
| `user` | manage user entities | [metal user](./docs/metalctlv2_user.md) |
| `version` | print the client and server version information | [metal version](./docs/metalctlv2_version.md) |
| `login` | login with oidc and write api-token to the configuration | [metal login](./docs/metalctlv2_login.md) |
### Autocompletion
To successfully set up autocompletion follow this [guide](./docs/metalctlv2_completion.md).
## Authentication and Configuration
To work with this CLI, it's necessary to create an api-token, this can be done with the login command.
```bash
$ 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.
```bash
$ metalctlv2 ctx add --activate --default-project --api-token
✔ added context ""
```
The configuration file is by default written to `~/.metal-stack/config.yaml`.