# Invoicer CLI

This command-line tool is used to generate invoices based on GitHub issues.

## Configuration

To use the Invoicer CLI, you first need to create a configuration file. This file contains all the necessary information to generate an invoice, such as creditor and debtor details, the repositories to scan for issues, and the hourly rate.

To generate the configuration file, run the following command:

```bash
go run . config <output_file_path>
```

This will start an interactive prompt that will guide you through creating the configuration file. The generated file will be saved to the specified output path.

### Configuration Options

The interactive prompt will ask for the following information:

- **Repositories**: A list of Gitea repositories to scan for issues (e.g., `owner/repo`).
- **Creditor Information**:
  - Name (first & last name or company)
  - Contact (if for a company: contact person)
  - Address (Country, City, Postcode, Street, House Number)
  - IBAN
- **Debtor Information (Optional)**:
  - Name (first & last name or company)
  - Contact (if for a company: contact person)
  - Address (Country, City, Postcode, Street, House Number)
  - Email Address
- **Duration Threshold**: The minimum duration for an issue to be billed.
- **Hourly Rate**: The price per hour in your currency.

## Creating an Invoice

You are able to generate invoices using the configuration file created with the `config` command.

To create an invoice, run the following command:

```bash
go run . create <path_to_config_file>
```

This will generate a PDF invoice based on the information in the configuration file. The invoice will be saved to the current directory.

### Sending an Invoice by Email

To send the invoice by email, you can use the `--email` flag:

```bash
go run . create <path_to_config_file> --email
```

This will send the invoice to the debtor's email address specified in the configuration file.
