THipster-cli¶
THipster CLI¶
CLI tool to interact and use THipster, build with Typer.
THipster is a tool dedicated to simplifying the ordeal associated with writing Terraform files. It allows users to write infrastructure as code in a simplified format, using either YAML (with JINJA) or the dedicated Thipster DSL.
Written entirely in Python, it leverages the Python CDK for Terraform to create Terraform files and apply them to the chosen provider.
Technology Stack¶
Written in Python 3.11, thipster-cli is build using Typer.
Project Status¶
THipster-cli is currently in an active development state. If you want to know more, please check the CHANGELOG for more details.
Dependencies¶
To use the CLI, you will need to have all the required THipster dependencies installed on your machine. Please refer to the THipster documentation for more details.
Installation¶
The project is designed to be simply installed using pip.
pip install thipstercli
The list of available versions can be found on PyPI.
Configuration¶
The CLI can be configured using a configuration file. A default config.json file will be created in the /home/<user>/.config/thipstercli directory the first time the CLI is used.
Example of a configuration file:
{
"app_name": "thipstercli",
"auth_provider": "google",
"input_dir": ".",
"local_models_repository_path": "models",
"models_repository": "THipster/models",
"models_repository_branch": "main",
"models_repository_provider": "local",
"output_dir": ".",
"verbose": false
}
Usage¶
The cli is composed of 3 main commands:
version: display the current version of the package
thipster version -t
providers: subcommand group tp handle all tasks related to infrastructure providers
thipster providers --help
run: main command to execute the thipster tool
thipster run --help
You can also check the thipster package documentation for more details on the main features and purpose of the tool.
How to test the software¶
To test the CLI, you can run the following command:
pip install -e .[test]
pytest tests
Known issues¶
All known issues, bugs, improvements, etc. are tracked as GitHub issues.
Getting help¶
If you have questions, concerns, bug reports, etc, please file an issue in this repository’s Issue Tracker.
Getting involved¶
To install the project in development mode, run the following command:
pip install -e .[dev,test]
pre-commit install && pre-commit run --all-files
If you would like to be involved in the project feel free to check the CONTRIBUTING file. We will be happy to have you onboard.
Open source licensing info¶
Detailed Documentation¶
thipster¶
THipster CLI.
THipster is a tool that allows you to generate Terraform code from a simple DSL or yaml file.
Usage:
$ thipster [OPTIONS] COMMAND [ARGS]...
Options:
-v, --verbose: Prints more information about the execution of the THipster CLI--install-completion: Install completion for the current shell.--show-completion: Show completion for the current shell, to copy it or customize the installation.--help: Show this message and exit.
Commands:
config: Manage thipster config.info: Get info about resources.providers: Manage authentification providers.repository: Manage locally installed THipster…runversion: Print the version of the THipster CLI.
thipster config¶
Manage thipster config.
Usage:
$ thipster config [OPTIONS] COMMAND [ARGS]...
Options:
--help: Show this message and exit.
Commands:
get: Get value: name from config file.set: Set the value for a key in the…unset: Remove a variable from configuration file.
thipster config get¶
Get value: name from config file.
Usage:
$ thipster config get [OPTIONS] NAME
Arguments:
NAME: [required]
Options:
--help: Show this message and exit.
thipster config set¶
Set the value for a key in the configuration file.
Usage:
$ thipster config set [OPTIONS] NAME VALUE
Arguments:
NAME: [required]VALUE: [required]
Options:
--help: Show this message and exit.
thipster config unset¶
Remove a variable from configuration file.
Usage:
$ thipster config unset [OPTIONS] NAME
Arguments:
NAME: [required]
Options:
--help: Show this message and exit.
thipster info¶
Get info about resources.
Usage:
$ thipster info [OPTIONS] COMMAND [ARGS]...
Options:
-rl, --repository-local TEXT: Runs the THipster Tool using the given local model repository-ro, --repository-online TEXT: Runs the THipster Tool using the given model repository-rb, --repository-branch TEXT: Runs the THipster Tool using the given online model repository branch [default: main]--help: Show this message and exit.
Commands:
resource: Get info about a given resource.resources: List all the resources in repository.
thipster info resource¶
Get info about a given resource.
Usage:
$ thipster info resource [OPTIONS]
Options:
--resource TEXT--help: Show this message and exit.
thipster info resources¶
List all the resources in repository.
Usage:
$ thipster info resources [OPTIONS]
Options:
--help: Show this message and exit.
thipster providers¶
Manage authentification providers.
Usage:
$ thipster providers [OPTIONS] COMMAND [ARGS]...
Options:
--help: Show this message and exit.
Commands:
display: Display the current provider.info: Get information about a provider.list: List all the supported providers.set: Set the provider to use for the auth.
thipster providers display¶
Display the current provider.
Usage:
$ thipster providers display [OPTIONS]
Options:
--help: Show this message and exit.
thipster providers info¶
Get information about a provider.
Usage:
$ thipster providers info [OPTIONS] PROVIDER
Arguments:
PROVIDER: [required]
Options:
--help: Show this message and exit.
thipster providers list¶
List all the supported providers.
Usage:
$ thipster providers list [OPTIONS]
Options:
--help: Show this message and exit.
thipster providers set¶
Set the provider to use for the auth.
Usage:
$ thipster providers set [OPTIONS] PROVIDER
Arguments:
PROVIDER: [required]
Options:
--help: Show this message and exit.
thipster repository¶
Manage locally installed THipster repositories.
Usage:
$ thipster repository [OPTIONS] COMMAND [ARGS]...
Options:
--help: Show this message and exit.
Commands:
download: Download an online git repository as…list: List all the locally installed THipster…use: Set the repository to use.
thipster repository download¶
Download an online git repository as THipster repository.
Usage:
$ thipster repository download [OPTIONS] URL
Arguments:
URL: [required]
Options:
--help: Show this message and exit.
thipster repository list¶
List all the locally installed THipster repositories.
Usage:
$ thipster repository list [OPTIONS]
Options:
--help: Show this message and exit.
thipster repository use¶
Set the repository to use.
Usage:
$ thipster repository use [OPTIONS] REPOSITORY
Arguments:
REPOSITORY: [required]
Options:
--help: Show this message and exit.
thipster run¶
Usage:
$ thipster run [OPTIONS] [PATH]
Arguments:
[PATH]: Path to the file or directory to run [default: .]
Options:
-rl, --repository-local TEXT: Runs the THipster Tool using the given local model repository-ro, --repository-online TEXT: Runs the THipster Tool using the given model repository-rb, --repository-branch TEXT: Runs the THipster Tool using the given online model repository branch [default: main]-p, --provider TEXT: Runs the THipster Tool using the given provider-a, --apply: Applies the generated Terraform code--help: Show this message and exit.
thipster version¶
Print the version of the THipster CLI.
Usage:
$ thipster version [OPTIONS]
Options:
-t, --thipster: Prints the version of the THipster tool--help: Show this message and exit.