How igorbayerl/gdcli works
Project type and purpose
• gdcli is a standalone command-line tool (written in Go) that helps initialize Godot project scaffolding, manage Godot versions (install/open), and provides utility commands (clean, version, help).
• It is not a web app or microservice; it is a local developer tool with optional CI/CD for releases.
File structure
• Top-level “cmd” directory: each .go file defines a subcommand (init, install, open, clean, version, help and the root command).
• main.go wires up the CLI (likely via a library like Cobra).
• internal/config: reads/stores CLI configuration (paths, default versions).
• internal/core: business logic (engine.go handles installs/opens; version.go tracks CLI version).
• .github/workflows/release.yml: GitHub Actions workflow for building and publishing releases.
• docs: MkDocs configuration and Markdown files for user documentation.
• setup.iss: Windows installer script (Inno Setup).
Pulling in README insights
• Confirms usage patterns: gdcli init, gdcli install, gdcli open.
• Mentions future installer, extension support, templates.
• Shows project’s CI/CD (Git tags → GitHub Actions → release binaries).
Main components and their interactions
a. CLI Layer
• main.go / root command
• Bootstraps the application.
• Command Handlers (cmd/*.go)
• init → project scaffolding
• install → download/install correct Godot version
• open → launch project with installed Godot binary
• clean → remove generated artifacts
• version, help
b. Core Logic Layer (internal/core)
• Engine Module (engine.go)
• Downloads, caches, and invokes Godot binaries
• Version Module (version.go)
• Tracks & reports gdcli version
c. Configuration Layer (internal/config)
• Loads CLI settings, paths, default versions, templates
d. File System & External Dependencies
• Reads/Writes project directories
• Stores downloaded Godot engine binaries
• Launches external Godot process
e. Documentation & CI/CD
• Docs: MkDocs site generation from docs/docs
• Release Pipeline: GitHub Actions workflow triggers on tag → builds executables for multiple OS → publishes on GitHub Releases
• Installer: Windows Inno Setup script (setup.iss)
Architectural patterns and design principles
• Layered architecture:
• Presentation (CLI commands)
• Business logic (core modules)
• Configuration & persistence (FS for config & caches)
• Separation of concerns: each command lives in its own file; core logic isolated in internal/core; no circular dependencies
• Extensibility: future commands, templates, and global extensions can hook into the CLI layer