Track deployment history and roll back fast. Push tags to record deploys, list your history, and revert to any previous version. Works with Docker, git tags, and PM2.
npm install -g @lxgicstudios/rollbackOr run directly:
npx @lxgicstudios/rollback --help# Record a deployment
rollback push myapp:v2.1.0 --type docker --service web
# Record a git tag deploy
rollback push v1.5.3
# Show deployment history
rollback list
# Quick rollback to previous
rollback now --dry-run # preview first
rollback now # execute
# Rollback to a specific version
rollback to myapp:v2.0.0
# Check current status
rollback status- Push/pop deployment tracking with timestamps and metadata
- Auto-detects deploy type from tag format (Docker, git, PM2)
- Dry run mode to preview rollbacks before executing
- Docker rollback pulls the previous image and restarts
- Git rollback checks out the target tag or commit
- PM2 rollback restarts the named process
- Metadata support to tag deploys with author, ticket, etc.
- JSON output for scripting and automation
- Zero dependencies built on Node.js builtins only
| Command | Description |
|---|---|
push <tag> |
Record a new deployment |
list |
Show deployment history |
now |
Rollback to the previous deployment |
to <tag> |
Rollback to a specific tag |
status |
Show current and previous deployment |
clear |
Clear all deployment history |
| Option | Description | Default |
|---|---|---|
--type <type> |
Force type: docker, git, pm2, custom | auto-detect |
--service <name> |
Service name for docker deploys | none |
--dry-run |
Preview without executing | off |
--limit <n> |
Entries to show in list | 20 |
--meta <key=value> |
Attach metadata (repeatable) | none |
--json |
Output as JSON | off |
--help |
Show help message | - |
Rollback stores deployment history in .rollback-history.json in your project root. Each push appends an entry, and now/to commands read this history to revert.
The tool auto-detects deployment types from the tag format:
myapp:v2.0orregistry.io/app:tag-> Dockerv1.0.0orabc1234(git hash) -> Gitpm2:appname-> PM2
MIT - LXGIC Studios