Skip to main content

A command-line interface tool for managing HostSpace Cloud services

Project description

HostSpace CLI

A command-line interface tool for managing HostSpace Cloud services, including Kubernetes (HKE), Containers (HCS), and Database (HDS) services.

Overview

HostSpace CLI provides a unified interface to manage your cloud resources across multiple infrastructure providers. It simplifies the management of:

  • HostSpace Kubernetes Engine (HKE)
  • HostSpace Container Service (HCS)
  • HostSpace Database Service (HDS)

Architecture

graph TD
    CLI[HostSpace CLI] --> Auth[Authentication Module]
    CLI --> Config[Configuration Manager]
    
    Auth --> API[HostSpace API Client]
    Config --> API
    
    API --> HKE[HKE Service]
    API --> HCS[HCS Service]
    API --> HDS[HDS Service]
    
    HKE --> Providers[Infrastructure Providers]
    HCS --> Providers
    HDS --> Providers
    
    Providers --> Contabo[Contabo]
    Providers --> Nobus[Nobus]
    Providers --> DO[Digital Ocean]
    Providers --> GCP[Google Cloud]
    Providers --> AWS[AWS]
    Providers --> Others[Other Providers]

Key Components

  1. CLI Core

    • Command parser and router
    • Error handling and logging
    • Output formatting (JSON, YAML, Table)
  2. Authentication Module

    • Token-based authentication
    • API key management
    • Session handling
  3. Configuration Manager

    • User preferences
    • Provider configurations
    • Environment management
  4. Service Modules

    • HKE module for Kubernetes operations
    • HCS module for container management
    • HDS module for database operations

Installation

Quick Installation (Recommended)

# Install from Git repository
pip install git+https://github.com/hostspace/hostspace-cli.git

Development Installation

# Clone the repository
git clone https://github.com/hostspace/hostspace-cli.git
cd hostspace-cli

# Install development dependencies
pip install -e ".[dev]"

After installation, verify that the CLI is working:

# Check available commands
hs --help

# Set up your environment (default is production)
hs env show

# Switch to development environment if needed
hs env set development

# Login with your API key
hs auth login

Environment Management

The CLI supports both production and development environments. You can switch between them using:

# Show current environment
hs env show

# Switch to development environment
hs env set development

# Switch to production environment
hs env set production

Environment Configuration

  • Production: Uses https://api.hostspace.cloud
  • Development: Uses https://aether-api-dev.hostspacecloud.com

Basic Usage

# Authentication
hs auth login
hs auth logout
hs auth status

# Kubernetes (HKE) Operations
hs hke cluster list
hs hke cluster create
hs hke cluster delete <cluster-id>
hs hke node-pool add <cluster-id>

# Container Service (HCS) Operations
hs hcs app list
hs hcs app deploy
hs hcs app logs <app-id>
hs hcs app delete <app-id>

# Database Service (HDS) Operations
hs hds instance list
hs hds instance create
hs hds backup create <instance-id>
hs hds backup list <instance-id>

Configuration

The CLI uses a configuration file located at ~/.hostspace/config.yaml:

auth:
  api_key: "your-api-key"
  endpoint: "https://api.hostspace.cloud"

providers:
  default: "contabo"
  regions:
    - name: "us-east"
      provider: "digital-ocean"
    - name: "eu-central"
      provider: "contabo"

output:
  format: "table"  # or json, yaml
  color: true

Development Guide

Project Structure

hostspace-cli/
├── README.md
├── setup.py
├── requirements/
│   ├── prod.txt         # Production dependencies
│   └── dev.txt          # Development dependencies
├── hostspace/
│   ├── __init__.py
│   ├── cli.py
│   ├── env_commands.py  # Environment management
│   ├── auth/
│   │   ├── __init__.py
│   │   └── commands.py
│   ├── hke/
│   │   ├── __init__.py
│   │   └── commands.py
│   ├── hcs/
│   │   ├── __init__.py
│   │   └── commands.py
│   ├── hds/
│   │   ├── __init__.py
│   │   └── commands.py
│   └── utils/
│       ├── __init__.py
│       ├── config.py
│       └── api.py
└── tests/
    └── ...

Getting Started with Development

  1. Clone the repository:
git clone https://github.com/hostspace/hostspace-cli.git
cd hostspace-cli
  1. Install development dependencies:
pip install -e ".[dev]"
  1. Run tests:
pytest
  1. Format code:
black .
isort .

Contributing

We welcome contributions! Please see our Contributing Guide for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hostspace_cli-0.1.0.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hostspace_cli-0.1.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file hostspace_cli-0.1.0.tar.gz.

File metadata

  • Download URL: hostspace_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for hostspace_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 36769a9d10fb17543a9fc3f48bce0466ecd85a87a8e41f460be9812058a1974d
MD5 af60a0e7c1a1883baebc1ff73480a4dc
BLAKE2b-256 8572b91d5583907cc883b0935dcadf3177a13d1a7957445b1b60cbc583dc5725

See more details on using hashes here.

File details

Details for the file hostspace_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: hostspace_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for hostspace_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 89474b9116a8c51be785298df0a35ef3ef0bee5e528992d7c013dd8541825ead
MD5 fec025889957b095cb936358fe6237ff
BLAKE2b-256 7fd1d16b9814ecd4fe379cb2b96c7f2a38864596ebece0a7103016d2074267da

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page