π¦ Source Directory Overview (src
)ΒΆ
Welcome to the technical heart of the project! This document provides a clear and concise overview of the structure and purpose of each file and folder within the src
directory. Whether you're a new contributor or just curious, this guide will help you navigate the codebase with ease.
π Table of ContentsΒΆ
π Main Entry PointΒΆ
index.ts
ΒΆ
The main entry script for the CLI tool. It detects the operating system (macOS or Windows) and launches the appropriate CLI logic for package management (Homebrew or Chocolatey). This file contains the main menu and delegates to the relevant platform-specific functions.
βοΈ Configuration ModulesΒΆ
config/cli.ts
ΒΆ
Defines the PackageManagerCLI
class, which manages the interactive main menu, package installation, updates, SSH connections, and the execution of commands from YAML files. The menu adapts to the detected platform.
config/localStorage.ts
ΒΆ
Provides the YamlDataService
class for loading and saving data (such as command lists) from YAML files in the assets
directory. Relies on helpers from utils/isStorage.ts
.
π οΈ Utility ModulesΒΆ
utils/yamlTerminalAutomator.ts
ΒΆ
The TerminalAutomator
class reads commands from a YAML file and executes them sequentially. Errors are logged, and execution halts on failure.
utils/section.ts
ΒΆ
The Section
class provides an interactive menu for selecting and running Docker Compose files. It supports keyboard navigation and loading environment variables from .env
files.
utils/isStorage.ts
ΒΆ
The isStorageService
class offers helper methods for creating directories and file paths for YAML files in the assets
directory.
utils/docker.ts
ΒΆ
The DockerComposeUtil
class #encapsulates Docker Compose operations, including error handling and loading environment variables from .env
files.
utils/bash.ts
ΒΆ
The BashHelper
class provides methods for establishing SSH connections and exiting the CLI program. It works seamlessly across Windows and Unix systems.
π Type DefinitionsΒΆ
types/types.ts
ΒΆ
Defines the PackageManagerOptions
interface, which specifies configuration options for the CLI (such as platform, commands, labels, and messages)
.