Metadata-Version: 2.1
Name: cyfendo
Version: 2.0.0
Summary: Lightweight CLI scanner and sovereign BYOM engine for the Cyfendo Autonomous Security Platform
Author: Cyfendo Security Team
Author-email: Cyfendo Security Team <contact@cyfendo.com>
License: MIT
Project-URL: Homepage, https://cyfendo.com
Project-URL: Documentation, https://cyfendo.com/docs
Project-URL: Developer Settings, https://cyfendo.com/settings/developer
Keywords: security,sast,vulnerability-scanner,appsec,cyfendo,patching,byom
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
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: Operating System :: OS Independent
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: certifi>=2024.0.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: google-genai>=0.1.1
Requires-Dist: openai>=1.0.0
Requires-Dist: anthropic>=0.18.0
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.18.0; extra == "anthropic"
Provides-Extra: byom
Requires-Dist: google-genai>=0.1.1; extra == "byom"
Requires-Dist: openai>=1.0.0; extra == "byom"
Requires-Dist: anthropic>=0.18.0; extra == "byom"
Provides-Extra: gemini
Requires-Dist: google-genai>=0.1.1; extra == "gemini"
Provides-Extra: openai
Requires-Dist: openai>=1.0.0; extra == "openai"

# Cyfendo CLI

> **Lightweight, zero-dependency command-line interface for the Cyfendo Autonomous Security Platform.**

---

## 🚀 Installation

### Option A: Standalone One-Line Installer (macOS & Linux)
```bash
curl -sSL https://app.cyfendo.com/install.sh | bash
```

### Option B: Python Package Manager (PyPI)
```bash
# Global installation via pip or isolated via pipx
pip install cyfendo
# or
pipx install cyfendo
```

### Option C: Standalone Binary Direct Download
Download directly from [https://app.cyfendo.com/downloads/cyfendo](https://app.cyfendo.com/downloads/cyfendo) (view SHA-256 hashes at [checksums.txt](https://app.cyfendo.com/downloads/checksums.txt)).

---

## ⚡ Quick Start

```bash
# 1. Authenticate with your Cyfendo API Key
cyfendo login --key cy_live_xxxxxxxxxxxxxxxx

# 2. Run a vulnerability scan in the current directory
cyfendo scan .

# 3. Target an existing protected project in your workspace
cyfendo scan . --project "payment-gateway"

# 4. View and export individual AI remediation patches into .cyfendo/patches/
cyfendo patches
cyfendo patch fnd_8b22 --show
cyfendo patch fnd_8b22 --apply

# 5. CI/CD automation with SARIF export and threshold quality gate
cyfendo scan . --fail-on=high --sarif=results.sarif --no-interactive
```

---

## 🧪 Local Development & Testing

The Cyfendo CLI is built strictly with the Python standard library (`urllib`, `zipfile`, `argparse`) to ensure zero third-party dependency conflicts.

```bash
# Install CLI in editable mode for local testing
pip install -e ./cli

# Run the CLI test suite
python3 -m unittest discover -s cli/tests -p "test_*.py" -v
```

---

## 📦 Creating & Distributing New CLI Releases

Whenever you make code updates or improvements to the CLI in `cli/cyfendo/`, follow these steps to build and distribute new versions across all channels:

### 1. Bump the Version Number
Update the version in the following two files:
- [`cli/cyfendo/__init__.py`](file:///Users/bryanvuong/Library/CloudStorage/GoogleDrive-vuongbaquy@gmail.com/Other%20computers/My%20MacBook%20Air/Documents/Cyfendo/cli/cyfendo/__init__.py): `__version__ = "2.0.1"`
- [`cli/pyproject.toml`](file:///Users/bryanvuong/Library/CloudStorage/GoogleDrive-vuongbaquy@gmail.com/Other%20computers/My%20MacBook%20Air/Documents/Cyfendo/cli/pyproject.toml): `version = "2.0.1"`

---

### 2. Build Binaries & Update Website Downloads
Run the automated distribution script from repository root:

```bash
./cli/scripts/distribute.sh
```

This command automatically:
1. Executes the test suite (`python3 -m unittest discover cli/tests`).
2. Compiles a compressed standalone executable (`cyfendo`) with shebang `#!/usr/bin/env python3`.
3. Copies standalone executables and binary wheels into `website/static/downloads/`.
4. Computes updated SHA-256 hashes in `website/static/downloads/checksums.txt`.

---

### 3. Publish Release to PyPI (`pypi.org`)

To release the new version directly to PyPI:

```bash
./cli/scripts/distribute.sh --publish-pypi
```

#### PyPI Credentials Configuration
The script looks for PyPI credentials in any of the following locations:
- `cli/.pypirc` (Recommended, automatically git-ignored):
  ```ini
  [distutils]
  index-servers =
      pypi

  [pypi]
  username = __token__
  password = pypi-AgEI...
  ```
- Environment variables:
  ```bash
  export TWINE_USERNAME="__token__"
  export TWINE_PASSWORD="pypi-AgEI..."
  ```
- Interactive prompt: `twine` will prompt for credentials if not configured.

---

### 4. Deploy Website to Cloud Run
To update the downloadable standalone binaries and `install.sh` script on `https://cyfendo.com`:

```bash
./infra/scripts/deploy_cloud_run.sh
```

This redeploys the container with the newly generated static assets in `website/static/downloads/`.
