https://github.com/cloudforet-io/spacectl
Command Line Interface
https://github.com/cloudforet-io/spacectl
cli spacectl tools
Last synced: 9 months ago
JSON representation
Command Line Interface
- Host: GitHub
- URL: https://github.com/cloudforet-io/spacectl
- Owner: cloudforet-io
- License: apache-2.0
- Created: 2022-09-05T01:16:58.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-02-28T08:50:38.000Z (10 months ago)
- Last Synced: 2025-03-26T07:04:27.644Z (9 months ago)
- Topics: cli, spacectl, tools
- Language: Python
- Homepage:
- Size: 420 KB
- Stars: 12
- Watchers: 4
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
spacectl
# Getting Started with spacectl
The SpaceONE command-line tool, spacectl, allows you to run commands against resources managed by SpaceONE.
API Reference: https://cloudforet.gitbook.io/cloudforet-apis
# Install and Set Up spacectl
Install the latest release with the command from PyPI using pip:
```commandline
sudo pip install --upgrade pip
sudo pip install spacectl
```
There are a few variants on getting helps.
A list of global options and supported commands are available with --help:
```commandline
spacectl --help
```
## Accessing for the first time with spacectl:
The following commands run spacectl to set your own configurations and endpoints.
It handles setting the environments, authenticating and targets.
Run it like these:
- Set up spacectl configuration
```commandline
spacectl config init # input environment on shell
spacectl config set api_key
spacectl config endpoint add
```
- (OR) Import a configuration file which you downloaded at SpaceONE console
```commandline
spacectl config init -f
```
The looks like
```
api_key:
endpoints:
identity: grpc://identity:50051
inventory: grpc://inventory:50051
plugin: grpc://plugin:50051
repository: grpc://repository:50051
secret: grpc://secret:50051
...
```
if you want to see a sample configuration file, try [examples/configuration.yaml](examples/configuration.yaml).
### Discovering builtin services:
The following commands list all available spacectl APIs.
Run it like this:
```commandline
spacectl api-resources
```
# Examples
### Case 1: List Cloud Service Type with AWS:
```commandline
spacectl list inventory.CloudServiceType -p provider=aws
```
### Case 2: Create Project Group:
```commandline
spacectl exec create project_group -p name=
```
### Case 2: List only 10 Cost data within AWS US-EAST-1 region:
```commandline
spacectl list cost_analysis.Cost -p provider=aws -p region_code=us-east-1 --limit 10
```
# Advanced Guides
## Command Details and Guides
- get: Show details of a specific resource
- [list](docs/list.md): Display one or many resources
- [apply](docs/apply.md): Get, list, create or update various resources and execute other tasks
- stat: Querying statistics for resources
- [exec](docs/exec.md): Execute a method to resource
- template: Manage resource templates
## Configuration Details
The following details are documented in [docs/configuration.md](docs/configuration.md)
- Config Concept
- Quick Start
- Manage Endpoints
- Switch the Environment