Metadata-Version: 2.4
Name: saasforge
Version: 0.11.0
Summary: Spec-Driven Micro-SaaS Development Toolkit
Author-email: Fahad Khakwani <fahadyousufkhakwani@gmail.com>
License: SaaSForge Commercial License
Project-URL: Homepage, https://github.com/Fahad-FullStackDeveloper/saasforge
Project-URL: Repository, https://github.com/Fahad-FullStackDeveloper/saasforge
Project-URL: Bug Tracker, https://github.com/Fahad-FullStackDeveloper/saasforge/issues
Keywords: micro-saas,scaffold,spec-driven,cli,saas,generator,template
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: Other/Proprietary License
Classifier: Natural Language :: English
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: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE.md
Requires-Dist: typer>=0.12
Requires-Dist: rich>=13
Requires-Dist: jinja2>=3
Dynamic: license-file

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/Fahad-FullStackDeveloper/saasforge/main/saasforge/logo.svg">
  <img src="https://raw.githubusercontent.com/Fahad-FullStackDeveloper/saasforge/main/saasforge/logo.svg" alt="SaaSForge Logo" width="200">
</picture>

# SaaSForge

**The #1 Spec-Driven Micro-SaaS Development Toolkit.**  
Build 450+ isolated Micro-SaaS tools from a single DNA document.  
Works with every major AI CLI. Deploy to Vercel + Hugging Face Spaces.

## 📦 Installation

**Supported OS:** Windows, Linux, macOS

```bash
# Install
pip install saasforge

# Verify
saasforge --version
sp --version
```

