# 1337.legal Command-Line Tool
A comprehensive CLI tool for managing your 1337.legal account and email aliases from the terminal.
- 🔐 Authentication: Register, login, and manage your account
- 📧 Alias Management: Create, list, update, and delete email aliases
- 🔒 End-to-End Encryption: Client-side encryption of sensitive data
- ⚙️ Configuration: Customize API endpoints and settings
- 🎨 Beautiful CLI: Colorful and interactive command-line interface
- Bun runtime installed
cd command-line-tool
bun installbun run buildnpm linkNow you can use 1337legal command globally.
1337legal auth register
# Or with options
1337legal auth register --email user@example.com --password yourpassword1337legal auth login
# Or with options
1337legal auth login --email user@example.com --password yourpassword1337legal auth status1337legal auth logout1337legal alias list
# Or
1337legal alias ls1337legal alias create
# Or with description
1337legal alias create --description "For newsletter signups"1337legal alias get <aliasId># Update description
1337legal alias update <aliasId> --description "New description"
# Disable alias
1337legal alias update <aliasId> --active false
# Enable alias
1337legal alias update <aliasId> --active true1337legal alias delete <aliasId>
# Or skip confirmation
1337legal alias delete <aliasId> --yes1337legal config api-url https://api.1337.legal1337legal config set <key> <value>1337legal config get <key>1337legal config list1337legal config delete <key>1337legal config clearHandles all cryptographic operations:
- Password hashing with PBKDF2
- AES-256-GCM encryption/decryption
- Master key derivation
- Challenge signing
- Secure token generation
Manages user session and authentication state:
- Stores session data securely
- Token management (access/refresh)
- Session validation
- Encrypted local storage using Conf
Handles all API communication:
- RESTful API client with Axios
- Automatic token refresh
- Request/response interceptors
- Authentication endpoints
- Alias management endpoints
- Error handling
- auth: User authentication (register, login, logout, status)
- alias: Email alias management (create, list, get, update, delete)
- config: CLI configuration management
-
Master Key Derivation: User password is never sent to the server
- Salt is generated client-side during registration
- Master key is derived using PBKDF2 (100,000 iterations)
- Only the hash of the master key is sent to the server
-
Data Encryption: Sensitive data is encrypted before storage
- AES-256-GCM encryption
- Unique IV for each encryption operation
- Authentication tags for integrity verification
-
Session Security:
- Access tokens with automatic refresh
- Encrypted local session storage
- Automatic session expiration
- Never share your master password
- Use a strong, unique password (minimum 8 characters)
- Keep your CLI and dependencies updated
- Use HTTPS endpoints only
bun run devbun run buildcommand-line-tool/
├── src/
│ ├── commands/ # CLI command implementations
│ │ ├── auth.ts # Authentication commands
│ │ ├── alias.ts # Alias management commands
│ │ └── config.ts # Configuration commands
│ ├── services/ # Service layer
│ │ ├── BackendService.ts # API client
│ │ ├── CryptoService.ts # Cryptography
│ │ └── SessionService.ts # Session management
│ ├── types/ # TypeScript type definitions
│ │ └── globals.d.ts
│ └── main.ts # CLI entry point
├── package.json
├── tsconfig.json
└── README.md
The CLI communicates with the 1337.legal backend API. Default endpoints:
- Base URL:
https://api.1337.legal - Auth:
/auth/* - User:
/user/* - Alias:
/alias/*
You can customize the API URL:
1337legal config api-url https://your-custom-api.comIf you're having trouble logging in:
- Check your internet connection
- Verify the API URL is correct:
1337legal config get apiUrl - Check authentication status:
1337legal auth status - Try logging out and back in:
1337legal auth logout && 1337legal auth login
If you get "Session expired" errors:
1337legal auth loginThe CLI will automatically attempt to refresh your token, but if that fails, you'll need to log in again.
If you need to start fresh:
1337legal auth logout
1337legal config clearContributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
MIT License - See LICENSE file for details
- Documentation: https://1337.legal/docs
- Email: support@1337.legal
- Issues: https://github.com/1337legal/cli/issues
- Initial release
- Authentication system with client-side encryption
- Alias management (CRUD operations)
- Configuration management
- Beautiful CLI with colors and spinners
- Automatic token refresh
- Secure session management