A delightful, reliable, and multi-environment friendly CLI tool for frontend deployment via SSH with i18n support.
npm install happy-uploadA delightful, reliable, and multi-environment friendly CLI tool for frontend deployment via SSH.


- 🌍 Internationalization (i18n): Supports English (en-US) and Chinese (zh-CN) with auto-detection.
- 🌳 Multi-Environment: Manage dev, prod, staging environments in one config.
- � Atomic Rollback: One-command rollback to any previous version.
- 🛠 Zero Configuration Start: Interactive init to generate templates.
- � Smart Compression: Auto-zip local assets with progress visualization.
- � Zero-Downtime: Atomic switch implementation (upload -> unzip -> switch).
- 🤖 CI/CD Ready: Full support for CLI arguments to override config/secrets.
- 🧹 Auto Cleanup: Automatically rotate backups to save disk space.
``bash`
npm install -g happy-upload
Run in your project root:
`bash`
happy-upload init
This generates a happy-deploy.config.js.
Supports standard JS config with Environment isolation:
`javascript
export default {
// Interface Language (zh-CN | en-US)
lang: 'zh-CN',
// Common defaults
default: {
port: 22,
distPath: './dist',
remotePath: '/var/www/project',
maxHistory: 5,
},
// Environments
envs: {
dev: {
host: '192.168.1.100',
username: 'root',
privateKey: '/path/to/dev.key',
},
prod: {
host: '1.2.3.4',
username: 'admin',
// CI/CD tip: Don't commit passwords! Use CLI args or env vars instead.
}
}
};
`
Deploy to default environment (or interactive select if multiple exist):
`bash`
happy-upload upload
Deploy to specific environment:
`bash`
happy-upload upload --env prod
CI/CD Mode (Non-interactive):
`bash`Inject secrets via CLI args to avoid hardcoding in file
happy-upload upload --env prod --yes --password $DEPLOY_PASS
Mistake happened? Rollback instantly:
`bash`
happy-upload rollback
Interactive menu lets you choose which version to restore.
`bash`
happy-upload languageor
happy-upload --lang en-US
| Command | Description |
| :--- | :--- |
| init | Generate configuration file |upload
| | Deploy project (supports --env, --yes) |rollback
| | Rollback to previous version |language
| | Switch interface language |--help
| | Show help info |
- --lang : Force interface language (e.g., zh-CN, en-US).
Priority: CLI Args > Config File
- -e, --env : Target environment key-y, --yes
- : Skip confirmation prompts--host
- --username
- --password
- --private-key
- --dist-path
- --remote-path
-
- Node.js >= 18.0.0
- Target Server: Linux with SSH access (unzip required)
ISC