> 🆕 **24-hour free trial available** — try SaaSForge with 8 top adapters. No credit card required.
> ```bash
> saasforge trial
> ```
> [**Buy a license →**](https://saasforge.dev/pricing) for all 25 adapters and lifetime access.
>
> 📖 See [**GUIDE.md**](GUIDE.md) for a complete walkthrough of all commands, adapters, and products.
>
> ⚡ **Default package manager: pnpm** — all scaffolded tools use `pnpm install` / `pnpm run build`. Works with npm/yarn too but pnpm recommended (shared store = less disk space).

Both `saasforge` and `sp` aliases work — same CLI, shorter name.

```bash
$ saasforge --version
saasforge v0.11.0
$ sp --version
saasforge v0.11.0
```

[![PyPI](https://img.shields.io/pypi/v/saasforge)](https://pypi.org/project/saasforge/)
[![Downloads](https://img.shields.io/pypi/dm/saasforge)](https://pypi.org/project/saasforge/)
[![Tests](https://github.com/Fahad-FullStackDeveloper/saasforge/actions/workflows/publish.yml/badge.svg)](https://github.com/Fahad-FullStackDeveloper/saasforge/actions)
[![Python](https://img.shields.io/pypi/pyversions/saasforge)](https://pypi.org/project/saasforge/)
[![License](https://img.shields.io/badge/license-Commercial%20%2B%20MIT%20credit-blue)](LICENSE)
[![GitHub stars](https://img.shields.io/github/stars/Fahad-FullStackDeveloper/saasforge?style=social)](https://github.com/Fahad-FullStackDeveloper/saasforge)

---

## 📖 Table of Contents

- [🤔 What is SaaSForge?](#-what-is-saasforge)
- [💳 Licensing Model](#-licensing-model)
- [💰 Token Savings](#-token-savings)
- [🏆 Top 10 Reasons to Use SaaSForge](#-top-10-reasons-to-use-saasforge)
- [🛠️ What Can You Build With SaaSForge?](#️-what-can-you-build-with-saasforge)
- [⚡ Quick Start](#-quick-start)
- [📋 Full Workflow](#-full-workflow)
- [🤖 Supported AI CLIs (25)](#-supported-ai-clis-25)
- [📟 Commands Reference](#-commands-reference)
- [🔬 SaaSForge vs SpecifyPlus](#-saasforge-vs-specifyplus)
- [🏗️ Architecture](#️-architecture)
- [🎯 Use Cases](#-use-cases)
- [📄 License](#-license)

---

## 🤔 What is SaaSForge?

SaaSForge is a **Spec-Driven Micro-SaaS Development Toolkit**. (matlab: pehle specification, phir code)

**Spec First, Code Second.**  
You define *what to build* in DNA.md, then AI implements it from that spec. Code is planned, not random. (pehle batayein kya banana hai, phir AI implement kare)

**One DNA, 450 Tools.**  
Decide your architecture once (Frontend: Next.js, Backend: FastAPI, DB: Turso, Auth: Better Auth). SaaSForge auto-generates every new tool using that architecture — Dockerfile, backend, frontend, deploy config, everything. (ek baar architecture set karo, har naya tool usi hisaab se bane ga)

**Works with every AI CLI.**  
25 AI CLIs supported — opencode, KiloCode, Qwen, Claude Code, Cursor, Windsurf, Copilot, and more. No AI CLI? Use `--ai terminal` — SaaSForge generates plain config files that any LLM can follow. (agar AI CLI nahi hai to terminal mode use karo, config files banega jo koi bhi LLM samajh sakta hai. Note: Gemini adapter deprecated, bottom of list.)

**History + Memory.**  
Every command is logged. Project constitution (decisions, conventions, stack) auto-saves. AI CLI reads the constitution at every session start — continuity never breaks. (har command log hoti hai, constitution auto-save hota hai, AI CLI har session mein constitution read karta hai)

---

## 💳 Licensing Model

| Feature | Trial | Paid |
|---------|-------|-------|
| **Duration** | 24 hours | Lifetime |
| **Price** | Free | One-time purchase |
| **AI CLI Adapters** | 8 (top) | All 25 |
| **Product Templates** | 4 (samples) | All 25+ |
| **OS Support** | Win/Linux/macOS | Win/Linux/macOS |
| **Machine Binding** | ✅ Fingerprint | ✅ Fingerprint |
| **Trial Warnings** | ✅ <6h / <15min | — |
| **`check` Command** | ✅ Free | ✅ Free |
| **Lemon Squeezy Activation** | ❌ | ✅ Online |
| **HMAC Offline Fallback** | ❌ | ✅ 48h grace |
| **Priority Support** | ❌ | ✅ |

**Start trial:** `saasforge trial` — 24h, no credit card.  
**Buy license:** https://saasforge.dev/pricing  
**Register:** `saasforge register LIC-XXXXX`

---

## 💰 Token Savings — SaaSForge Ka Sabse Bada Feature!

SaaSForge sirf tools nahi banata — **AI ka budget bhi bachata hai.** Har feature token consumption reduce karne ke liye design kiya gaya hai.

### Per-Session Saving: Constitution System

| Bina SaaSForge | SaaSForge Ke Sath |
|----------------|-------------------|
| Har session mein project context dohrao: "Frontend Next.js + Tailwind + Shadcn → Vercel, Backend Python FastAPI → Hugging Face Spaces, Database Turso SQLite, Auth Better Auth, Storage Cloudflare R2..." | Constitution auto-load hota hai. AI pichle session se sab yaad rakhta hai |
| **~2,000–4,000 tokens** har session waste | **~0 tokens** — constitution ek baar load, baar baar use |

### Per-Command Saving: Slash Commands

| Prompt | Tokens | SaaSForge Equivalent | Tokens |
|--------|--------|---------------------|--------|
| *"Build a WhatsApp bot using Twilio + FastAPI + Turso. It should read incoming messages, auto-reply, store chat history..."* | ~500 | `/sp.specify WhatsApp auto-reply bot` | **~15** |
| *"Create a detailed implementation plan with architecture diagram, file structure, API routes..."* | ~400 | `/sp.plan` | **~8** |
| *"Break down the implementation into small, testable tasks with acceptance criteria..."* | ~350 | `/sp.tasks` | **~8** |

**Savings per command: 95–98% fewer tokens.**

### Per-Scaffold Saving: DNA-Aware Generation

| Bina SaaSForge | SaaSForge Ke Sath |
|----------------|-------------------|
| Har baar tech stack explain karo: Dockerfile config, HF Spaces port (7860), Vercel rewrites, requirements.txt | `saasforge scaffold --dna _system/DNA.md` — stack already defined |
| **~500–800 tokens** per scaffold waste | **~0 tokens** — DNA se auto-pick |

### Real-World Math: Ek Tool Complete Karne Par

```
Scenario: 50 AI sessions, 100 command invocations, 10 scaffolds, 5 deploys

Sessions:     50 × 3,000 tokens      = 150,000 tokens saved
Commands:   100 × 300 tokens          =  30,000 tokens saved
Scaffolds:   10 × 500 tokens          =   5,000 tokens saved
Deploys:      5 × 200 tokens          =   1,000 tokens saved
────────────────────────────────────────────────────────
Total:                              = 186,000 tokens per tool
```

### 450 Tools Ka Project → Token Saving Ka Scale

| Metric | Value |
|--------|-------|
| Tools in project | 450 |
| Tokens saved per tool | ~186,000 |
| **Total tokens saved** | **~83,700,000** |
| Claude Opus cost (@$15/M tokens) | **$1,255 saved** |
| GPT-4o cost (@$10/M tokens) | **$837 saved** |

> SaaSForge token-saving features (constitution, slash commands, DNA, history) har session, har command, aur har scaffold par **95% token reduction** dete hain. SpecifyPlus ke paas constitution hai lekin slash commands, DNA-aware scaffolding, aur deploy checklist nahi — is liye SaaSForge token-saving mein bhi #1 hai.

---

## 🏆 Top 10 Reasons to Use SaaSForge

| # | Reason | Why It Matters |
|---|--------|----------------|
| 1 | **DNA-Aware Scaffolding** | Har tool apke exact tech stack ke hisaab se generate hota hai. No copy-paste, no manual setup |
| 2 | **25 AI CLI Adapters** | Duniya ka har AI CLI support karta hai — SpecifyPlus sirf 18. Hum 25 ke saath #1 hain |
| 3 | **Zero Vendor Lock-in** | `--ai terminal` mode — kisi AI CLI ki zaroorat nahi. Saaf config files jo koi bhi LLM samajh sakta hai |
| 4 | **Constitution + History** | AI kabhi nahi bhoolta project conventions. Har command track hoti hai. Debugging aasaan |
| 5 | **Built-in Deploy Checklist** | Vercel + Hugging Face Spaces ke liye 7-point checklist. Production-ready deployment |
| 6 | **DNA Validation** | `saasforge dna --validate` — missing configs detect karta hai. SpecifyPlus mein nahi hai |
| 7 | **Idempotent Init** | `saasforge init` do baar chalao — same result. Koi duplication nahi, koi overwrite nahi |
| 8 | **Safe Scaffold** | `--force` flag explicit hai. Bina flag ke old tool overwrite nahi hota |
| 9 | **Parser FLEX** | Case-insensitive, spaces-before-colon, aliases (DB→database, File Storage→storage). SpecifyPlus exact match maangta hai |
| 10 | **450-Tool Architecture** | Har tool isolated: alag Vercel project, alag HF Space, alag DB, alag R2 bucket. Zero shared infra |

---

## 🛠️ What Can You Build With SaaSForge?

SaaSForge kisi bhi Micro-SaaS idea ko tool mein badal sakta hai. Har tool independently deploy hota hai — apna Vercel project, apna Hugging Face Space, apni Turso database, apna R2 bucket.

### 1. AI-Powered Tools
- **Smart Invoice OCR** — PDF/image upload → OCR → structured data → database
- **AI Blog Writer** — Topic → AI → blog post → publish
- **Chat with PDF** — Upload PDF → RAG → Q&A interface
- **AI Image Generator** — Prompt → Gemini/Stable Diffusion → gallery

### 2. Business Automation Tools
- **WhatsApp Bot** — Twilio + FastAPI + Turso → automated responses
- **Invoice Generator** — Template + data → PDF → email
- **Meeting Scheduler** — Calendar integration → booking → reminders
- **Form Builder** — Drag-drop → API endpoint → submissions dashboard

### 3. Data Tools
- **CSV Analyzer** — Upload → AI analysis → charts + insights
- **Web Scraper** — URL → HTML → AI extraction → structured data
- **Translation Hub** — Text → Gemini translation → multiple languages
- **Data Dashboard** — DB → REST API → charts + filters

### 4. Developer Tools
- **API Playground** — Endpoint → test → results → share
- **JSON Formatter** — Input → validate → format → download
- **Regex Builder** — Pattern → test → explain → save
- **Cron Job Manager** — Schedule → task → logs → alerts

### 5. E-commerce / Payment Tools
- **Pricing Page Builder** — Tiers → calculator → checkout
- **Subscription Manager** — Users → plans → billing → invoices
- **Coupon Generator** — Rules → codes → validation → analytics

### How Deployment Works (Each Tool)

```
Tool 001 → Vercel (Next.js FE) + HF Space (FastAPI BE) + Turso DB + R2 Storage
Tool 002 → Vercel (Next.js FE) + HF Space (FastAPI BE) + Turso DB + R2 Storage
...
Tool 450 → Vercel (Next.js FE) + HF Space (FastAPI BE) + Turso DB + R2 Storage
```

Har tool completely isolated. Ek tool down ho jaye to baqi 449 unaffected.

---

## ⚡ Quick Start

### For Developers (Free / Licensed)

```bash
# 1. Install
pip install saasforge

# 2. Verify version
saasforge --version    # → v0.10.3

# 3. Register license (paid users) OR start trial
saasforge register LIC-XXXXX     # Paid — all 25 adapters, lifetime
# OR
saasforge trial                  # Free — 24h trial, 8 adapters

# 4. Check environment
saasforge check

# 5. Generate DNA — wizard asks about your tech stack
saasforge setup my-micro-saas     # Interactive: questions hain, DNA.md banata hai
saasforge setup . --here --ai opencode  # Current dir, DNA + AI adapter ek saath

# 6. OR skip wizard, just init adapter directly
saasforge init my-micro-saas          # Interactive: 25-Adapter menu, pick by number/name
saasforge init . --ai opencode --here # Non-interactive: directly opencode set karo
saasforge init . --all --here         # Sab 25 adapters ek saath

cd my-micro-saas

# 6. Your AI CLI commands are ready!
#    Open your AI CLI (e.g. opencode) and type:
#    /sp.   → See all 12 workflow commands
#    /sp.specify Build a WhatsApp bot with Twilio

# 7. View command history anytime
saasforge history
```

**Under 30 seconds, ready to build.**
**Teen modes hain adapter select karne ka:**
| Mode | Command | Kya Hota Hai |
|------|---------|-------------|
| **Interactive** | `saasforge init my-project` | 25 adapters ki menu dikhe gi. Number(s) ya name(s) type karo — ek ya multiple select kar sakte ho |
| **Single** | `saasforge init my-project --ai opencode` | Non-interactive. Directly woh adapter set ho jaye ga. Scripts / CI ke liye best |
| **All 25** | `saasforge init my-project --all` (or `-A`) | Sab 25 adapters ki config files ek saath generate ho jayein gi. Har AI CLI ke saath kaam karna hai to ye lo |

---

## 📋 Full Workflow

### Step 1: Define Your DNA

Ek file sab kuch control karti hai. `_system/DNA.md` mein apna architecture likho:

```markdown
FRONTEND:     Next.js + Tailwind + Shadcn → Vercel
BACKEND:      Python FastAPI → Hugging Face Spaces
DATABASE:     Turso SQLite
AUTH:         Better Auth
FILE STORAGE: Cloudflare R2
DEPLOYMENT:   Vercel (FE) + HF Spaces (BE) + Turso (DB)
```

SaaSForge ka parser itna flexible hai:

```markdown
FrontEnd : nextjs      ✓  (case-insensitive)
DB : postgres           ✓  (alias — DB = database)
File Storage : R2      ✓  (spaces before colon)
deploy: vercel + hf    ✓  (deploy = deployment)
```

Validate karo: `saasforge dna --validate`

### Step 2: Initialize Project

```bash
# Interactive mode — SaaSForge poochta hai konsa adapter chahiye
saasforge init my-tool

# Non-interactive (single adapter)
saasforge init my-tool --ai opencode

# All 25 adapters ek saath
saasforge init my-tool --all

# Existing directory mein
saasforge init . --ai claude --here

# Bina AI CLI ke
saasforge init my-tool --ai terminal

# Chota naam bhi kaam karta hai
sp init my-tool
```

**Interactive mode:** jab `--ai` ya `--all` nahi diya, to SaaSForge 25 adapters ki menu dikhata hai. Aap number(s) ya name(s) type karo — ek ya multiple select kar sakte ho.

**--all flag:** sab 25 adapters ki config files ek hi command mein generate hoti hain. Har AI CLI ke saath kaam karna hai to ye use karo.

Non-interactive mode mein `--ai` specify karo. Jaise `--ai opencode` se `.opencode/commands/` folder banta hai jisme `/sp.specify`, `/sp.plan`, etc. commands hain.

### Step 3: Scaffold a Tool

```bash
saasforge scaffold invoice-ocr --number 001 --dna _system/DNA.md
```

Ye kya generate karta hai?

```
_tools/
└── _001-invoice-ocr/
    ├── frontend/          ← Next.js (empty, AI bharega)
    ├── backend/
    │   ├── api/           ← FastAPI endpoints
    │   └── src/           ← Business logic
    ├── tests/
    ├── Dockerfile          ← Hugging Face Docker SDK
    ├── .dockerignore
    ├── app.py              ← FastAPI entrypoint (port 7860)
    ├── requirements.txt    ← Python deps
    └── vercel.json         ← Rewrite proxy config
```

Dobara scaffold karo to `--force` lagao — purana delete ho kar naya banta hai.

### Step 4: Track Context (Constitution)

AI CLI ko project ka context yaad rakhne ke liye:

```bash
saasforge constitute --show          # Dekho constitution
saasforge constitute --regenerate    # DNA se dubara banao
saasforge constitute --edit          # Editor mein kholo
```

Constitution `.saasforge/memory/constitution.md` mein save hota hai. AI CLI har session mein yeh file padhti hai — is liye usay project conventions yaad rehte hain.

### Step 5: Generate Workflow Commands

```bash
saasforge workflow --ai opencode
```

Ye `.opencode/commands/` mein yeh slash commands banata hai:

| Command | Kaam |
|---------|------|
| `/sp.specify` | Define what to build |
| `/sp.plan` | Create implementation plan |
| `/sp.tasks` | Break into actionable tasks |
| `/sp.implement` | Execute the plan |
| `/sp.analyze` | Cross-artifact consistency check |

In commands ko AI CLI mein directly use karo. For example:

```
/sp.specify Build a WhatsApp bot that reads incoming messages and auto-replies
```

### Step 6: Deploy

```bash
saasforge deploy ./_tools/_001-invoice-ocr
```

7-point checklist dikhta hai:

| Item | Status |
|------|--------|
| ✅ Dockerfile exists | ✓/✗ |
| ✅ .dockerignore exists | ✓/✗ |
| ✅ app.py exists | ✓/✗ |
| ✅ requirements.txt exists | ✓/✗ |
| ✅ vercel.json exists | ✓/✗ |
| ✅ frontend/ exists | ✓/✗ |
| ✅ backend/ exists | ✓/✗ |

### Step 7: Track Everything

```bash
# Pichle 50 commands dekho
saasforge history

# Sirf 10 dekho
saasforge history --limit 10

# History saaf karo
saasforge history --clear
```

Har `init`, `scaffold`, `workflow`, `deploy`, `dna`, `constitute`, `history` command automatically log hoti hai `.saasforge/memory/history.jsonl` mein.

---

## 🤖 Supported AI CLIs (25)

| # | CLI | Flag | Generates | SpecifyPlus? |
|---|-----|------|-----------|--------------|
| 1 | opencode | `--ai opencode` | `.opencode/commands/` | ✅ |
| 2 | Claude Code | `--ai claude` | `.claude/commands/` | ✅ |
| 3 | Gemini CLI (Deprecated) | `--ai gemini` | `.gemini/` | ✅ |
| 4 | GitHub Copilot | `--ai copilot` | `.github/instructions/` | ✅ |
| 5 | Cursor | `--ai cursor` | `.cursor/rules/` | ✅ |
| 6 | Windsurf | `--ai windsurf` | `.windsurf/` rules | ✅ |
| 7 | Roo Code | `--ai roo` | `.roo/commands/` | ✅ |
| 8 | Codex CLI | `--ai codex` | `.codex/instructions/` | ✅ |
| 9 | Qwen Code | `--ai qwen` | `.qwen/` workflow | ✅ |
| 10 | Qoder CLI | `--ai qoder` | `.qoder/commands/` | ✅ |
| 11 | Amazon Q Developer | `--ai amazonq` | `.q/commands/` | ⚠️ |
| 12 | Amp | `--ai amp` | `.amp/instructions/` | ✅ |
| 13 | Auggie CLI | `--ai auggie` | `.auggie/` workflow | ✅ |
| 14 | CodeBuddy CLI | `--ai codebuddy` | `.codebuddy/` rules | ✅ |
| 15 | IBM Bob | `--ai bob` | `.bob/` instructions | ✅ |
| 16 | Jules | `--ai jules` | `.jules/` workflow | ✅ |
| 17 | SHAI (OVHcloud) | `--ai shai` | `.shai/instructions/` | ✅ |
| 18 | Continue | `--ai continue` | `.continue/rules/` | ❌ **New** |
| 19 | Cody (Sourcegraph) | `--ai cody` | `.cody/` instructions | ❌ **New** |
| 20 | Tabby | `--ai tabby` | `.tabby/` workflow | ❌ **New** |
| 21 | Antigravity | `--ai antigravity` | `.antigravity/rules/` | ❌ **New** |
| 22 | Aider | `--ai aider` | `.aider/CONVENTIONS.md` | ❌ **New** |
| 23 | KiloCode | `--ai kilocode` | `.kilocode/instructions/` | ✅ |
| 24 | OpenRouter CLI | `--ai openroutercli` | `.openrouter/` | ❌ **New** |
| 25 | Terminal (no AI) | `--ai terminal` | `.saasforge/config.yml` | ❌ **Unique** |

> **Windows users:** v0.10.3+ fixes Unicode crashes on cp1252 terminals. Run `saasforge check` to verify your installation.

**Compare:** SpecifyPlus = 18 adapters. SaaSForge = **25 adapters** — 7 zyada, including 6 jo SpecifyPlus mein nahi hain aur 1 (Terminal) jo completely unique hai.

### How to Use Any Adapter

SaaSForge teen modes deta hai adapter select karne ka:

```bash
# 1. Interactive — menu dikhe ga, pick karo (ya multiple)
saasforge init my-tool

# 2. Single — non-interactive, script-friendly
saasforge init my-tool --ai claude

# 3. All 25 — ek baar mein sab
saasforge init my-tool --all
```

---

## 📟 Commands Reference

### All Commands

| Command | Alias | Description |
|---------|-------|-------------|
| `saasforge trial` | `sp trial` | Start 24h free trial (8 adapters) |
| `saasforge register` | `sp register` | Activate license key (Lemon Squeezy / offline) |
| `saasforge license-status` | `sp license-status` | Show current license or trial status |
| `saasforge check` | `sp check` | Check installed tools (git, python, pnpm, etc.) |
| `saasforge setup` | `sp setup` | Interactive wizard: generate DNA.md from questions |
| `saasforge init` | `sp init` | Initialize new project with AI CLI adapter |
| `saasforge scaffold` | `sp scaffold` | Generate full tool structure from DNA |
| `saasforge workflow` | `sp workflow` | Generate spec-driven slash commands |
| `saasforge deploy` | `sp deploy` | Deployment readiness checklist |
| `saasforge dna` | `sp dna` | Inspect and validate DNA.md |
| `saasforge constitute` | `sp constitute` | Manage project constitution |
| `saasforge history` | `sp history` | View or clear command history |
| `saasforge tokens` | `sp tokens` | Estimate project token usage (live counter) |
| `saasforge dev-activate` | (hidden) | Developer activation (authorized users only) |

> **`saasforge dev-activate`** — hidden command for developer (Fahad only). Reads token from `~/.saasforge/dev.token` or direct argument. Email-locked HMAC activation, lifetime access.

### All Options

| Flag | Applies To | Purpose |
|------|-----------|---------|
| `--ai` | init, workflow, setup | Choose AI CLI adapter (25 options). Omit for interactive menu |
| `--all`, `-A` | init | Generate configs for ALL 25 adapters at once |
| `--no-git` | init | Skip git init |
| `--here` | init, setup | Run in current directory instead of new folder |
| `--force`, `-f` | scaffold | Overwrite existing tool directory |
| `--number`, `-n` | scaffold | Tool number (default: 002) |
| `--target`, `-t` | scaffold | Target directory (default: `_tools`) |
| `--dna` | scaffold | Path to DNA.md |
| `--show`, `-s` | constitute | Display constitution |
| `--edit`, `-e` | constitute | Edit in default text editor |
| `--regenerate`, `-r` | constitute | Regenerate constitution from DNA |
| `--limit`, `-n` | history | Number of entries (default: 50) |
| `--clear` | history | Delete all history |
| `--path`, `-p` | dna | Path to DNA.md |
| `--validate` | dna | Run DNA validation checks |
| `--version`, `-v` | (any) | Show version |
| `--help` | (any) | Show help |

---

## 🔬 SaaSForge vs SpecifyPlus — Full Comparison

| Capability | SpecifyPlus | SaaSForge | Winner |
|------------|-------------|-----------|--------|
| **AI CLI Adapters** | 18 | **25** (+7) | 🏆 **SaaSForge** |
| **DNA-Aware Scaffolding** | ❌ Static templates | ✅ Reads `_system/DNA.md` | 🏆 **SaaSForge** |
| **Scaffold Output** | Spec files only | **Full-stack tool** (Dockerfile, backend, frontend, deploy config) | 🏆 **SaaSForge** |
| **Deploy Checklist** | ❌ None | ✅ Vercel + HF Spaces (7-point) | 🏆 **SaaSForge** |
| **DNA Validation** | ❌ | ✅ `saasforge dna --validate` | 🏆 **SaaSForge** |
| **Command History** | ❌ | ✅ `.saasforge/memory/history.jsonl` | 🏆 **SaaSForge** |
| **Constitution** | ✅ `.specify/memory/` | ✅ `.saasforge/memory/constitution.md` | Draw |
| **`check` Command** | ✅ (requires license) | ✅ **Free for everyone** — no license needed | 🏆 **SaaSForge** |
| **`--force` Flag** | ❌ Silent overwrite | ✅ Explicit + directory cleanup | 🏆 **SaaSForge** |
| **DNA Parser** | Exact match only | ✅ Case-insensitive, aliases, regex, spaces-before-colon | 🏆 **SaaSForge** |
| **Terminal-Only Mode** | ❌ | ✅ `--ai terminal` — zero AI CLI needed | 🏆 **SaaSForge** |
| **Idempotent Init** | ❌ May duplicate | ✅ Guarded by `if not path.exists()` | 🏆 **SaaSForge** |
| **Short CLI Alias** | ✅ `sp` | ✅ `sp` | Draw |
| **24-Hour Free Trial** | ❌ None | ✅ 24h, 8 adapters, 4 products, 3-layer backup | 🏆 **SaaSForge** |
| **Trial Tamper Protection** | ❌ | ✅ HMAC-signed + JSON + hidden backup + OS-native (Registry/plist/XDG) | 🏆 **SaaSForge** |
| **Machine Fingerprint Binding** | ❌ | ✅ License + trial bound to hostname + UUID hash | 🏆 **SaaSForge** |
| **Offline License Grace** | ❌ | ✅ 48-hour HMAC fallback (no internet needed) | 🏆 **SaaSForge** |
| **Lemon Squeezy Online Validation** | ❌ | ✅ License activate + validate via LMSQ API | 🏆 **SaaSForge** |
| **Developer Activation** | ❌ | ✅ Hidden `dev-activate` command — email-locked HMAC | 🏆 **SaaSForge** |
| **Trial Expiry Warnings** | ❌ | ✅ Yellow <6h, Red <15min on every command | 🏆 **SaaSForge** |
| **Slash Command Set** | 5 (specify, plan, tasks, implement, review) | **12** (specify, plan, tasks, implement, analyze, review, debug, refactor, deploy, log, iterate, constitution) | 🏆 **SaaSForge** |
| **Windows cp1252 Support** | ❌ Crashes on legacy terminals | ✅ v0.10.3+ — ASCII-safe output | 🏆 **SaaSForge** |
| **Token Savings** | ❌ Constitution only (~20%) | ✅ Constitution + DNA + Slash Commands = **~95%** | 🏆 **SaaSForge** |
| **450-Tool Architecture** | ❌ General spec-driven dev | ✅ Isolated Micro-SaaS Factory (per-tool Vercel + HF + DB + Storage) | 🏆 **SaaSForge** |
| **Pricing Model** | MIT (free) | Commercial + MIT credit — code owned by you | 🏆 **SaaSForge** |
| **Payment Integration** | ❌ None | ✅ Lemon Squeezy ready (checkout + license key delivery) | 🏆 **SaaSForge** |
| **Multi-Stack Support** | ❌ Single stack only | ✅ **(Coming Soon)** 10+ frontends, 10+ backends, 10+ databases, ORMs, ERP, AI providers | 🏆 **SaaSForge** |
| **ORM Support** | ❌ None | ✅ **(Coming Soon)** Prisma, Drizzle, SQLAlchemy, TypeORM, Mongoose, Kysely | 🏆 **SaaSForge** |
| **ERP Systems** | ❌ None | ✅ **(Coming Soon)** Oracle Cloud ERP, Odoo, ERPNext | 🏆 **SaaSForge** |
| **Serverless Postgres** | ❌ Turso only | ✅ **(Coming Soon)** NeonDB, Supabase, PostgreSQL | 🏆 **SaaSForge** |
| **AI Provider Abstraction** | ❌ Gemini fixed | ✅ **(Coming Soon)** OpenAI, Claude API, Together AI, Groq, Ollama | 🏆 **SaaSForge** |
| **Oracle Cloud DB** | ❌ None | ✅ **(Coming Soon)** Enterprise Oracle database support | 🏆 **SaaSForge** |
| **Priority Support** | ❌ None | ✅ Email / Discord | 🏆 **SaaSForge** |

**Score: SaaSForge 30 — SpecifyPlus 0 — Draw 3**

> **⚠️ Haad (Caveat):** SaaSForge initially forked from SpecifyPlus and shares its DNA (spec-driven development philosophy). SpecifyPlus ka core concept — DNA.md se spec generate karna — wohi foundation hai jis par SaaSForge bana hai. Lekin SaaSForge ne us concept ko **Micro-SaaS Factory** tak le ja kar ek alag direction di hai: full-stack scaffolding, 25 adapters, commercial licensing, trial system, payment integration, aur multi-stack support. SpecifyPlus ek excellent open-source tool hai apne domain mein, aur hum unki contribution ko NOTICE.md mein credit karte hain.

---

## Summary Report — SaaSForge v0.10.3

### Quality Assessment
- **74 tests, 73 pass** — core functionality stable (1 pre-existing trial adapter test needs update)
- **25 adapters** — each generates correct config files for its target AI CLI
- **12 slash commands** — all produce valid markdown with flexible DNA-aware headers
- **License system** — trial (24h, HMAC, 3-layer backup), paid (Lemon Squeezy + offline HMAC grace)
- **Windows cp1252** — all emoji/Unicode removed from CLI output, no crashes on legacy terminals
- **Error handling** — every command has input validation, clear error messages, and graceful exits

### Professionalism
- **Idempotent operations** — `init` multiple times = same result, no duplicates
- **Safe scaffolding** — `--force` explicit, no silent overwrites
- **Audit trail** — every command logged to `history.jsonl` with timestamp, args, file count
- **Constitution system** — AI never forgets project context across sessions
- **DNA validation** — `saasforge dna --validate` catches missing configs before they cause issues
- **Deploy checklist** — 7-point verification before any deployment
- **Backward compatible** — all changes preserve existing behavior

### Why Users Will Buy SaaSForge

| Reason | What It Means |
|--------|---------------|
| **Time savings** | Scaffold full-stack tools in seconds, not hours. Spec-driven = no manual boilerplate |
| **Token savings** | 95% fewer tokens vs raw prompting. Constitution + DNA + slash commands = <$1,200 saved on 450 tools |
| **No lock-in** | 25 AI CLIs supported. Switch between opencode, Claude, Cursor, etc. anytime. `--ai terminal` works with any LLM |
| **25 adapters** | More than any competitor (SpecifyPlus: 18). Covers every major AI CLI |
| **Production-ready** | Full-stack scaffolding (Docker, frontend, backend, deploy config). Not just spec files |
| **License value** | Lifetime, one-time purchase. 24h free trial to evaluate. No subscription |
| **Micro-SaaS factory** | 450 isolated tools from single DNA. Each tool = own Vercel + HF + DB + storage |
| **Security** | 6-layer implementation checks, tamper-proof trial, machine-bound license |
| **Windows support** | v0.10.3+ works on cp1252 terminals — no crashes like competitors |
| **Support** | Priority email/discord for paid users |

### Bottom Line
SaaSForge is not just a SpecifyPlus fork — it is a complete **Micro-SaaS Factory** with 35+ features that SpecifyPlus doesn't have. It saves developers **thousands of dollars in token costs** and **hundreds of hours of boilerplate setup**. The 24-hour free trial lets users validate before buying. For anyone building Micro-SaaS tools with AI, SaaSForge is the most comprehensive, most cost-effective, and most professionally built toolkit available.

---

## 🏗️ Architecture

```
project-root/
│
├── _system/
│   └── DNA.md                    ← Single source of truth (frontend, backend, DB, auth, storage)
│
├── _tools/
│   ├── _001-invoice-ocr/         ← Tool 1: Isolated Micro-SaaS
│   │   ├── frontend/ (Next.js)
│   │   ├── backend/  (FastAPI)
│   │   ├── Dockerfile
│   │   ├── app.py
│   │   ├── requirements.txt
│   │   └── vercel.json
│   │
│   ├── _002-whatsapp-bot/        ← Tool 2: Isolated Micro-SaaS
│   └── _003-blog-writer/         ← Tool 3: Isolated Micro-SaaS
│
├── .saasforge/
│   └── memory/
│       ├── constitution.md       ← Project memory (AI CLI reads this)
│       └── history.jsonl         ← Command audit trail
│
├── .opencode/  (or .claude/ or .cursor/ etc.)   ← AI CLI adapter config
│
└── saasforge                     ← pip install saasforge
```

### Deployment Architecture (Each Tool)

```
Tool 001 → Vercel (Next.js FE) + HF Space (FastAPI BE on port 7860) + Turso DB + R2 Bucket
Tool 002 → Vercel (Next.js FE) + HF Space (FastAPI BE on port 7860) + Turso DB + R2 Bucket
...
```

Key points:
- **Har tool completely isolated.** Apna Vercel project, apna HF Space, apni DB, apna storage
- **Ek tool down → baqi 449 unaffected**
- **DNA ek hi jagah** — `_system/DNA.md`. Kabhi bhi badlo, sab tools affect hotay hain
- **Docker SDK** — Hugging Face Spaces Docker mode use karta hai (Blank SDK nahi)

---

## 🎯 Use Cases

### Solo Founder — Build a Micro-SaaS Empire

Aap 1 tool per week banao. Har tool apni alag revenue stream hai. Ek fail ho jaye to baqi hain.

```bash
# Week 1
saasforge scaffold invoice-ocr --number 001 --dna _system/DNA.md

# Week 2
saasforge scaffold whatsapp-bot --number 002 --dna _system/DNA.md

# Week 3
saasforge scaffold blog-writer --number 003 --dna _system/DNA.md
```

### Development Team — Standardized Architecture

Naye developer ko onboard karna aasaan hai. DNA.md ek hi source of truth hai. Stack, patterns, deployment flow sab standardized.

```
New Developer → git clone → saasforge dna --validate → saasforge scaffold → Ready
```

### AI-Only Development (No AI CLI)

Agar aapke paas koi AI CLI nahi hai, to `--ai terminal` use karo:

```bash
saasforge init my-tool --ai terminal
```

Ye `.saasforge/config.yml` banata hai. Koi bhi LLM (ChatGPT, Gemini, DeepSeek) isay follow kar sakta hai.

### Education — Learn SaaS Architecture

Scaffold a complete tool → study the generated files → understand how production SaaS works:

```
Dockerfile      → How containerization works
app.py          → FastAPI entrypoint (port 7860)
vercel.json     → Rewrite proxy config
requirements.txt → Python dependency management
```

### Consultant — Deliver Tools Faster

450+ tools banao, har client ko 1 tool do. Har tool isolated, branded, independently deployable.

### Open Source Project — Standardized Contributing

SaaSForge ke saath, contributors ko bas `_system/DNA.md` padhna hai. Same stack, same patterns, same everything.

---

## 📄 License

- **Original SpecifyPlus code:** MIT © GitHub, Inc. — see [NOTICE.md](NOTICE.md) for attribution
- **All new code, adapters, CLI, templates, and SaaSForge-specific work:** **SaaSForge Commercial License** — see [LICENSE](LICENSE)

You may use SaaSForge freely in your own projects and commercial products. Contact the author for redistribution or sublicensing.

---

*Built with ❤️ by Fahad Khakwani. Part of the [Micro-SaaS Factory](https://github.com/Fahad-FullStackDeveloper/4--SaaS_Factory) project.*
