Metadata-Version: 2.4
Name: pyweb-cli
Version: 3.0.0
Summary: PyWeb — The Python Alternative Web. Register FREE TLDs, host on Hugging Face or your own hardware.
Author: PyWeb
License: MIT
Keywords: web,dns,tld,huggingface,cli,hosting
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Environment :: Console
Classifier: Topic :: Internet :: WWW/HTTP
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: author
Dynamic: license-file
Dynamic: requires-python

# PyWeb CLI

**The Python Alternative Web — all domains are FREE, forever.**

No registrars. No ICANN fees. No bullshit. Just Python.

---

## Install

```bash
# No pip install needed — pure stdlib Python 3.6+
curl -o pyweb https://raw.githubusercontent.com/your-repo/pyweb-cli/main/pyweb.py
chmod +x pyweb
sudo mv pyweb /usr/local/bin/pyweb
```

Or just run it directly:
```bash
python3 pyweb.py <command>
```

---

## Quick Start

```bash
# 1. Set your username (matches your HuggingFace handle)
pyweb login myusername

# 2. Register a domain (FREE, instant)
pyweb register mysite.mycoolweb

# 3. Deploy your site folder
pyweb deploy mysite.mycoolweb ./my-site-folder

# 4. Get your live URL
pyweb open mysite.mycoolweb
```

---

## Commands

| Command | Description |
|---|---|
| `pyweb login <username>` | Save your username locally |
| `pyweb whoami` | Show current user |
| `pyweb register <domain>` | Register a PyWeb domain (FREE) |
| `pyweb deploy <domain> <folder>` | Package & deploy a site to HF CDN |
| `pyweb open <domain>` | Get the live URL for a domain |
| `pyweb list` | List your domains |

---

## How It Works

```
pyweb deploy mysite.mycoolweb ./my-folder
        │
        ├─ 1. Packages ./my-folder → site.zip (in-memory, no temp files)
        ├─ 2. Hits PyWeb backend → Security checks:
        │      ├─ Uniqueness check (is domain taken in PyWeb?)
        │      └─ DNS trademark check (does <core>.com exist on ICANN?)
        ├─ 3. Creates HuggingFace Dataset repo: username/pyweb-mysite-mycoolweb
        ├─ 4. Uploads site.zip → HF CDN
        └─ 5. Writes mapping to PyWeb_Registry → domain is LIVE
```

---

## Security Rules

- **Uniqueness**: Each domain can only be owned by one person.
- **Trademark protection**: If `<core>.com` resolves on real DNS, registration is blocked. `netflix.mycoolweb` → blocked. `zorbabuilds.mycoolweb` → allowed.
- **Free forever**: No pricing tiers, no premium domains, no upsells.

---

## Site Requirements

Your site folder must contain an `index.html` at the root. Everything else (CSS, JS, images) is packed into `site.zip` and served from HuggingFace CDN.

```
my-site/
├── index.html   ← required
├── style.css
├── app.js
└── assets/
    └── logo.png
```

---

## Live Resolution

When someone visits your PyWeb domain, the resolver:
1. Looks up your `hf_repo_id` in `PyWeb_Registry`
2. Fetches `site.zip` from HuggingFace CDN
3. Extracts `index.html` **entirely in RAM** (no disk writes)
4. Renders the HTML directly in the browser

**Endpoint:** `https://superagent-0b5134e7.base44.app/functions/resolveDomain?domain=<your-domain>`
