infra-tools
v1.4.1
Published
Cross-platform Docker infrastructure management CLI - Start 15+ enterprise services with one command
Maintainers
Readme
🚀 Infra-Tools CLI (Cross-Platform)
Cross-platform Node.js CLI for managing Docker infrastructure with 15+ enterprise services
✨ Features
- 🌍 Cross-Platform: Windows, macOS, and Linux support
- 📦 NPX Ready: Use instantly with
npx infra-tools - 🐳 Docker Integration: Native Docker API integration with dockerode
- 🔌 15+ Services: PostgreSQL, MySQL, MongoDB, Redis, Kafka, ELK, and more
- ⚡ Dynamic Ports: Automatic port conflict resolution
- 📊 Rich UI: Beautiful tables and status indicators
- 💾 Volume Management: Backup & restore volumes with compression
- 🔧 Zero Config: Works out of the box with existing Docker Compose files
🚀 Quick Start
Using NPX (Recommended)
# Start all services
npx infra-tools
# Check status
npx infra-tools status
# Start specific services
npx infra-tools start postgres redis
# View logs
npx infra-tools logs kafka -f
# Show environment variables
npx infra-tools vars postgresGlobal Installation
npm install -g infra-tools
infra-tools status
infra-tools start databases🖥️ Platform Support
Windows
- Requirements: Docker Desktop with WSL2 or Hyper-V
- Package Managers: Chocolatey, Winget, Scoop support
- Shells: CMD, PowerShell, Windows Terminal support
macOS
- Requirements: Docker Desktop
- Package Managers: Homebrew, MacPorts support
- Shells: Bash, Zsh support
Linux
- Requirements: Docker Engine or Docker Desktop
- Package Managers: apt, yum, dnf, pacman, zypper support
- Shells: Bash, sh support
📋 Available Services
Databases
- PostgreSQL 15 -
postgres(port 5432) - MySQL 8.0 -
mysql(port 3306) - MongoDB 7.0 -
mongo(port 27017) - Redis 7 -
redis(port 6379) - SQL Server 2022 -
mssql(port 1433) - Neo4j 5.13 -
neo4j(port 7474) - CouchDB 3.3 -
couchdb(port 5984)
Message Queues
- Apache Kafka -
kafka(port 9092) - Zookeeper -
zookeeper(port 2181) - RabbitMQ -
rabbitmq(ports 5672, 15672)
Logging & Search
- Elasticsearch -
elasticsearch(port 9200) - Logstash -
logstash(port 5044) - Kibana -
kibana(port 5601)
Monitoring
- Prometheus -
prometheus(port 9090) - Grafana -
grafana(port 3000)
API Gateway
- Kong Gateway -
kong(port 8000) - Kong Admin -
kong-database(port 5433) - Konga UI -
konga(port 1337)
🛠️ Commands
Service Management
npx infra-tools start [services...] # Start services
npx infra-tools stop [services...] # Stop services
npx infra-tools restart [services...] # Restart services
npx infra-tools status [--json|--active] # Show status
npx infra-tools config <service> # Configure service interactivelyService Groups
npx infra-tools databases # All databases
npx infra-tools messaging # Kafka + RabbitMQ
npx infra-tools logging # ELK stack
npx infra-tools monitoring # Prometheus + Grafana
npx infra-tools gateway # Kong API GatewayContainer Operations
npx infra-tools logs <service> [-f] # View logs
npx infra-tools exec <service> [cmd] # Execute command
npx infra-tools shell <service> # Open shell
npx infra-tools inspect <service> # Inspect container
npx infra-tools vars <service> # Show environment variablesVolume Management
# Volume operations (all subcommands under 'volumes')
npx infra-tools volumes # Show volume usage (default)
npx infra-tools volumes show [service] # Show volume usage
npx infra-tools volumes list [service] # List volumes with details
npx infra-tools volumes inspect <volume> # Inspect specific volume
npx infra-tools volumes backup <volume> # Backup volume to .tar.gz archive
npx infra-tools volumes restore <volume> # Restore volume from archive
npx infra-tools volumes remove <volume> # Remove volume (with confirmation)Maintenance
npx infra-tools clean # Remove stopped containers
npx infra-tools reset # Reset environment⚙️ Advanced Features
Interactive Service Configuration
# Configure service image, ports, volumes, and environment variables
npx infra-tools config postgres
# Prompts for:
# - Docker image (default: postgres:14-alpine)
# - Ports (default: 5432)
# - Volume names (default: postgres-data)
# - Environment variablesVolume Backup & Restore
# Backup a specific volume to compressed archive
npx infra-tools volumes backup postgres
# Prompts for backup directory (default: ./backups)
# Creates: infra_postgres-data_2025-10-28.tar.gz
# Restore volume from archive
npx infra-tools volumes restore postgres
# Prompts for archive path
# Shows containers using the volume
# Requires confirmation before restore
# Backup/restore supports both service names and full volume names
npx infra-tools volumes backup infra_postgres-data
npx infra-tools volumes restore infra_mysql-dataDynamic Port Assignment
# Automatically find free ports if defaults are busy
npx infra-tools start --dynamic-ports postgres mysqlEnvironment Variables
SKIP_PORT_CHECK=true npx infra-tools start
DYNAMIC_PORTS=true npx infra-tools startJSON Output
# Get machine-readable status
npx infra-tools status --json --active🔧 Windows-Specific Features
- Package Manager Integration: Automatic Miller installation via Chocolatey/Winget/Scoop
- Windows Terminal Support: Enhanced experience with Windows Terminal
- WSL2 Compatibility: Seamless integration with Docker Desktop on WSL2
- Path Normalization: Automatic Windows path conversion for Docker volumes
🏗️ Architecture
The CLI is built with:
- Commander.js: Command-line interface framework
- Dockerode: Native Docker API integration
- Chalk: Cross-platform terminal colors
- CLI-Table3: Beautiful ASCII tables
- Inquirer: Interactive prompts
- Ora: Elegant loading spinners
🤝 Migration from Bash Version
The Node.js CLI maintains 100% compatibility with the existing Bash version:
- Same command structure and arguments
- Same Docker Compose files (no changes needed)
- Same service names and port mappings
- Same volume and backup strategies
🌟 Acknowledgments
- Docker for containerization platform
- All service maintainers for excellent container images
- Community for feedback and contributions
- Kong, Keycloak, Elastic, Confluent for enterprise-grade services
📞 Support
- 📖 Documentation: Check this README and
infra-tools help - 📋 Changelog: See CHANGELOG.md for version history
- 🐛 Issues: GitHub Issues
- 🚀 Latest Features: Check release notes for new functionality
- ☕ Buy me a coffee: https://www.buymeacoffee.com/arefdotuk
Made with ❤️ for developers who want powerful, enterprise-grade tools without the complexity.
Start building amazing applications with complete development infrastructure in seconds!
Infra-Tools v1.4.0 - Created by 👨💻 Aref M | Licensed under MIT
