Skip to content

Instantly share code, notes, and snippets.

@henriquelalves
Last active August 29, 2022 19:52
Show Gist options
  • Save henriquelalves/610533feccfafc23130e84e8556b9187 to your computer and use it in GitHub Desktop.
Save henriquelalves/610533feccfafc23130e84e8556b9187 to your computer and use it in GitHub Desktop.
GLAM Overview

GLAM Overview

This is a quick overview of the Godot GLAM utility (https://github.com/henriquelalves/glam). GLAM is a CLI tool to facilitate addon managing for Godot projects. It's lightweight and focused on providing basic addon managament such as installing, removing, and applying changes to any addon that can be installed via git. GLAM is inspired by NPM, but has no intention on becoming the universal solution of Godot projects.

Design Philosophy

  • GLAM-enhanced projects should be indistinguishable from vanilla Godot projects. This is important to not clutter Godot repositories with additional files, and to give the option to the user to publish the project with GLAM settings, or just publish the project as one coese vanilla project.

How it works

A GLAM project consists of:

  • a .glam file.
  • a .glam.d/ folder.

The .glam file is a human-readable JSON file with the list of packages that the project should install and their individual configurations. A package is any other Godot project or files that you might want to include as an addon or additional files.

All commands run in a UNIX subshell, and assume the user have the necessary executables on PATH (e.g. git). If any command fails, GLAM throws an exception with the shell output and stops the process safely.

Installing packages

When installing a package, GLAM will clone their repository on .glam.d/, look into their addons/ folder, and copy it's addon to your project's root folder addons/. GLAM will also save the current commit hash of the repository on the package .glam entry, to help maintaining the same version of addons accross projects.

When starting a project with an already existing .glam file, you can install all packages listed with glam install (similar to npm install). All repositories will be cloned and reset to the commit hash stated in the .glam file.

Updating packages

You can update specific packages to their latest commit, or update all packages to their most recent commit. This will alter the .glam file accordingly, and override all files already copied to the project.

Applying changes to packages

Users may want to modify existing addons (they are owners of) and apply the changes on their original repositories. GLAM allows the glam apply command, which copies and overrides all files from the GLAM package addon to their repository on .glam.d/ folder.

GLAM won't execute any additional git commands; users must check the modifications on the repository and commit it themselves.

Current Limitations

(limitations are described with a rough estimation of their priority)

  • [HIGH] No documentation / man-page.
  • [HIGH] No binaries.
  • [HIGH] Can't have more than one addon per GLAM package. Each GLAM package can only have one addon to copy to the user's project.
  • [HIGH] Won't resolve name conflicts between packages and addons. GLAM packages and their addons must have a unique name each.
  • [LOWish] No addons dependency support. GLAM packages can't have addons they depend to (dependencies won't be installed with them).
  • [LOW] UNIX only. GLAM was made with UNIX subshell commands in mind, so right now it won't work on Windows.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment