feat: update README and package version; simplify bot startup process

This commit is contained in:
2025-11-15 17:27:28 +01:00
parent a4a248b236
commit 6f361e24e2
2 changed files with 55 additions and 88 deletions

134
README.md
View File

@@ -52,66 +52,47 @@ A **TypeScript bot** that automatically earns Microsoft Rewards points by comple
git clone https://github.com/LightZirconite/Microsoft-Rewards-Bot.git
cd Microsoft-Rewards-Bot
# 2. Install dependencies
npm install
# 3. Setup and run
npm run setup
# 2. Start the bot (does EVERYTHING automatically!)
npm start
```
**That's it!** The wizard will guide you through account setup and start earning points.
**That's literally it!** 🎉
The `npm start` command will automatically:
- ✅ Install dependencies if needed
- ✅ Install Chromium browser if needed
- ✅ Build TypeScript if needed
- ✅ Launch the bot
On first run, you'll be prompted to configure your accounts interactively.
---
## 🎮 Essential Commands
Here are the most useful commands for daily usage:
### **🚀 Main Commands**
| Command | Description |
|---------|-------------|
| `npm run go` | **⭐ Ultimate command** — Installs browser if needed, builds, and starts the bot |
| `npm start` | **Quick start** — Runs the bot (builds automatically if needed) |
| `npm run setup` | **Interactive wizard** — Guides you through initial setup |
| `npm run dev` | **Development mode** — Watch mode with auto-reload |
### **🔧 Build & Maintenance**
| Command | Description |
|---------|-------------|
| `npm run build` | Compile TypeScript to JavaScript (`dist/` folder) |
| `npm run typecheck` | Check TypeScript errors without building |
| `npm run clean` | Remove build artifacts (`dist/` folder) |
| `npm run install:browser` | Install Playwright Chromium (smart: only installs once) |
### **🎯 Specialized Tools**
| Command | Description |
|---------|-------------|
| `npm run dashboard` | Start web dashboard on `http://localhost:3000` |
| `npm run creator` | Launch account creation wizard |
| `npm run test` | Run test suite |
### **💡 Quick Recipes**
### **🚀 Main Command**
```bash
# First time setup
npm run go
# Daily usage (after first setup)
npm start
# Create new accounts
npm run creator -- -y backup@gmail.com https://rewards.bing.com/welcome?rh=CODE
# Monitor with dashboard
npm run dashboard
# Then open http://localhost:3000 in your browser
# Fix issues / rebuild
npm run clean ; npm run build
```
**The ONLY command you need!** Automatically handles:
- 📦 Dependencies installation (if missing)
- 🌐 Browser installation (if missing)
- 🔨 TypeScript compilation (if missing)
- ▶️ Bot execution
### **🔧 Optional Commands**
| Command | Use When |
|---------|----------|
| `npm run build` | Force rebuild TypeScript |
| `npm run clean` | Clean build artifacts before rebuild |
| `npm run dev` | Development mode (hot reload) |
| `npm run creator` | Create new Microsoft accounts |
| `npm run dashboard` | Start web dashboard on port 3000 |
| `npm test` | Run test suite |
**💡 Pro Tip:** For 99% of use cases, just use `npm start` — it's smart enough to figure out what needs to be done!
**📖 [Complete Commands Reference →](docs/commands.md)**
@@ -121,62 +102,53 @@ npm run clean ; npm run build
### **First-Time Setup** (New User)
```bash
# 1. Install dependencies
npm install
# 2. Run the ultimate setup command
npm run go
# This will guide you through account setup, install browser, build, and start!
```
### **Daily Usage** (Regular User)
```bash
# Just start the bot - it builds automatically if needed
# Just run this - it does EVERYTHING!
npm start
```
Or use the ultimate command if you want to be extra safe:
On first run:
1. ✅ Installs all dependencies automatically
2. ✅ Installs Chromium browser automatically
3. ✅ Builds the TypeScript project automatically
4. ✅ Prompts you to configure accounts
5. ✅ Starts earning points!
### **Daily Usage** (Regular User)
```bash
npm run go
# Same command - but skips already-done steps!
npm start
```
### **After Git Pull** (Updating the Bot)
### **After Git Pull** (Updating)
```bash
# Quick method (recommended)
npm run go
# Or manual method
npm install # Update dependencies (if package.json changed)
npm run build # Rebuild if code changed
npm start # Run
# Just this - it checks and updates what's needed
npm start
```
### **Creating New Accounts**
```bash
# Interactive mode (asks everything)
# Interactive mode
npm run creator
# Quick mode with recovery email + referral
# Quick mode with referral
npm run creator -- -y backup@gmail.com https://rewards.bing.com/welcome?rh=CODE
```
### **Troubleshooting** (When Things Break)
### **Troubleshooting** (Issues)
```bash
# Clean rebuild
npm run clean
npm run build
npm start
# Or full reset
rm -rf node_modules dist
npm install
npm run go
# Full reset (nuclear option)
rm -rf node_modules dist .playwright-chromium-installed
npm start
```
### **Monitoring** (Check Status)
### **Monitoring**
```bash
# Start web dashboard
npm run dashboard
# Then open http://localhost:3000
# Open http://localhost:3000
```
---

