# hotmail-agent **Repository Path**: jerryzu/hotmail-agent ## Basic Information - **Project Name**: hotmail-agent - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-01-21 - **Last Updated**: 2026-01-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ๐Ÿš€ Hotmail Agent > Automated Hotmail/Outlook email backup system powered by Claude Code skills and agent-browser [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Node Version](https://img.shields.io/badge/node-%3E=18.0.0-brightgreen)](https://nodejs.org) [![agent-browser](https://img.shields.io/badge/agent--browser-installed-blue)](https://github.com/microsoft/playwright) ## ๐Ÿ“‹ Overview Hotmail Agent is a complete automation solution for backing up Hotmail/Outlook emails. It provides multiple ways to interact: - **CLI Tool** - Command-line interface for automation - **Claude Code Skills** - AI-powered workflow automation - **Slash Commands** - Quick one-command execution - **Programmatic API** - Integrate into your own projects ## โœจ Features - ๐Ÿ” **Automated Login** - Secure authentication with credentials - ๐Ÿ“ง **Batch Download** - Download all unread emails as HTML - ๐Ÿ“„ **HTML Preservation** - Keep original formatting and styles - ๐Ÿšช **Auto Logout** - Securely sign out after operations - ๐ŸŽฏ **Multiple Interfaces** - CLI, Skills, or API - ๐Ÿ“Š **Progress Tracking** - Real-time status updates - ๐Ÿ›ก๏ธ **Session Management** - Maintain browser state ## ๐Ÿš€ Quick Start ### Prerequisites ```bash # Install agent-browser globally npm install -g agent-browser # Install browser binaries agent-browser install ``` ### Installation ```bash # Clone or extract hotmail-agent cd hotmail-agent # Install dependencies npm install # Install Claude Code skills (optional) npm run install-skills ``` ### Usage #### Option 1: CLI (Recommended for automation) ```bash # Set credentials (or use -e and -p options) export HOTMAIL_EMAIL="your_email@hotmail.com" export HOTMAIL_PASSWORD="" # Run complete backup npm run backup # Or use CLI directly node src/cli.js backup # With custom credentials node src/cli.js backup -e your@email.com -p yourpassword ``` #### Option 2: Claude Code Skills ``` # Complete workflow ไฝฟ็”จ hotmail-workflow skill ๅฎŒๆˆ้‚ฎไปถๅค‡ไปฝ # Step by step ไฝฟ็”จ hotmail-login skill ็™ปๅฝ• ไฝฟ็”จ download-unread-emails skill ไธ‹่ฝฝ้‚ฎไปถ ไฝฟ็”จ hotmail-logout skill ้€€ๅ‡บ ``` #### Option 3: Slash Command ```bash # In Claude Code /hotmail-backup ``` ## ๐Ÿ“– Commands ### CLI Commands ```bash # Complete backup workflow hotmail-agent backup hotmail-agent backup -e your@email.com -p password # Individual operations hotmail-agent login # Login only hotmail-agent download # Download emails (requires active session) hotmail-agent logout # Logout only hotmail-agent status # Check status and configuration # Install Claude Code skills hotmail-agent install-skills ``` ### Options | Option | Alias | Description | Default | |--------|-------|-------------|---------| | `--email` | `-e` | Hotmail email address | HOTMAIL_EMAIL env var | | `--password` | `-p` | Hotmail password | HOTMAIL_PASSWORD env var | | `--session` | `-s` | Browser session name | `hotmail` | | `--verbose` | `-v` | Verbose output | `false` | | `--help` | `-h` | Show help | - | | `--version` | `-V` | Show version | - | ## ๐Ÿ“ Project Structure ``` hotmail-agent/ โ”œโ”€โ”€ package.json # Project configuration โ”œโ”€โ”€ README.md # This file โ”œโ”€โ”€ src/ โ”‚ โ”œโ”€โ”€ index.js # Main HotmailAgent class โ”‚ โ””โ”€โ”€ cli.js # CLI interface โ”œโ”€โ”€ skills/ # Claude Code skills โ”‚ โ”œโ”€โ”€ hotmail-login/ โ”‚ โ”œโ”€โ”€ download-unread-emails/ โ”‚ โ”œโ”€โ”€ hotmail-logout/ โ”‚ โ””โ”€โ”€ hotmail-workflow/ โ”œโ”€โ”€ commands/ # Slash commands โ”‚ โ””โ”€โ”€ hotmail-backup.md โ”œโ”€โ”€ examples/ # Usage examples โ”œโ”€โ”€ tests/ # Test files โ”œโ”€โ”€ docs/ # Additional documentation โ””โ”€โ”€ config/ # Configuration files ``` ## ๐Ÿ”ง Configuration ### Environment Variables Create a `.env` file or set environment variables: ```bash # Hotmail credentials HOTMAIL_EMAIL=your_email@hotmail.com HOTMAIL_PASSWORD= # Optional settings HOTMAIL_SESSION=hotmail NODE_ENV=production ``` ### Configuration File Create `config/hotmail.json`: ```json { "email": "your_email@hotmail.com", "password": "", "sessionName": "hotmail", "downloadDir": "./downloads", "maxEmails": 50, "timeout": 30000 } ``` ## ๐Ÿ“ Examples ### Basic Usage ```javascript const HotmailAgent = require('hotmail-agent'); // Create agent instance const agent = new HotmailAgent({ email: 'your_email@hotmail.com', password: '', verbose: true }); // Run complete backup const result = await agent.backup(); console.log(`Downloaded ${result.downloaded} emails`); ``` ### Advanced Usage ```javascript const HotmailAgent = require('hotmail-agent'); const agent = new HotmailAgent({ email: process.env.HOTMAIL_EMAIL, password: process.env.HOTMAIL_PASSWORD, sessionName: 'my-session', workingDir: './backups' }); // Step by step control try { await agent.login(); const emails = await agent.downloadEmails(); console.log(`Downloaded: ${emails.emails.join(', ')}`); await agent.logout(); } catch (error) { console.error('Backup failed:', error); await agent.close(); } ``` ### With Error Handling ```javascript const HotmailAgent = require('hotmail-agent'); async function backupWithRetry() { const agent = new HotmailAgent({ email: 'your@email.com', password: 'yourpassword', verbose: true }); try { const result = await agent.backup(); if (result.success) { console.log('โœ… Backup successful!'); console.log(`๐Ÿ“ง ${result.downloaded} emails downloaded`); console.log(`โฑ๏ธ Took ${result.duration} seconds`); } else { console.error('โŒ Backup failed:', result.error); } } catch (error) { console.error('๐Ÿ’ฅ Unexpected error:', error); } finally { await agent.close(); } } backupWithRetry(); ``` ## ๐Ÿงช Testing ```bash # Run tests npm test # Check status npm run status # Verify agent-browser installation agent-browser --version ``` ## ๐Ÿค Integration with Claude Code ### Skills Installation ```bash # Install skills to Claude Code npm run install-skills ``` Skills will be available in Claude Code: - `hotmail-login` - Login to Hotmail - `download-unread-emails` - Download unread emails - `hotmail-logout` - Logout from Hotmail - `hotmail-workflow` - Complete workflow ### Slash Command Install the command by copying `commands/hotmail-backup.md` to your Claude commands directory: ```bash mkdir -p ~/.claude/commands cp commands/hotmail-backup.md ~/.claude/commands/ ``` Then use in Claude Code: ``` /hotmail-backup ``` ## ๐Ÿ”’ Security - **Never commit credentials** to version control - Use environment variables for sensitive data - Consider using a password manager - Rotate passwords regularly - Use session-specific passwords when possible ## ๐Ÿ› Troubleshooting ### agent-browser not found ```bash npm install -g agent-browser agent-browser install ``` ### Login fails 1. Verify credentials are correct 2. Check for 2FA requirements 3. Try manual login first 4. Check network connectivity ### No emails downloaded 1. Check if there are unread emails 2. Verify session is active 3. Try running with `--verbose` flag 4. Check file permissions in download directory ### Session errors ```bash # Close existing sessions agent-browser --session hotmail close # Try again npm run backup ``` ## ๐Ÿ“Š Performance | Operation | Typical Time | |-----------|--------------| | Login | 5-10 seconds | | Download per email | 2-3 seconds | | Logout | 3-5 seconds | | Complete backup (10 emails) | ~60 seconds | ## ๐Ÿ—บ๏ธ Roadmap - [ ] Support for multiple accounts - [ ] Incremental backup (only new emails) - [ ] Email filtering by date/sender - [ ] Export to PDF/Text formats - [ ] Parallel email downloading - [ ] Web dashboard - [ ] Database storage option - [ ] Email categorization ## ๐Ÿ“„ License MIT License - see LICENSE file for details ## ๐Ÿ™ Acknowledgments - Built with [agent-browser](https://github.com/microsoft/agent-browser) - Powered by [Claude Code](https://claude.ai/code) - Uses [Playwright](https://playwright.dev/) under the hood ## ๐Ÿ“ง Support For issues and questions: - Check documentation in `docs/` - Review examples in `examples/` - Open an issue on GitHub ## ๐ŸŒŸ Contributing Contributions welcome! Please: 1. Fork the repository 2. Create a feature branch 3. Make your changes 4. Submit a pull request --- Made with โค๏ธ by Claude Code Assistant