## learn-vm-scripts frontend repo

### Installation

1. Clone the repository:

   ```sh
   git clone https://github.com/your-repo/puppeteer-cli-login.git
   cd puppeteer-cli-login
   ```

2. Use corret Node version

   ```sh
   nvm use
   ```

3. Install dependencies

   ```sh
   yarn install
   ```

## Usage

This project contains a program that logs in to a cloud provider using Puppeteer.

To build:

```sh
yarn build
```

To start the file watcher:

```sh
yarn cli -- --inputFilePath <path-to-input-file> --outputFilePath <path-to-output-file> --executablePath <path-to-chromium-executable> --userDataDir <path-to-user-data-dir>
```

The program watches the input file for changes.
To log in to a cloud provider, write the following JSON object to the input file:

```json
{ "url": "<url-to-login-page>", "username": "<your-username>", "password": "<your-password>", "cloudProvider": "<cloud-provider>"}
```

❗️The input has to be written to a single line.
When the login process is complete, the program writes a line to the output file.
After this, the program exits.
