<div align="center">

# 🚀 AWS Builder ID Account Generator
### ⚡ Fully Automated AWS Builder ID Account Creation Engine

[![Node.js](https://img.shields.io/badge/Node.js-18+-339933?logo=node.js&logoColor=white)](https://nodejs.org)
[![Puppeteer](https://img.shields.io/badge/Puppeteer-Stealth-40B5A4?logo=puppeteer&logoColor=white)](https://pptr.dev)
[![License](https://img.shields.io/badge/License-MIT-yellow)](LICENSE)
[![Status](https://img.shields.io/badge/Status-Production-success)](https://github.com)

[English](#english) • [中文](#中文)

</div>

---

## English

### ✨ Features

#### 🎯 Core Capabilities
- **🤖 Fully Automated** - Complete AWS Builder ID registration without manual intervention
- **📧 Cloudflare Temp Email** - Automatic temporary email generation and verification code extraction
- **🔐 OIDC Token Management** - Automatic OAuth device flow and token retrieval
- **🕵️ Stealth Mode** - Puppeteer Stealth plugin for bot detection bypass
- **🌐 Proxy Support** - Built-in proxy rotation for IP ban prevention
- **🔄 Batch Processing** - Create multiple accounts with configurable delays

#### 🛡️ Advanced Features
- **💾 JSON Export** - Automatic account data export in Kiro-compatible format
- **🎨 Interactive CLI** - Beautiful command-line interface with menu navigation
- **⚡ High Performance** - Optimized for speed and reliability
- **🔧 Configurable** - Flexible configuration via `config.json`

---

### 📦 Installation

```bash
# Clone repository
git clone https://github.com/yourusername/aws-builder-id.git
cd aws-builder-id/automation

# Install dependencies
npm install

# Configure (edit config.json)
# Add your 2Captcha API key and proxy settings

# Start interactive CLI
npm start
```

---

### 🎮 Usage

#### Interactive CLI Mode
```bash
npm start
```

Select from menu:
- 🚀 **Single Account** - Create one account
- 🔥 **Batch Mode** - Create multiple accounts
- ♾️ **Infinite Loop** - Continuous account generation
- ❌ **Exit**

#### Direct Commands
```bash
# Single account
npm run single

# Multiple accounts
npm run multiple

# Infinite loop
npm run loop
```

---

### ⚙️ Configuration

Edit `config.json`:

```json
{
  "cloudflare_temp_email": {
    "api_url": "https://temp-email-api.awsl.uk"
  },
  "automation": {
    "headless": true,
    "timeout": 180000,
    "delay_between_accounts": 30
  },
  "proxy": {
    "enabled": true,
    "host": "your-proxy-host",
    "port": 32424,
    "username": "your-username",
    "password": "your-password"
  },
  "captcha": {
    "service": "2captcha",
    "api_key": "YOUR_2CAPTCHA_API_KEY"
  }
}
```

---

### 📊 Output Format

Accounts are saved to `data/accounts/account_[timestamp].json`:

```json
{
  "refreshToken": "...",
  "clientID": "...",
  "clientSecret": "...",
  "provider": "BuilderId"
}
```

**Kiro-Compatible** - Direct import into Kiro IDE!

---

### 🏗️ Architecture

```
┌─────────────────────────────────────────┐
│         Interactive CLI Menu            │
└──────────────┬──────────────────────────┘
               │
┌──────────────▼──────────────────────────┐
│      Account Generator Engine           │
│  ┌────────────────────────────────────┐ │
│  │  AWS OIDC Device Flow              │ │
│  │  • Client Registration             │ │
│  │  • Device Authorization            │ │
│  │  • Token Polling                   │ │
│  └────────────────────────────────────┘ │
│  ┌────────────────────────────────────┐ │
│  │  Puppeteer Stealth Automation      │ │
│  │  • Form Auto-Fill                  │ │
│  │  • Human-Like Behavior             │ │
│  │  • Cookie Management               │ │
│  └────────────────────────────────────┘ │
│  ┌────────────────────────────────────┐ │
│  │  Cloudflare Temp Email             │ │
│  │  • Email Generation                │ │
│  │  • Verification Code Extraction    │ │
│  │  • 2Captcha CF Bypass              │ │
│  └────────────────────────────────────┘ │
└─────────────────────────────────────────┘
```

---

### 🐛 Troubleshooting

**Q: Cloudflare blocking temp email API?**  
A: Add your 2Captcha API key to `config.json`

**Q: AWS blocking registration?**  
A: Enable proxy in `config.json` and use residential proxies

**Q: Browser timeout errors?**  
A: Increase `timeout` value in `config.json`

**Q: Verification code not found?**  
A: Check proxy settings - mail API needs working proxy

---

### 📄 License

MIT License - See [LICENSE](LICENSE) for details

---

## 中文

### ✨ 功能特性

#### 🎯 核心功能
- **🤖 全自动化** - 无需人工干预，完全自动化 AWS Builder ID 注册
- **📧 Cloudflare 临时邮箱** - 自动生成临时邮箱并提取验证码
- **🔐 OIDC Token 管理** - 自动 OAuth 设备流程和 Token 获取
- **🕵️ 隐身模式** - Puppeteer Stealth 插件绕过机器人检测
- **🌐 代理支持** - 内置代理轮换防止 IP 封禁
- **🔄 批量处理** - 可配置延迟的多账号创建

#### 🛡️ 高级功能
- **💾 JSON 导出** - 自动导出 Kiro 兼容格式的账号数据
- **🎨 交互式 CLI** - 精美的命令行界面和菜单导航
- **⚡ 高性能** - 速度和可靠性优化
- **🔧 可配置** - 通过 `config.json` 灵活配置

---

### 📦 安装

```bash
# 克隆仓库
git clone https://github.com/yourusername/aws-builder-id.git
cd aws-builder-id/automation

# 安装依赖
npm install

# 配置（编辑 config.json）
# 添加你的 2Captcha API key 和代理设置

# 启动交互式 CLI
npm start
```

---

### 🎮 使用方法

#### 交互式 CLI 模式
```bash
npm start
```

从菜单选择：
- 🚀 **单个账号** - 创建一个账号
- 🔥 **批量模式** - 创建多个账号
- ♾️ **无限循环** - 持续生成账号
- ❌ **退出**

#### 直接命令
```bash
# 单个账号
npm run single

# 多个账号
npm run multiple

# 无限循环
npm run loop
```

---

### ⚙️ 配置

编辑 `config.json`：

```json
{
  "cloudflare_temp_email": {
    "api_url": "https://temp-email-api.awsl.uk"
  },
  "automation": {
    "headless": true,
    "timeout": 180000,
    "delay_between_accounts": 30
  },
  "proxy": {
    "enabled": true,
    "host": "你的代理地址",
    "port": 32424,
    "username": "用户名",
    "password": "密码"
  },
  "captcha": {
    "service": "2captcha",
    "api_key": "你的_2CAPTCHA_API_KEY"
  }
}
```

---

### 📊 输出格式

账号保存到 `data/accounts/account_[时间戳].json`：

```json
{
  "refreshToken": "...",
  "clientID": "...",
  "clientSecret": "...",
  "provider": "BuilderId"
}
```

**Kiro 兼容** - 可直接导入 Kiro IDE！

---

### 🐛 常见问题

**Q: Cloudflare 阻止临时邮箱 API？**  
A: 在 `config.json` 中添加你的 2Captcha API key

**Q: AWS 阻止注册？**  
A: 在 `config.json` 中启用代理并使用住宅代理

**Q: 浏览器超时错误？**  
A: 增加 `config.json` 中的 `timeout` 值

**Q: 找不到验证码？**  
A: 检查代理设置 - 邮件 API 需要工作的代理

---

### 📄 许可证

MIT License - 详见 [LICENSE](LICENSE)

---

<div align="center">

**⭐ 如果这个项目对你有帮助，请给一个 Star！**

Made with ❤️ for the Kiro Community

</div>
