https://github.com/georgepstaylor/spotctl
A cli tool for managing rackspace spot cloudspaces
https://github.com/georgepstaylor/spotctl
cli golang rackspace
Last synced: 9 months ago
JSON representation
A cli tool for managing rackspace spot cloudspaces
- Host: GitHub
- URL: https://github.com/georgepstaylor/spotctl
- Owner: georgepstaylor
- License: mit
- Created: 2025-05-28T20:29:39.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-15T13:14:07.000Z (11 months ago)
- Last Synced: 2025-07-16T05:53:07.758Z (11 months ago)
- Topics: cli, golang, rackspace
- Language: Go
- Homepage:
- Size: 5.69 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🚀 spotctl
A CLI for managing Rackspace Spot resources.
## 📦 Installation
### Quick Start
```bash
go install github.com/georgetaylor/spotctl@latest
```
### From Source
```bash
git clone https://github.com/georgetaylor/spotctl.git
cd spotctl
make build
```
## 🔧 Configuration
### 1. Get Your Token
1. Visit [Rackspace Spot Console](https://spot.rackspace.com) 🌐
2. Go to **API Access > Terraform**
3. Click **Get New Token**
4. Copy your refresh token
### 2. Configure spotctl
```bash
# Interactive setup (recommended)
spotctl config init
# Or set values directly
spotctl config set refresh-token your-token-here
```
#### Alternative Methods
```bash
# Environment variables
export SPOTCTL_REFRESH_TOKEN=your-token
# Command flags
spotctl --refresh-token your-token regions list
```
#### ~/.spot/config.yaml
You can manually configure this file (rather than using `spotctl config` to create it).
See [example](config.example.yaml).
## 🎮 Usage
### Command examples
```bash
# List available regions
spotctl regions list
# List your organizations
spotctl organizations list
# List server classes with details
spotctl serverclasses list --details
# Get specific server class info
spotctl serverclasses get
# List cloudspaces in a namespace
spotctl cloudspaces list my-namespace
```
### Output Formats
```bash
# Default table view
spotctl regions list
# Detailed view with extra columns
spotctl regions list -o wide
# JSON output for automation
spotctl regions list --output json
# YAML for configuration
spotctl regions list --output yaml
```
### Global Options
| Flag | Description |
| -------------- | ---------------------------------------------- |
| `--output, -o` | Output format: `table`, `wide`, `json`, `yaml` |
| `--no-pager` | Disable automatic paging |
| `--debug` | Enable debug output |
## 🛠️ Development
### Prerequisites
- Go 1.24+
- Make
### Commands
```bash
make build # Build binary
make test # Run tests
make dev # Format, lint, test, build
```
## 📁 Project Structure
```
spotctl/
├── cmd/ # CLI commands
│ ├── # eg region, cloudspace
├── pkg/ # Public packages
│ ├── client/ # API client
│ ├── config/ # Configuration
│ ├── output/ # Formatters
│ └── pager/ # Output paging
├── internal/ # Private utilities
└── main.go # Entry point
```
## 🤝 Contributing
1. Fork the repo
2. Create a feature branch
3. Make your changes
4. Run `make dev`
5. Submit a PR
## 📄 License
MIT License - see [LICENSE](LICENSE) for details.