Metadata-Version: 2.1
Name: dtaas-cli
Version: 0.1.5
Summary: DTaaS CLI
License: INTO-CPS-Association
Author: Astitva Sehgal
Requires-Python: >=3.7,<4.0
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: PyYAML (>=6.0.1,<7.0.0)
Requires-Dist: click (>=8.1.7,<9.0.0)
Requires-Dist: tomlkit (>=0.12.4,<0.13.0)
Description-Content-Type: text/markdown

# DTaaS Command Line Interface

This is a command line tool for the INTO-CPS-Association Digital Twins as a Service. 

## Prerequisite

Please visit and download the [DTaaS Software](https://github.com/INTO-CPS-Association/DTaaS). 

The DTaaS service with base users and essential containers should be up and running before using the CLI.


## Installation

Simply install using:

We recommend installing this in a virutal environment.

Steps to install:

- Change the working folder:

```bash
cd <DTaaS-directory>/cli
```

- Recommended (for windows) to install this in a virtual environment

```bash
python -m venv env
env\Scripts\activate
```

- To install, simply:

```bash
pip install dtaas-cli
```

## Usage

### Setup

Setup the _dtaas.toml_ file in the _cli_ directory,
edit the fields appropriately.

### Add users

To add new users using the CLI, fill in the _users.add_ list in
_dtaas.toml_ with the Gitlab instance usernames of the users to be added

Then simply:

```bash
dtaas admin user add
```

### Delete users

To delete existing users, fill in the _users.delete_ list in
_dtaas_.toml_ with the Gitlab instance usernames of the users to be deleted.

Then simply:

```bash
dtaas admin user delete
```

### Additional Points to Remember

- The base DTaaS system should be up and running before adding/deleting users with the CLI

- The _user add_ CLI will add and start a container for a new user.
  It can also start a container for an existing user if that container was somehow stopped.
  It shows a _Running_ status for existing user containers that are already up and running,
  it doesn't restart them.

- Configure the _server-dns_ in the _dtaas.toml_ file with the domain name of your server.
  If you want to bring up the server locally, please set this to _"localhost"_.

- _user add_ and _user delete_ CLIs return an error if the _add_ and _delete_ lists in
  _dtaas.toml_ are empty, respectively.

- Currently the _email_ fields for each user in dtaas.toml are not in use, and are not necessary
  to fill in. These emails must be configured manually for each user in the docker/
