Metadata-Version: 2.4
Name: browsez-cli
Version: 0.1.0
Summary: CLI tool for publishing tools and UI modules to the BrowsEZ platform
Author: Bryan Abraham
License: MIT
Project-URL: Homepage, https://github.com/browsez/cli
Project-URL: Documentation, https://github.com/browsez/cli#readme
Project-URL: Repository, https://github.com/browsez/cli
Keywords: browsez,cli,tools,publishing
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Build Tools
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: click>=8.0.0
Requires-Dist: requests>=2.31.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: PyYAML>=6.0
Provides-Extra: dev
Requires-Dist: types-PyYAML; extra == "dev"
Requires-Dist: types-requests; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"

# BrowsEZ CLI

A command-line tool for publishing tools and UI modules to the BrowsEZ platform.

## Installation

### From PyPI (when published)

```bash
pip install browsez-cli
```

### From Source (Development)

```bash
# Clone and install in editable mode
cd cli-mode
pip install -e .
```

## Quick Start

```bash
# Login to the platform
browsez login

# Validate a tool before publishing
browsez validate path/to/tool_directory

# Publish a tool
browsez publish path/to/tool_directory
```

## Commands

| Command | Description |
|---------|-------------|
| `browsez login` | Login to the BrowsEZ platform |
| `browsez logout` | Clear the current session |
| `browsez validate <dir>` | Validate a tool without uploading |
| `browsez publish <dir>` | Publish a tool to the backend |
| `browsez publish-ui <dir>` | Publish a UI module (coming soon) |
| `browsez config show` | Show current configuration |
| `browsez config set <key> <value>` | Set a config value |

## Configuration

The CLI uses a `.toolrc.json` file for configuration. It is auto-created on first run:

```json
{
  "api_base_url": "https://browsez-platform-backend-production.up.railway.app",
  "tenant_id": "sample-tenant-123",
  "default_risk_level": "MEDIUM",
  "upload_timeout": 300,
  "retry_attempts": 3
}
```

Override settings via CLI:

```bash
browsez config set api-url https://api.example.com
browsez config set risk-level HIGH
```

## Tool Directory Structure

A valid tool directory must have:

```
tool_name/
├── tool.yaml           # Metadata (name, inputs, outputs)
├── requirements.txt    # Python dependencies
└── src/
    ├── __init__.py
    └── main.py         # Entry point (run function, Input/Output classes)
```

## Development

```bash
# Install with dev dependencies
pip install -e ".[dev]"

# Build the package
python -m build

# Upload to PyPI (requires twine and credentials)
twine upload dist/*
```

## Features

- **Strict Schema Validation**: Ensures tools meet all requirements before packaging
- **Deterministic Packaging**: Creates consistent zip files with content-based hashing (SHA-256)
- **Secure Uploads**: Uses pre-signed S3 URLs for artifacts
- **Configurable**: Supports configuration via file, CLI arguments, and defaults
- **Resilient**: Implements retry logic and exponential backoff for network operations