View File

@@ -1,6 +1,6 @@
{
"name": "microsoft-rewards-bot",
"version": "2.60.0",
"version": "2.60.1",
"description": "Automate Microsoft Rewards points collection",
"private": true,
"main": "index.js",
@@ -16,21 +16,16 @@
},
"homepage": "https://github.com/LightZirconite/Microsoft-Rewards-Bot#readme",
"scripts": {
"go": "node -e \"const fs = require('fs'); const cp = require('child_process'); console.log('🚀 Running complete setup and start...'); if (!fs.existsSync('.playwright-chromium-installed')) { console.log('📦 Installing Chromium...'); cp.execSync('npx playwright install chromium --with-deps', {stdio: 'inherit'}); fs.writeFileSync('.playwright-chromium-installed', new Date().toISOString()); } if (!fs.existsSync('dist/index.js')) { console.log('🔨 Building project...'); cp.execSync('npm run build', {stdio: 'inherit'}); } console.log('✅ Setup complete! Starting bot...'); cp.execSync('npm start', {stdio: 'inherit'});\"",
"start": "node -e \"const fs = require('fs'); const cp = require('child_process'); const path = require('path'); console.log('🚀 Starting Microsoft Rewards Bot...'); if (!fs.existsSync('node_modules')) { console.log('📦 Installing dependencies...'); cp.execSync('npm install', {stdio: 'inherit'}); } if (!fs.existsSync('.playwright-chromium-installed')) { console.log('🌐 Installing Chromium browser...'); cp.execSync('npx playwright install chromium --with-deps', {stdio: 'inherit'}); fs.writeFileSync('.playwright-chromium-installed', new Date().toISOString()); } if (!fs.existsSync('dist/index.js')) { console.log('🔨 Building TypeScript project...'); cp.execSync('npm run build', {stdio: 'inherit'}); } console.log('✅ All checks passed! Launching bot...\\n'); cp.execSync('node --enable-source-maps ./dist/index.js', {stdio: 'inherit'});\"",
"clean": "rimraf dist",
"typecheck": "tsc --noEmit",
"install:browser": "node -e \"const fs = require('fs'); if (!fs.existsSync('.playwright-chromium-installed')) { console.log('📦 Installing Chromium browser...'); require('child_process').execSync('npx playwright install chromium --with-deps', {stdio: 'inherit'}); fs.writeFileSync('.playwright-chromium-installed', new Date().toISOString()); } else { console.log('✓ Chromium already installed (use npm run install:browser:force to reinstall)'); }\"",
"install:browser:force": "npx playwright install chromium --with-deps",
"build": "tsc",
"build:clean": "npm run clean && npm run build",
"prestart": "node -e \"const fs = require('fs'); if (!fs.existsSync('dist/index.js')) { console.log('⚠️ Compiled files not found, building...'); require('child_process').execSync('npm run build', {stdio: 'inherit'}); }\"",
"start": "node --enable-source-maps ./dist/index.js",
"dev": "ts-node ./src/index.ts -dev",
"test": "node --test --require ts-node/register tests/**/*.test.ts",
"creator": "ts-node ./src/account-creation/cli.ts",
"dashboard": "node --enable-source-maps ./dist/index.js -dashboard",
"dashboard:dev": "ts-node ./src/index.ts -dashboard",
"setup": "node ./scripts/installer/setup.mjs",
"update": "node ./scripts/installer/update.mjs",
"lint": "eslint \"src/**/*.{ts,tsx}\"",
"lint:fix": "eslint \"src/**/*.{ts,tsx}\" --fix",