@kingworks/deploy-cli
v1.1.3
Published
Zero-configuration CLI tool for deploying to dual-region CDN infrastructure
Readme
@kingworks/deploy-cli
Zero-configuration CLI tool for deploying web applications to dual-region CDN infrastructure (China and Malaysia).
Features
- Zero configuration - automatically detects project name from git
- Dual-region deployment - deploys to CN and MY regions in parallel
- Secure authentication - Feishu OAuth with automatic token refresh
- Deployment tracking - complete audit trail of all deployments
- Fast uploads - uses STS tokens and parallel uploads
Installation
npm install -g @kingworks/deploy-cliNo additional packages needed. 🎉
Configuration
After installation, you need to configure the CLI:
Quick Setup (Recommended)
# Create global configuration
mkdir -p ~/.deploy-cli
cat > ~/.deploy-cli/.env << EOF
DEPLOY_API_URL=https://your-api-url.com
FEISHU_CLIENT_ID=cli_your_id
EOFRequired Configuration
DEPLOY_API_URL- Your backend API URL (required)FEISHU_CLIENT_ID- Feishu OAuth Client ID (optional, defaults tocli_xxx)
You only need DEPLOY_API_URL. FEISHU_CLIENT_ID is optional.
Usage
First-time setup
# Login with Feishu
deploy loginDeploy to environments
# Deploy to test environment
deploy test
# Deploy to pre-release environment
deploy pre
# Deploy to production environment
deploy prodLogout
deploy logoutRequirements
- Node.js 18 or higher
- Git repository
- Built application in
./dist/directory - Feishu account with deployment permissions
How it works
- Detects project name from git repository
- Validates authentication token (auto-refreshes if needed)
- Requests STS tokens from backend for both CN and MY regions
- Uploads files to both regions in parallel
- Reports deployment results to backend
- Displays CDN URLs for both regions
Environment Variables
DEPLOY_ENV: Set tolocalfor local development (default: production)
License
MIT
Documentation
Run deploy --help to view the full Chinese command help.
