๐ฑ CLI automation tool for Kiro & Cloudflare token harvesting with parallel workers and detailed reporting
Automated CLI tool for harvesting Kiro refresh tokens, Cloudflare Workers AI API tokens, and Codebuddy AI OAuth tokens using Puppeteer. Features multi-worker parallel processing, proxy pool management, detailed per-account reporting, and comprehensive error tracking.

ROUTER_URLhttp://127.0.0.1:20128/# Clone the repository
git clone https://github.com/fzrilsh/bercocok-tanam
cd bercocok-tanam
# Install dependencies
npm install
# Create accounts file
echo "email@example.com|password123" > accounts.txt
# (Optional) Configure settings
cp .env.example .env
# Edit .env with your settings
Create a .env file in the project root:
ROUTER_URL=http://your-router-url:20128/
PW_HEADLESS=1
BROWSER_COUNT=4
BROWSER_SLOW_MO=2
CHROME_EXECUTABLE_PATH=/path/to/chrome
ACCOUNT_FILE=accounts.txt
RESULT_FILE={provider}_keys.txt
ERROR_ACCOUNT_FILE=errorAccounts.txt
PROXY_POOL_FILE=proxy_keys.txt
DELAY_BEFORE_NEXT_CLICK_MS=1000
DELAY_BETWEEN_ACCOUNTS_MS=3000
DELAY_BEFORE_BROWSER_CLOSE_MS=3000
DELAY_BEFORE_READING_COOKIES_MS=5000
TIMEOUT_NAVIGATION_MS=60000
TIMEOUT_DEFAULT_MS=15000
TIMEOUT_SHORT_MS=10000
| Variable | Description | Default |
|---|---|---|
ROUTER_URL |
9Router endpoint for token import | http://127.0.0.1:20128/ |
PW_HEADLESS |
1 = headless, 0 = visible browser |
1 |
BROWSER_COUNT |
Number of parallel browser instances | 1 |
BROWSER_SLOW_MO |
Delay between browser actions (ms) | 2 |
CHROME_EXECUTABLE_PATH |
Path to Chrome/Chromium executable | Auto-detect |
ACCOUNT_FILE |
Path to accounts file | accounts.txt |
RESULT_FILE |
The system automatically replaces {provider} with the automation name (kiro, cloudflare, or proxy) |
{provider}_keys.txt |
ERROR_ACCOUNT_FILE |
Log file for failed accounts | errorAccounts.txt |
PROXY_POOL_FILE |
Shared proxy pool file (optional) - workers auto-pick available proxies | proxy_keys.txt |
DELAY_BEFORE_NEXT_CLICK_MS |
Delay before next click action | 1000 |
DELAY_BETWEEN_ACCOUNTS_MS |
Delay between processing accounts | 3000 |
DELAY_BEFORE_BROWSER_CLOSE_MS |
Delay before closing browser | 3000 |
DELAY_BEFORE_READING_COOKIES_MS |
Delay before reading cookies | 5000 |
TIMEOUT_NAVIGATION_MS |
Page navigation timeout | 60000 |
TIMEOUT_DEFAULT_MS |
Default element wait timeout | 15000 |
TIMEOUT_SHORT_MS |
Short element wait timeout | 10000 |
Create accounts.txt with one account per line:
user1@gmail.com|password123
user2@gmail.com|password456
user3@gmail.com|password789|http://proxy-server:8080
user4@gmail.com|password321|http://user:pass@proxy:8080
Format Rules:
| (pipe)# are commentsInstead of specifying proxies per account, you can use a shared proxy pool. Create a proxy pool file (e.g., proxy_keys.txt):
191.96.254.138:6185:username:password
45.38.107.97:6014:username:password
198.105.121.200:6462:username:password
Format: ip:port:username:password (one proxy per line)
http://user:pass@host:port formatHow it works:
Important:
Enable by setting PROXY_POOL_FILE=proxy_keys.txt in .env
# Start the CLI
npm start
# Choose from menu:
# 1. ๐ Kiro Automation
# 2. โ๏ธ Cloudflare Automation
# 3. ๐ค Codebuddy Automation [BETA] (โ ๏ธ Requires Residential Proxy)
# 4. ๐ All-in-One Automation
# 5. โ๏ธ Settings
# 6. ๐ช Exit
If you modify accounts.txt while at the menu, the system will detect changes when you start an automation:
? Account file changed: 5 โ 3 accounts. Continue with automation? (Y/n)
Y to proceed with the new account listn to return to menu and review changesAfter each automation run, youโll see a detailed report:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฑ KIRO AUTOMATION REPORT
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ OVERALL SUMMARY
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Total Accounts : 10
โ
Success : 8 accounts
โ Failed : 2 accounts
Success Rate : 80.0%
Total Duration : 5m 23s
Average per Account : 32.3s
๐ท WORKER DETAILS
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Kiro W1
Processed: 5 accounts | โ
4 | โ 1
Average: 31.2s/account
Accounts:
โ
user1@gmail.com 28.5s
โ
user2@gmail.com 35.1s
โ user3@gmail.com 29.8s
โ
user4@gmail.com 30.2s
โ
user5@gmail.com 32.4s
โ FAILED ACCOUNTS
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โข user3@gmail.com
Error: RefreshToken cookie not found
๐ก Check errorAccounts.txt for complete details
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
{provider}_keys.txt - Token output files, generated per automation:
kiro_keys.txt โ Kiro refresh tokens (format: email|refreshToken)cloudflare_keys.txt โ Cloudflare Workers AI API tokenscodebuddy_keys.txt โ Codebuddy OAuth tokens (auto-imported to 9Router, no local save)errorAccounts.txt - Failed accounts with error messages, timestamps, and automation typelogs/ - Detailed execution logs with timestampsemail|password | Kiro | 2026-07-10T14:23:45.123Z | RefreshToken cookie not found
email|password | Cloudflare | 2026-07-10T14:25:12.456Z | Account ID not found
bercocok-tanam/
โโโ index.js # Main entry point with menu system
โโโ src/
โ โโโ browser.js # Browser launching with stealth mode
โ โโโ cloudflare.js # Cloudflare token harvesting logic
โ โโโ codebuddy.js # Codebuddy OAuth token harvesting logic
โ โโโ config.js # Configuration management
โ โโโ google-login.js # Google authentication helpers
โ โโโ kiro.js # Kiro token harvesting logic
โ โโโ progress.js # Progress bar and status display
โ โโโ reporter.js # Report generation and formatting
โ โโโ settings.js # Interactive settings menu
โ โโโ utils.js # Utility functions and helpers
โโโ assets/
โ โโโ screenshot.png # CLI screenshot
โโโ accounts.txt # Account list (user-created)
โโโ kiro_keys.txt # Kiro tokens output (auto-generated)
โโโ cloudflare_keys.txt # Cloudflare tokens output (auto-generated)
โโโ codebuddy_keys.txt # Codebuddy tokens output (not saved, auto-imported)
โโโ errorAccounts.txt # Failed accounts log
โโโ logs/ # Execution logs
โโโ .env # Configuration (user-created)
โโโ eslint.config.js # ESLint configuration
โโโ package.json # Dependencies and scripts
accounts.txt format: email|password or email|password|proxy| separator# for comments.envPermission error when launching Chrome. Common causes:
/Applications/Google Chrome.app is the app bundle, not the executableCHROME_EXECUTABLE_PATH="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
/Applications/Chromium.app/Contents/MacOS/Chromium/Applications/Brave Browser.app/Contents/MacOS/Brave BrowserCHROME_EXECUTABLE_PATH empty โ Puppeteer auto-detects bundled Chromiumls -l "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
# Should show: -rwxr-xr-x (x = executable bit)
xattr -d com.apple.quarantine "/Applications/Google Chrome.app"
ROUTER_URL in .env or settingscurl http://127.0.0.1:20128/http://host:port or http://user:pass@host:portBROWSER_COUNT (fewer parallel instances)ISC
Fazril Syaveral Hillaby
Special thanks to the open-source community for making automation tools accessible.
Contributions welcome! Please ensure:
For security vulnerabilities, please email directly instead of opening a public issue.
See commit history for detailed changes.
Built with โค๏ธ for automation efficiency