Metadata-Version: 2.1
Name: ttb-cli
Version: 0.8
Requires-Python: ~=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Requests==2.32.3
Requires-Dist: pyppeteer~=2.0.0
Requires-Dist: click==8.1.7
Requires-Dist: PyYAML==6.0.2
Requires-Dist: tqdm~=4.66.5

# TToolbox CLI
[![Release](https://github.com/medicm/ttb/actions/workflows/release.yml/badge.svg?event=release)](https://github.com/medicm/ttb/actions/workflows/release.yml)

This is a CLI tool for managing scripts and other tools for performance metrics and other automated tasks.

## Installation

```bash
pip install ttb-cli
```

## Usage

### Config file

Create a `.tt.config.yml` file in your home directory with the following structure:
```yaml
chrome_executable_path: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
max_browser_instances: 5
tmp_dir: /Users/marko/.tmp
```

Running commands:
```bash
ttb <command> <arguments>
```

Aliases:
- `ttb`
- `tammtoolbox`

## Commands

### `performance`

Run performance metrics for given URLs.

```bash
ttb performance <arguments>
```

Arguments:
- `--url`: List of URLs to test (required, can be specified multiple times)
- `--output`: Output file for performance metrics (required)
- `--iterations`: Number of iterations per URL (default: 10)
- `--headless`: Run headless browser (optional flag)
- `--concurrent`: Run tests concurrently (optional flag)
- `--headers_file`: File containing headers to be used in the request (optional)
- `--cookies_file`: File containing cookies to be used in the request (optional)

Example:
```bash
ttb performance --url https://tamm.abudhabi --url https://doh.gov.ae --iterations 5 --output metrics_report.csv --headless --concurrent
```

### `lighthouse`
Prerequisites: `npm install -g lighthouse`

Run Lighthouse report for given URLs.

```bash
ttb lighthouse <arguments>
```

Arguments:
- `--url`: List of URLs to test (required, can be specified multiple times)
- `--output`: Output file for Lighthouse report (required)
- `--headless`: Run headless browser (optional flag)
- `--concurrent`: Run tests concurrently (optional flag)
- `--preset`: Lighthouse preset (desktop or mobile, default: desktop)
- `--headers_file`: File containing headers to be used in the request (optional)
- `--cookies_file`: File containing cookies to be used in the request (optional)

Example:
```bash
ttb lighthouse --url https://tamm.abudhabi --url https://www.tamm.abudhabi/en/contact --output lighthouse_report.csv --headless --concurrent --preset mobile
```

These commands allow you to run performance metrics and Lighthouse reports on specified URLs, with options for headless browsing, concurrent execution, and customizable settings.
