@redredchen01/deploy-tools
v1.0.0
Published
Deployment management CLI — deploy, rollback, promote, canary, status, history, config
Maintainers
Readme
@redredchen01/deploy-tools
Deployment management CLI — deploy, rollback, promote, canary, status, history, config
Install
npm install -g @redredchen01/deploy-toolsQuick Start
# Initialize deploy config
deploy-tools config init
# Edit .deployrc to set your environments
deploy-tools config set staging_target [email protected]:/var/www/app
deploy-tools config set production_target [email protected]:/var/www/app
# Deploy to staging
deploy-tools deploy --source ./dist --target [email protected]:/var/www/app
# Check status
deploy-tools status
# Promote staging to production
deploy-tools promote
# View history
deploy-tools historyCommands
deploy — Deploy to remote server
Deploy a local directory to a remote server via rsync over SSH. Records each deployment to .deploy-history.
deploy-tools deploy --target [email protected]:/var/www/app
deploy-tools deploy --source ./dist --target user@host:/app --exclude node_modules
deploy-tools deploy --target user@host:/app --dry-run
deploy-tools deploy --target user@host:/app --exclude '*.log' --exclude '.git'Options: --source DIR, --target USER@HOST:PATH, --exclude PATTERN (repeatable), --dry-run, --env ENV, --json
rollback — Rollback to previous version
Rollback to a previous deployment by re-running rsync with the previously recorded source directory. Reads .deploy-history.
deploy-tools rollback --target [email protected]:/var/www/app
deploy-tools rollback --target user@host:/app --steps 2
deploy-tools rollback --target user@host:/app --env productionOptions: --target USER@HOST:PATH, --steps N, --env ENV, --dry-run, --json
promote — Promote environment
Promote one environment to another using targets configured in .deployrc. Requires triple confirmation for production unless --force is used.
deploy-tools promote
deploy-tools promote --from staging --to production
deploy-tools promote --config ./deploy/.deployrc --force # CI usageOptions: --from ENV, --to ENV, --config FILE, --force, --dry-run, --json
canary — Canary release
Deploy to a percentage of servers from a server list file (one USER@HOST:PATH per line).
deploy-tools canary --servers ./servers.txt
deploy-tools canary --source ./dist --servers ./servers.txt --percent 25
deploy-tools canary --servers ./servers.txt --percent 100 --dry-runOptions: --source DIR, --servers FILE, --percent N, --dry-run, --json
status — Environment status
Show current deployment status for each environment defined in .deployrc, with last deploy timestamp.
deploy-tools status
deploy-tools status --config ./deploy/.deployrc
deploy-tools status --jsonOptions: --config FILE, --json
history — Deployment history
Show deployment history from .deploy-history file.
deploy-tools history
deploy-tools history --limit 20
deploy-tools history --env production
deploy-tools history --env staging --limit 5 --jsonOptions: --limit N, --env ENV, --json
config — Manage .deployrc
Manage the deploy configuration file.
deploy-tools config init # create template
deploy-tools config show # print config
deploy-tools config set staging_target user@host:/app # set a key
deploy-tools config get staging_target # get a keySubcommands: init, show, set KEY VALUE, get KEY
Options: --config FILE, --json
Deploy Config (.deployrc)
# .deployrc — deploy-tools configuration
[email protected]:/var/www/app
staging_source=./dist
[email protected]:/var/www/app
production_source=./distCreate with: deploy-tools config init
Deploy History (.deploy-history)
Each deploy, rollback, and promote appends a line to .deploy-history:
2026-03-17T10:00:00Z|staging|[email protected]:/var/www/app|./dist|ok
2026-03-17T11:30:00Z|production|[email protected]:/var/www/app|./dist|promoteFormat: TIMESTAMP|ENV|TARGET|SOURCE|RESULT
JSON Output (Pipe Protocol)
All commands support --json for structured output compatible with the Skill Foundry pipe protocol:
deploy-tools status --json | some-other-tool
deploy-tools history --env production --json | jq '.data.entries[]'Error Codes
- E1 — Required tool not installed (rsync, ssh)
- E2 — Connection failure (SSH/rsync error)
- E3 — Permission denied on remote
License
MIT
