A complete reference for setting up prerequisites, generating provider tokens, saving local credentials, configuring GitHub repository secrets, and running verification tests.
# Node.js (if not already installed)
winget install OpenJS.NodeJS.LTS
# GitHub CLI (for setting repository secrets)
winget install GitHub.cli
gh auth logingit clone https://github.com/MR-1124/deploy-cli.git
cd deploy-cli
npm install- Go to Netlify Personal Access Tokens.
- Click New access token → name it
deploy-cli→ Generate token → copy it.
- Go to Vercel Account Tokens.
- Click Create → name it
deploy-cli→ copy it. - Also grab your Team ID from https://vercel.com/dashboard → Settings → General → Team ID (if using a team).
- Go to Cloudflare API Tokens → Create Token → Custom token.
- Permission:
Cloudflare Pages→Edit. - Account Resources: Include → All accounts.
- Zone Resources: default (
All zones). - Create → copy token.
- Account ID: located in the right sidebar of any dashboard page, or via:
Copy the
curl -s "https://api.cloudflare.com/client/v4/accounts" -H "Authorization: Bearer <TOKEN>"
idfield from your account in the response.
- IAM → Users → Create user (e.g.
deploy-cli) → Attach inline policy:{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": ["s3:PutObject", "s3:GetObject"], "Resource": "arn:aws:s3:::YOUR-BUCKET/*" }, { "Effect": "Allow", "Action": ["s3:ListBucket"], "Resource": "arn:aws:s3:::YOUR-BUCKET" } ] } - User → Security credentials → Create access key → copy Access key ID + Secret access key.
- S3 → Create bucket → note the region (e.g.
us-east-1). - Bucket → Permissions → Block public access → uncheck all → Save.
- Bucket policy:
{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Principal": "*", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::YOUR-BUCKET/*" }] }
# Netlify
node cli.js login --provider netlify --token <YOUR_NETLIFY_TOKEN>
# Vercel (without or with team)
node cli.js login --provider vercel --token <YOUR_VERCEL_TOKEN>
node cli.js login --provider vercel --token <YOUR_VERCEL_TOKEN> --team <TEAM_ID>
# Cloudflare
node cli.js login --provider cloudflare --token <YOUR_CF_TOKEN> --account <YOUR_ACCOUNT_ID>
# S3
node cli.js login --provider s3 --access-key <AK> --secret-key <SK> --bucket <BUCKET_NAME> --region us-east-1Verify everything:
node cli.js doctor# If not already authenticated:
gh auth login
# One by one (each prompts for the value — paste, don't type):
gh secret set NPM_TOKEN -R MR-1124/deploy-cli
gh secret set NETLIFY_AUTH_TOKEN -R MR-1124/deploy-cli
gh secret set VERCEL_TOKEN -R MR-1124/deploy-cli
gh secret set CLOUDFLARE_API_TOKEN -R MR-1124/deploy-cli
gh secret set CLOUDFLARE_ACCOUNT_ID -R MR-1124/deploy-cli
gh secret set AWS_ACCESS_KEY_ID -R MR-1124/deploy-cli
gh secret set AWS_SECRET_ACCESS_KEY -R MR-1124/deploy-cli
gh secret set SMOKE_S3_BUCKET -R MR-1124/deploy-cli
gh secret set AWS_REGION -R MR-1124/deploy-cli# Local smoke test (uses saved credentials from deploy login)
npm run smoke
# Full health check
node cli.js doctor| Provider | Env var (GitHub Actions) | Also via deploy login |
|---|---|---|
| Netlify | NETLIFY_AUTH_TOKEN |
--provider netlify --token |
| Vercel | VERCEL_TOKEN |
--provider vercel --token |
| Cloudflare | CLOUDFLARE_API_TOKEN + CLOUDFLARE_ACCOUNT_ID |
--provider cloudflare --token --account |
| AWS | AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY + SMOKE_S3_BUCKET + AWS_REGION |
--provider s3 --access-key --secret-key --bucket --region |
| npm | NPM_TOKEN |
manual: npm config set //registry.npmjs.org/:_authToken=<token> |
Note
deploy login commands save to ~/.deploy-cli/config.json, so after a reset you only run them once and every future npm run smoke or deploy up works from any shell.