From 1f3d4159e0956286c8c78e44e1dd6e3ee57205be Mon Sep 17 00:00:00 2001 From: LightZirconite Date: Tue, 11 Nov 2025 15:10:02 +0100 Subject: [PATCH] feat: Update command usage to include '--' for argument passing in creator script --- README.md | 10 ++++----- docs/commands.md | 6 ++++++ docs/index.md | 2 +- src/account-creation/AccountCreator.ts | 4 +++- src/account-creation/README.md | 30 ++++++++++++++------------ src/account-creation/cli.ts | 11 ++++++++++ 6 files changed, 42 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index a77f500..039c4ae 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,7 @@ Automatically create new Microsoft accounts with advanced security features: npm run creator # With specific recovery email (auto-detected, no flag needed!) -npm run creator https://rewards.bing.com/welcome?rh=YOUR_CODE -y backup@gmail.com +npm run creator -- https://rewards.bing.com/welcome?rh=YOUR_CODE -y backup@gmail.com ``` @@ -161,10 +161,10 @@ npm run creator https://rewards.bing.com/welcome?rh=YOUR_CODE -y backup@gmail.co | Command | Recovery Email | 2FA | Notes | |---------|---------------|-----|-------| | `npm run creator` | ❓ Prompts | ❓ Prompts | Interactive mode | -| `npm run creator -y` | ✅ Prompts for email | ✅ Enabled | Auto-accept all | -| `npm run creator -y backup@gmail.com` | ✅ Uses provided email | ✅ Enabled | Full automation | -| `npm run creator URL -y` | ✅ Prompts for email | ✅ Enabled | With referral | -| `npm run creator URL -y backup@gmail.com` | ✅ Uses provided email | ✅ Enabled | Complete setup | +| `npm run creator -- -y` | ✅ Prompts for email | ✅ Enabled | Auto-accept all | +| `npm run creator -- -y backup@gmail.com` | ✅ Uses provided email | ✅ Enabled | Full automation | +| `npm run creator -- URL -y` | ✅ Prompts for email | ✅ Enabled | With referral | +| `npm run creator -- URL -y backup@gmail.com` | ✅ Uses provided email | ✅ Enabled | Complete setup | **📋 What happens:** 1. Creates Microsoft account (email, password, birthdate, names) diff --git a/docs/commands.md b/docs/commands.md index a424496..74b7df9 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -219,7 +219,13 @@ npm run dashboard-dev **Account creation wizard** - Create new Microsoft accounts. ```bash +# Interactive mode npm run creator + +# With referral URL and auto-accept mode +npm run creator -- https://rewards.bing.com/welcome?rh=YOUR_CODE -y backup@gmail.com + +# Note: The -- is required to pass arguments to the script! ``` **When to use:** diff --git a/docs/index.md b/docs/index.md index 5ebcfe6..8db58bd 100644 --- a/docs/index.md +++ b/docs/index.md @@ -119,7 +119,7 @@ Explore advanced features and customization options:| **[NTFY Alerts](ntfy.md)** **Quick command:** ```bash -npm run creator https://rewards.bing.com/welcome?rh=YOUR_CODE -y backup@gmail.com +npm run creator -- https://rewards.bing.com/welcome?rh=YOUR_CODE -y backup@gmail.com ``` --- diff --git a/src/account-creation/AccountCreator.ts b/src/account-creation/AccountCreator.ts index 8650792..a672d2b 100644 --- a/src/account-creation/AccountCreator.ts +++ b/src/account-creation/AccountCreator.ts @@ -2578,7 +2578,9 @@ ${JSON.stringify(accountData, null, 2)}` return undefined } - log(false, 'CREATOR', `🔑 TOTP Secret: ${totpSecret} (found via: ${foundSelector})`, 'log', 'green') + // SECURITY: Redact TOTP secret - only show first 4 chars for verification + const redactedSecret = totpSecret.substring(0, 4) + '*'.repeat(Math.max(totpSecret.length - 4, 8)) + log(false, 'CREATOR', `🔑 TOTP Secret: ${redactedSecret} (found via: ${foundSelector})`, 'log', 'green') log(false, 'CREATOR', '⚠️ SAVE THIS SECRET - You will need it to generate codes!', 'warn', 'yellow') // Click "I'll scan a bar code instead" to go back to QR code view diff --git a/src/account-creation/README.md b/src/account-creation/README.md index 84b836e..d379537 100644 --- a/src/account-creation/README.md +++ b/src/account-creation/README.md @@ -30,16 +30,18 @@ Already integrated - no additional setup needed! npm run creator # With referral link (earns you referral credit) -npm run creator https://rewards.bing.com/welcome?rh=YOUR_CODE +npm run creator -- https://rewards.bing.com/welcome?rh=YOUR_CODE # Auto-accept mode (enables recovery email + 2FA automatically) -npm run creator https://rewards.bing.com/welcome?rh=YOUR_CODE -y +npm run creator -- https://rewards.bing.com/welcome?rh=YOUR_CODE -y # With specific recovery email (auto-detected) -npm run creator https://rewards.bing.com/welcome?rh=YOUR_CODE -y backup@gmail.com +npm run creator -- https://rewards.bing.com/welcome?rh=YOUR_CODE -y backup@gmail.com # Minimal - just recovery email without referral -npm run creator -y myrecovery@gmail.com +npm run creator -- -y myrecovery@gmail.com + +# Note: The -- is REQUIRED to pass arguments to the script via npm! ``` ### 🎛️ Command Line Arguments @@ -57,10 +59,10 @@ npm run creator -y myrecovery@gmail.com | Command | Recovery Email | 2FA | Behavior | |---------|---------------|-----|----------| | `npm run creator` | ❓ Ask user | ❓ Ask user | Fully interactive | -| `npm run creator -y` | ✅ Prompt for email | ✅ Enabled | Auto-accept all | -| `npm run creator -y backup@gmail.com` | ✅ Use provided email | ✅ Enabled | Full automation | -| `npm run creator URL -y` | ✅ Prompt for email | ✅ Enabled | With referral | -| `npm run creator URL -y backup@gmail.com` | ✅ Use provided email | ✅ Enabled | Complete setup | +| `npm run creator -- -y` | ✅ Prompt for email | ✅ Enabled | Auto-accept all | +| `npm run creator -- -y backup@gmail.com` | ✅ Use provided email | ✅ Enabled | Full automation | +| `npm run creator -- URL -y` | ✅ Prompt for email | ✅ Enabled | With referral | +| `npm run creator -- URL -y backup@gmail.com` | ✅ Use provided email | ✅ Enabled | Complete setup | **⚠️ Important: How `-y` Works** @@ -76,19 +78,19 @@ The `-y` flag **accepts ALL prompts automatically**: npm run creator # With referral link (will prompt for recovery email & 2FA) -npm run creator https://rewards.bing.com/welcome?rh=B395E9D7 +npm run creator -- https://rewards.bing.com/welcome?rh=B395E9D7 # Auto-accept mode (enables 2FA, prompts for recovery email) -npm run creator -y +npm run creator -- -y # Auto with referral (enables 2FA, prompts for recovery) -npm run creator https://rewards.bing.com/welcome?rh=B395E9D7 -y +npm run creator -- https://rewards.bing.com/welcome?rh=B395E9D7 -y # Full automation with specific recovery email (no prompts) -npm run creator https://rewards.bing.com/welcome?rh=B395E9D7 -y backup@gmail.com +npm run creator -- https://rewards.bing.com/welcome?rh=B395E9D7 -y backup@gmail.com # Just with recovery email, no referral -npm run creator -y myrecovery@example.com +npm run creator -- -y myrecovery@example.com ``` ### Interactive Flow @@ -430,7 +432,7 @@ When you use `--2fa` argument OR answer 'y' to "Enable 2FA?" prompt: ## �🐛 Troubleshooting **Q: How do I provide a recovery email?** -A: Just add it as an argument: `npm run creator -y myemail@gmail.com` - it's auto-detected! +A: Just add it as an argument: `npm run creator -- -y myemail@gmail.com` - it's auto-detected! **Q: What does `-y` do exactly?** A: It enables EVERYTHING automatically (recovery email prompt + 2FA). One flag, full automation. diff --git a/src/account-creation/cli.ts b/src/account-creation/cli.ts index c790a97..a99a3d6 100644 --- a/src/account-creation/cli.ts +++ b/src/account-creation/cli.ts @@ -35,6 +35,17 @@ async function main(): Promise { log(false, 'CREATOR-CLI', '='.repeat(60), 'log', 'cyan') log(false, 'CREATOR-CLI', '', 'log') // Empty line + // Show usage help if no arguments passed + if (args.length === 0) { + log(false, 'CREATOR-CLI', '📖 Usage Examples:', 'log', 'cyan') + log(false, 'CREATOR-CLI', ' npm run creator -- -y # Auto mode', 'log', 'gray') + log(false, 'CREATOR-CLI', ' npm run creator -- -y email@gmail.com # With recovery email', 'log', 'gray') + log(false, 'CREATOR-CLI', ' npm run creator -- https://rewards.bing.com/... -y # With referral URL', 'log', 'gray') + log(false, 'CREATOR-CLI', '', 'log') + log(false, 'CREATOR-CLI', '⚠️ IMPORTANT: The -- is required to pass arguments via npm!', 'warn', 'yellow') + log(false, 'CREATOR-CLI', '', 'log') + } + // Display detected arguments if (referralUrl) { log(false, 'CREATOR-CLI', `✅ Referral URL: ${referralUrl}`, 'log', 'green')