# Zygon

Zygon's frontend allows you to manage accounts from any application, on one platform. This package allows you to interact with the Zygon platform from your terminal.

## Installation

### Global

To install the latest version of the Zygon CLI globally, run this command:

```shell
npm i -g @zygon/cli
```

### Local to a folder

If you do want to install the command in a specific folder, use the following command:

```shell
npm i @zygon/cli
```

Please note that this will create an npm project within that folder (if there isn't already one), to track the installed version. You will also need to rely on `npx` to call the CLI (see the [No installation](#no-installation) section below)

### No installation

If you do not want to install the CLI permanently, you can skip the previous steps, and prefix all the following commands with `npx`. Note that you can specify a version like so:

```shell
npx zygon@0.9.0 <command>
```

The first time `npx` is run, a cache with the corresponding version will be created. This cache will be used on the next use of `npx`.

## Usage

### Email extraction

All commands for email extraction are available under this command:

```shell
zygon email
```

#### Exchange

To extract metadata from Exchange, run the following command:

```shell
zygon email exchange <input_pst_filename> <output_csv_file>
```

In PowerShell, you can extract a PST backup with the command New-MailboxExportRequest, check this link for more information:
https://learn.microsoft.com/fr-fr/powershell/module/exchange/new-mailboxexportrequest?view=exchange-ps

#### Gmail

To extract metadata from Gmail, run the following command:

```shell
zygon email gmail <key_file> <user_key>
```

#### Microsoft 365

To extract metadata from Microsoft 365, run the following command:

```shell
zygon email 365 <user_key>
```

### Upload

#### Emails

To upload the extracted emails, run the following command:

```shell
zygon email upload <input_csv_path>
```
