Metadata-Version: 2.4
Name: deployforge
Version: 0.1.0
Summary: From GitHub to a Live Application. Automatically. DeployForge analyzes an application and deploys its frontend and backend to production.
Author-email: sifuna codex <www.antonysifuna07@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/aasz253/DeployForge
Project-URL: Repository, https://github.com/aasz253/DeployForge
Project-URL: Documentation, https://github.com/aasz253/DeployForge#readme
Project-URL: Issues, https://github.com/aasz253/DeployForge/issues
Keywords: deploy,vercel,render,devsecops,cli,automation,github
Classifier: Development Status :: 3 - Alpha
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.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: System :: Installation/Setup
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typer<1.0,>=0.12
Requires-Dist: rich<15.0,>=13.7
Requires-Dist: requests<3.0,>=2.31
Requires-Dist: PyYAML<7.0,>=6.0
Requires-Dist: keyring<26.0,>=24.3
Requires-Dist: platformdirs<5.0,>=4.0
Provides-Extra: dev
Requires-Dist: pytest<9.0,>=8.0; extra == "dev"
Requires-Dist: pytest-cov<6.0,>=5.0; extra == "dev"
Requires-Dist: ruff<1.0,>=0.5; extra == "dev"
Requires-Dist: mypy<2.0,>=1.10; extra == "dev"
Requires-Dist: types-PyYAML>=6.0; extra == "dev"
Requires-Dist: bandit<2.0,>=1.7; extra == "dev"
Requires-Dist: build<2.0,>=1.2; extra == "dev"
Requires-Dist: twine<6.0,>=5.0; extra == "dev"
Dynamic: license-file

# DeployForge

**From GitHub to production. Automatically.**

DeployForge is the second stage of the PushForge → DeployForge workflow.
PushForge handles **Local → GitHub**, while DeployForge handles **GitHub → Production** (frontend → Vercel, backend → Render).

---

## Install

```bash
pip install deployforge
```

Or with [pipx](https://pypa.github.io/pipx/) (recommended):

```bash
pipx install deployforge
```

DeployForge is a single, cross-platform CLI — it works on Windows, macOS, and Linux.

---

## Quick Start

```bash
# 1. Push your code with PushForge
pushforge

# 2. Deploy with DeployForge
deployforge
```

DeployForge automatically:
1. Analyzes your project structure (Next.js, Vite, FastAPI, Express, Django…)
2. Creates a deployment plan (what goes to Vercel, what goes to Render)
3. Runs security preflight checks (scans for leaked secrets)
4. Deploys backend → Render, frontend → Vercel
5. Wires environment variables (`NEXT_PUBLIC_API_URL`, `FRONTEND_URL`, `CORS_ORIGIN`)
6. Sets up CORS on the backend
7. Verifies all deployments and prints live URLs

---

## Commands

| Command | Description |
|---------|-------------|
| `deployforge` | Full automated deployment (analyze → deploy → verify) |
| `deployforge init` | Create `.deployforge/config.yml` for a project |
| `deployforge analyze` | Analyze project structure and show deployment plan |
| `deployforge deploy` | Deploy directly (with flags `--dry-run`, `--debug`) |
| `deployforge status` | Show status of deployed services |
| `deployforge verify` | Verify all deployed URLs are reachable and healthy |
| `deployforge security` | Run security preflight scan |
| `deployforge doctor` | Diagnose environment and credentials |
| `deployforge config` | Show resolved configuration |
| `deployforge logs` | Show recent deployment history |
| `deployforge version` | Print version |

---

## Options

```
--dry-run              Show what DeployForge would do without making changes
--non-interactive      Skip confirmations (CI-friendly)
--skip-security        Disable the security preflight gate
--debug                Show debug detail for troubleshooting
--timeout INT          Deployment wait timeout in seconds (default: 900)
--plan TEXT            Render plan: free | starter | pro (default: starter)
```

---

## How It Works with PushForge

```
+-------------------+     +-------------------+     +-------------------+
|   Your Machine    |     |      GitHub       |     |    Production     |
|                   |     |                   |     |                   |
|  PushForge ───────┼────►│   Source Code     │     |  Vercel (frontend)│
|  Local → GitHub   │     |                   │     |  Render (backend) │
|                   |     │  DeployForge ─────┼────►│  Live URLs        │
+-------------------+     |  GitHub → Prod    |     +-------------------+
                          +-------------------+
```

**You don't need PushForge installed** to use DeployForge — it detects Git repositories automatically. But the two tools are designed to work together seamlessly.

---

## Authentication

DeployForge reads provider tokens from environment variables (in order):

| Provider | Environment Variables |
|----------|----------------------|
| Vercel | `DEPLOYFORGE_VERCEL_TOKEN`, `VERCEL_TOKEN` |
| Render | `DEPLOYFORGE_RENDER_API_KEY`, `RENDER_API_KEY` |

Tokens can also be stored securely in your OS keyring via:

```bash
deployforge config --set vercel_token
deployforge config --set render_api_key
```

> Credentials are **never** stored in project files or printed in logs. Only SHA-256 fingerprints are recorded.

---

## Configuration

DeployForge creates `.deployforge/config.yml` when you run `deployforge init`:

```yaml
frontend:
  provider: vercel
  directory: frontend

backend:
  provider: render
  runtime: python
  directory: backend
```

Environment variables from `.env` files are automatically wired:
- `NEXT_PUBLIC_API_URL` → set to the backend Render URL
- `FRONTEND_URL` → set to the frontend Vercel URL (on the backend)
- CORS is configured automatically

---

## Security

DeployForge runs a security preflight before deployment:
- Scans for API keys, tokens, passwords in tracked files
- Blocks deployment if high-entropy strings or credential patterns are found (configurable)
- Never transmits or stores secrets — only fingerprints them locally

Disable with `--skip-security` for trusted codebases.

---

## Development

```bash
# Clone and set up
git clone https://github.com/aasz253/DeployForge.git
cd DeployForge
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"

# Run tests
pytest

# Lint & type-check
ruff check src tests
mypy src

# Format
ruff format src tests
```

---

## License

MIT — see [LICENSE](LICENSE).

## Security Policy

See [SECURITY.md](SECURITY.md) for credential handling and disclosure.
