UNPKG

docker-pilot

Version:

A powerful, scalable Docker CLI library for managing containerized applications of any size

251 lines (175 loc) โ€ข 7.63 kB
# Docker Pilot ๐Ÿณ <div align="center"> ![Docker Pilot Cover](./docs/assets/docker-pilot.png) **A powerful and scalable npm library for managing Docker applications of any size.** [![npm version](https://badge.fury.io/js/docker-pilot.svg?icon=si%3Anpm)](https://badge.fury.io/js/docker-pilot) [![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?style=flat&logo=typescript&logoColor=white)](https://www.typescriptlang.org/) [![Docker](https://img.shields.io/badge/Docker-2496ED?style=flat&logo=docker&logoColor=white)](https://www.docker.com/) [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC) [๐Ÿ“š **Complete Documentation**](https://Jonhvmp.github.io/docker-pilot/) โ€ข [๐Ÿš€ **Quick Start**](#-quick-start) โ€ข [๐ŸŽฎ **Interactive Menu**](#-interactive-menu) --- </div> ## โœจ What is Docker Pilot? Docker Pilot is a modern TypeScript library that makes Docker container management **simple**, **powerful**, and **fun**. From small projects to enterprise systems, it provides an intuitive CLI and programmatic API. ### ๐ŸŽฏ Key Features - ๐ŸŽฎ **Interactive Terminal Menu** - Navigate commands with ease - ๐Ÿ“„ **Smart Compose Management** - Recursive discovery and analysis of docker-compose files - ๐ŸŽฏ **Intelligent Project Detection** - Auto-detect compose files with smart prioritization - ๐ŸŒ **Multi-language Support** - Portuguese & English with complete i18n - ๐Ÿ“ฆ **TypeScript Native** - Full type safety and IntelliSense - โšก **Zero Configuration** - Works out of the box - ๐Ÿ”Œ **Plugin System** - Extensible architecture - ๐Ÿ“Š **Real-time Monitoring** - Status, logs, and metrics - ๐Ÿ” **Advanced File Analysis** - Validate, analyze, and manage compose files ## ๐Ÿš€ Quick Start ### Installation ```bash # Install globally for CLI npm install -g docker-pilot # Or locally for your project npm install docker-pilot ``` ### CLI Usage ```bash # Start interactive menu docker-pilot # Or use direct commands docker-pilot up # Start all services docker-pilot status # Check status docker-pilot logs app # View logs docker-pilot compose list # List all compose files docker-pilot compose analyze # Analyze compose structure docker-pilot compose validate # Validate compose files ``` ### As Library ```typescript import { DockerPilot } from 'docker-pilot'; const pilot = new DockerPilot(); await pilot.initialize(); await pilot.up(); // Start services const status = await pilot.status(); // Get status ``` ## ๏ฟฝ What's New in v2.0.4 ### ๐Ÿ“„ Enhanced Docker Compose Management Docker Pilot now provides **comprehensive docker-compose file management** with intelligent discovery: ```bash # List all compose files recursively docker-pilot compose list --variants # Analyze compose file structure docker-pilot compose analyze docker-compose.yml # Validate compose files docker-pilot compose validate # Find compose files in complex projects docker-pilot compose find /path/to/project ``` **Smart Discovery Features:** - ๐Ÿ” **Recursive Search**: Finds compose files up to 6 levels deep - ๐ŸŽฏ **Smart Prioritization**: Identifies main files vs. environment variants - ๐Ÿ“Š **Detailed Analysis**: Shows services, ports, dependencies, and file info - ๐ŸŒ **Environment Detection**: Recognizes dev, prod, test variants automatically - โœ… **Real-time Validation**: Syntax and structure validation with detailed reports ### ๐ŸŽฏ Intelligent Project Auto-Detection Starting Docker Pilot now automatically detects your project structure: ``` ๐Ÿ” Searching for docker-compose files recursively... ๐Ÿ“ Search depth: 6 levels Found 3 docker-compose files: 1. docker-compose.yml ๐ŸŽฏ๐Ÿ“ ๐Ÿ“ 2.1 KB | ๐Ÿ“… 22/06/2025 ๐Ÿ› ๏ธ 4 services: web, api, database, redis 2. backend/docker-compose.dev.yml (development) ๐Ÿ“‚(2) ๐Ÿ“ 1.8 KB | ๐Ÿ“… 21/06/2025 ๐Ÿ› ๏ธ 2 services: api-dev, database-dev ``` ## ๏ฟฝ๐ŸŽฎ Interactive Menu Docker Pilot's standout feature is its **interactive terminal menu** that makes Docker management intuitive: ![Interactive Menu Demo](./docs/assets/menu.png) ```bash $ docker-pilot ๐Ÿณ My Project - Docker Pilot v2.0 ๐Ÿณ ๐Ÿš€ Basic Commands: 1. Start all services 2. Stop all services 3. Restart all services 4. Rebuild and start all services 5. View logs of all services 6. View services status ๐Ÿ› ๏ธ Advanced Commands: 7. Open shell in service 8. Check services health 9. Monitor in real time 10. Update all images โš™๏ธ Maintenance: 11. Clean unused resources 12. Deep clean 13. Show configuration ๐Ÿ”ง App: 14. Start app 15. Restart app 16. View app logs Choose your option: โ–  ``` ### Language Support Docker Pilot automatically detects your system language and provides full localization: - ๐Ÿ‡บ๐Ÿ‡ธ **English** - Complete interface - ๐Ÿ‡ง๐Ÿ‡ท **Portuguรชs** - Interface completa Switch languages on-the-fly through the advanced settings menu! ## ๐Ÿ“‹ Requirements - **Node.js** >= 18.0.0 - **Docker** >= 20.0.0 - **Docker Compose** >= 2.0.4 ## ๐ŸŽฏ Use Cases **๐Ÿ‘จโ€๐Ÿ’ป Developers** - Quick project setup - Development workflow automation - Multi-service management - Interactive debugging **๐Ÿข Teams & Enterprise** - Standardized Docker workflows - Multi-environment support - Automated backups - Performance monitoring ## ๐Ÿ”ง Configuration Docker Pilot works with zero configuration, but you can customize it: ```json { "projectName": "My Amazing App", "language": "en", // or "pt-br" "services": { "app": { "port": 3000, "description": "Main application" }, "database": { "port": 5432, "description": "PostgreSQL database" } } } ``` ## ๐ŸŒŸ Why Choose Docker Pilot? <div align="center"> | ๐Ÿณ **Native Docker** | ๐ŸŽฎ **Interactive** | ๐ŸŒ **Global** | ๐Ÿš€ **Modern** | |:---:|:---:|:---:|:---:| | Built specifically for Docker workflows | Terminal UI that's actually enjoyable | Multi-language from day one | TypeScript, ES6+, latest standards | | ๐Ÿ”Œ **Extensible** | ๐Ÿ“Š **Intelligent** | ๐Ÿ›ก๏ธ **Reliable** | โšก **Fast** | |:---:|:---:|:---:|:---:| | Plugin system for custom needs | Auto-detection and smart defaults | Battle-tested error handling | Optimized for performance | </div> ## ๐Ÿ“š Documentation **Complete documentation is available at: [https://Jonhvmp.github.io/docker-pilot/](https://Jonhvmp.github.io/docker-pilot/)** - ๐Ÿ“– [Getting Started Guide](https://jonhvmp.github.io/docker-pilot/getting-started/installation/) - ๐ŸŽฎ [Interactive Menu Guide](https://Jonhvmp.github.io/docker-pilot/user-guide/interactive-menu/) - ๐Ÿ“š [API Reference](https://jonhvmp.github.io/docker-pilot/api/core/) - ๐Ÿ”Œ [Plugin Development](https://Jonhvmp.github.io/docker-pilot/advanced/plugins/) - ๐ŸŒ [Internationalization](https://Jonhvmp.github.io/docker-pilot/user-guide/i18n/) ## ๐Ÿค Contributing We welcome contributions! Please see our [Contributing Guide](https://Jonhvmp.github.io/docker-pilot/development/contributing/) for details. ## ๐Ÿ“„ License Docker Pilot is [ISC licensed](LICENSE). --- <div align="center"> **[โฌ† Back to top](#docker-pilot-)** Made with โค๏ธ by [Jonhvmp](https://www.linkedin.com/in/jonhvmp) โ€ข [JA Solutions Engine](mailto:jasolutionsengine@gmail.com) **๐ŸŒŸ If Docker Pilot helps you, please give it a star! ๐ŸŒŸ** </div>