# leadgen — Setup Guide (start here!)

Welcome 👋 This guide gets you from "just bought it" to "leads in my Notion" in
about 10 minutes. No coding needed. Follow the steps for **your** computer.

---

## ✅ What you got
A ZIP file for your computer. Inside is **one small program** called `leadgen`
(`leadgen.exe` on Windows). That's the whole tool — one file.

leadgen looks up businesses on Google Maps (like "cafes in Kolkata") and saves
their details (name, phone, address, rating, website, and more) into your
**Notion** or a spreadsheet (**CSV**) file.

## 🧰 Two things you need first (one time)
1. **Google Chrome** must be installed on your computer. (leadgen quietly uses
   Chrome in the background.) If you have Chrome, you're set. If not, get it free
   at google.com/chrome.
2. **A Notion key** so leadgen can write into your Notion. How to get it:
   - Go to **notion.so/my-integrations** → click **New integration** → give it a
     name (like "leadgen") → **Submit** → copy the **secret** (starts with `ntn_`).
   - Open the Notion page/database you want leads in → click the **•••** (top
     right) → **Connections** → add your "leadgen" integration.
   - Copy your database link. The long code in it (32 letters/numbers) is your
     **database id**.

You'll paste those two values in a moment. *(Skip this if you'll only use CSV.)*

---

## 🪟 Windows

1. **Unzip** the file you downloaded (right-click → *Extract All*). You now have
   a folder with `leadgen.exe` inside.
2. In that same folder, make a text file named **`.env`** (exactly that, with the
   dot). Open it in Notepad and paste:
   ```
   NOTION_TOKEN=ntn_your_secret_here
   NOTION_DATABASE_ID=your_database_id_here
   ```
   Save it.
3. **Open a terminal in that folder:** click the address bar of the folder, type
   `powershell`, and press **Enter**.
4. Check everything is ready:
   ```
   .\leadgen.exe doctor
   ```
   You want to see `internet: OK`, `Notion token: set`, and Chrome found.
5. Get your first leads:
   ```
   .\leadgen.exe run --niche "cafe" --location "Kolkata" --limit 10 --to notion
   ```
   Watch the progress bar. When it's done, open Notion — your leads are there. 🎉

> Windows may show a blue "Windows protected your PC" box the first time. Click
> **More info → Run anyway** (it's safe; it's just unsigned).

---

## 🍎 Mac

1. **Unzip** the downloaded file (double-click it). You get a file called `leadgen`.
2. Put `leadgen` in a folder, and in that same folder make a file named **`.env`**
   containing:
   ```
   NOTION_TOKEN=ntn_your_secret_here
   NOTION_DATABASE_ID=your_database_id_here
   ```
3. **Open Terminal** (press ⌘+Space, type *Terminal*, Enter). Then go to your
   folder — easiest way: type `cd ` (with a space), drag the folder onto the
   Terminal window, and press Enter.
4. Allow the program to run (Mac blocks unknown apps once):
   ```
   chmod +x leadgen
   xattr -d com.apple.quarantine leadgen
   ```
5. Check it's ready, then run:
   ```
   ./leadgen doctor
   ./leadgen run --niche "cafe" --location "Kolkata" --limit 10 --to notion
   ```
   Done — check Notion. 🎉

> If macOS still says *"cannot be opened"*, go to **System Settings → Privacy &
> Security**, scroll down, and click **Open Anyway**.

---

## 🐧 Linux

1. **Unzip / untar** the download:
   ```
   tar -xzf leadgen_linux_amd64.tar.gz
   ```
2. In the same folder, create **`.env`**:
   ```
   NOTION_TOKEN=ntn_your_secret_here
   NOTION_DATABASE_ID=your_database_id_here
   ```
3. Make it runnable and go:
   ```
   chmod +x leadgen
   ./leadgen doctor
   ./leadgen run --niche "cafe" --location "Kolkata" --limit 10 --to notion
   ```
   🎉

---

## ▶️ Everyday use (all systems)
Replace the words in quotes with whatever you want:
```
leadgen run --niche "dentist" --location "Pune" --limit 20 --to notion
```
- `--niche "..."`     the kind of business
- `--location "..."`  the city/area
- `--limit 20`        how many leads (up to 256)
- `--website without` only businesses **with no website** (your best prospects).
                      Use `with` for ones that have a site, or `any` for all.
- `--to csv`          save to a spreadsheet file instead of Notion

Helpful commands: `leadgen doctor` (health check) · `leadgen fields` (all the
columns it collects) · `leadgen --help`.

## ❓ If something doesn't work
| You see… | Do this |
|---|---|
| "No internet connection" | Connect to the internet and try again. |
| "Chrome not found" | Install Google Chrome (or set `LEADGEN_CHROME` to its path). |
| "Notion token … missing" | Double-check your `.env` file is in the same folder and spelled `.env`. |
| Fewer leads than you asked | That business type mostly has websites — try `--website any`. |
| It looks stuck | It's opening each business one by one; give it a minute (the bar moves). |

That's it. Enjoy your leads! 🚀
