@mazhu/dockr
v1.0.0
Published
A better Docker CLI — enhanced container management with colors, resource monitoring, and one-click cleanup
Maintainers
Readme
🚀 dockr
A better Docker CLI — enhanced container management with colors, resource monitoring, and one-click cleanup.
Zero dependencies. Pure Node.js. Beautiful terminal output.
Features
| Command | Description |
|---------|-------------|
| dockr ps | Enhanced container list with status colors & live resource usage |
| dockr stats | Real-time resource monitoring for all containers |
| dockr logs <name> | Beautiful log output with level detection & search/filter |
| dockr exec <name> | Quick shell into any container |
| dockr clean | One-click cleanup of unused images, containers, volumes, networks |
| dockr images | List images with size formatting |
Install
npm install -g @mazhu/dockrOr use directly with npx:
npx @mazhu/dockr psRequirements
- Node.js >= 16
- Docker running locally (uses Unix socket)
Usage
Enhanced Container List
dockr ps # Running containers with live CPU/MEM stats
dockr ps -a # All containers (including stopped)
dockr ps nginx # Filter by name or imageOutput includes:
- Color-coded status (green=running, red=error exit, gray=stopped)
- Live CPU & memory usage
- Network I/O
- Port mappings
Real-time Monitoring
dockr stats # Live resource monitoring (like htop for Docker)
dockr stats --no-stream # Single snapshotBeautiful Logs
dockr logs myapp # Follow logs with timestamps & level detection
dockr logs myapp --tail 500 # Last 500 lines
dockr logs myapp -f error # Filter lines containing "error" (highlighted)
dockr logs myapp --since 1h # Logs from last hourFeatures:
- Automatic log level detection (ERROR, WARN, INFO, DEBUG, FATAL)
- Color-coded log levels
- Keyword search with highlighting
- Smart timestamp formatting
Quick Shell Access
dockr exec myapp # Open /bin/sh in container
dockr exec myapp bash # Open bash instead
dockr exec myapp "ls -la" # Run a single commandOne-Click Cleanup
dockr clean # Preview what would be removed
dockr clean --force # Actually remove unused resourcesCleans up:
- Stopped containers
- Dangling images
- Unused volumes
- Unused custom networks
Image Management
dockr images # List all images with human-readable sizes
dockr images -a # Including intermediate images
dockr images nginx # Filter by nameComparison with docker CLI
| Feature | docker | dockr |
|---------|----------|---------|
| Container list with stats | docker ps + docker stats --no-stream | dockr ps (single command) |
| Color-coded status | ❌ | ✅ |
| Log level detection | ❌ | ✅ |
| Log search/filter | docker logs \| grep | dockr logs -f keyword (highlighted) |
| One-click cleanup | docker system prune (interactive) | dockr clean (dry-run first) |
| Zero external dependencies | N/A | ✅ |
Development
git clone https://github.com/deepdadou/dockr.git
cd dockr
npm link
dockr --helpLicense
MIT © Mike Wang
