Skip to content

Latest commit

 

History

History
113 lines (85 loc) · 3.11 KB

File metadata and controls

113 lines (85 loc) · 3.11 KB

CLI Quick Start Guide | CLI 快速开始指南

🚀 5分钟快速上手 | 5-Minute Quick Start

第一步:生成测试账户 | Step 1: Generate Test Account

# 生成1个测试账户 | Generate 1 test account
python src/account_generator.py --num 1

# 查看生成的账户 | View generated account
cat output/accounts.csv

示例输出 | Example output:

username,password
sarah_martinez7891,K#9mX2$qR8pL

第二步:使用CLI注册 | Step 2: Register Using CLI

# 使用生成的账户信息 | Use the generated account info
python main.py --username sarah_martinez7891 --password 'K#9mX2$qR8pL'

预期结果 | Expected Result

成功 | Success:

Starting registration for account: sarah_martinez7891
Success

失败 | Failure:

Starting registration for account: sarah_martinez7891
Error: [具体错误信息]

📝 基本命令格式 | Basic Command Format

python main.py --username <用户名> --password <密码>

参数要求 | Parameter Requirements

  • 用户名 | Username: 非空字符串 | Non-empty string
  • 密码 | Password: 最少6个字符 | Minimum 6 characters

🔍 获取帮助 | Get Help

python main.py --help

⚡ 常用示例 | Common Examples

单次注册 | Single Registration

python main.py --username testuser123 --password mySecurePass123

检查退出码 | Check Exit Code

python main.py --username testuser123 --password mySecurePass123
echo "Exit code: $?"  # 0 = 成功, 1 = 失败

简单批量脚本 | Simple Batch Script

#!/bin/bash
# 读取accounts.csv并逐个注册 | Read accounts.csv and register one by one
tail -n +2 output/accounts.csv | while IFS=',' read -r username password; do
    echo "Registering: $username"
    python main.py --username "$username" --password "$password"
    sleep 2  # 等待2秒避免过快请求 | Wait 2 seconds to avoid rapid requests
done

🚨 重要提醒 | Important Reminders

  • 使用测试账户: 总是使用 src/account_generator.py 生成的测试账户

  • 避免真实账户: 不要使用真实的个人账户信息

  • ⏱️ 控制频率: 注册间隔2-3秒,避免被限制

  • Use Test Accounts: Always use accounts generated by src/account_generator.py

  • Avoid Real Accounts: Never use real personal account information

  • ⏱️ Control Frequency: Wait 2-3 seconds between registrations to avoid rate limiting

🔧 常见问题快速解决 | Quick Problem Solving

问题:浏览器启动失败 | Issue: Browser Launch Failed

playwright install  # 安装浏览器 | Install browsers

问题:模块找不到 | Issue: Module Not Found

cd /path/to/tanke_260_bot  # 确保在项目根目录 | Ensure in project root

问题:密码太短 | Issue: Password Too Short

# 密码必须至少6个字符 | Password must be at least 6 characters
python main.py --username test --password longerpassword123

需要更多帮助?| Need More Help?
查看完整文档: docs/cli-usage-guide.md