a godot package manager
Find a file
2026-10-29 16:26:03 -04:00
src itch api 2026-10-29 16:26:03 -04:00
tests ::3 2026-10-17 16:44:49 -04:00
.gitignore stuff 2026-10-06 20:56:33 -04:00
cli.spec stuff 2026-10-06 20:56:33 -04:00
poetry.lock itch api 2026-10-29 16:26:03 -04:00
pyproject.toml itch api 2026-10-29 16:26:03 -04:00
pyrightconfig.json aaa 2026-10-19 00:25:10 -04:00
README.md uuuuu 2026-10-19 00:38:55 -04:00

gpm

alternatively "gdpm" if your system has another gpm installed

since godot packages and addons lack the ability to resolve external dependencies, they often don't have any or vendor them. this project essentially tries to manage their versions (where possible), download them from source, and links them to a godot addons/ directory. it also can check for nested addons/ folders in dependencies to prevent linking addons/addons/my-dependencies*

* this is best effort since there's no way to really verify if something is an addon. libraries that don't need to manipulate godot don't require a plugin.cfg

warning

it's not really ready for anyone but me and likely has a lot of bugs. use with caution and don't trust random shit you download from the internet

this uses subprocess.run to execute git commands, so make sure git is in your systems PATH or just don't use add git dependencies

why?

managing godot dependencies sucks. "lmao just download it into addons/ skill issue" yeah i know but the ecosystem is a fucking mess and having a reproducable way to do this is nice. plus it's nice to have a well-defined list of dependencies

building

idk just run src/gpm/cli.py. alternatively use pyinstaller to create a binary

pyinstaller src/gpm/cli.py

usage

usage: gpm [-h] [--log-level {debug,info,warning,error,critical}] [-p PROJECT_NAME] [-c CONFIG] [-l LIBRARY]
           [-g GODOT] [-r ROOT]
           {init,install,add,remove,config} ...

positional arguments:
  {init,install,add,remove,config}

options:
  -h, --help            show this help message and exit
  --log-level {debug,info,warning,error,critical}
                        log output verbosity
  -p, --project-name PROJECT_NAME
                        name of the godot project
  -c, --config CONFIG   path to the gpm config file
  -l, --library LIBRARY dependency source path
  -g, --godot GODOT     godot directory path
  -r, --root ROOT       root directory for the project

initialize a project

gpm init my_project

add a dependency

usage: gpm add [-h] [--name NAME] [-a ADDONS] {path,p,git,g,store,s,library,lib,l} ...

positional arguments:
  {path,git,store,library,lib}

options:
  -h, --help            show this help message and exit
  --name NAME           local name for the dependency
  -a, --addons ADDONS   paths to nested addons`

if the dependency has nested dependency folders, specify them with --addons or edit gpm.toml after adding it. if left blank, it will attempt to find a nested addons/ directory and link any child directories as addons. otherwise, it just adds the dependency as-is

[dependencies.something]
id = 1
version = "0.1.0"
type = "library"
addons = ["addons/nested", "addons/another_one"]

local path

usage: gpm add path [path]

positional arguments:
  path
gpm add path some/local/dependency/

git

usage: gpm add git [-h] [-r REV] [-b BRANCH] url

positional arguments:
  url

options:
  -h, --help           show this help message and exit
  -r, --rev REV
  -b, --branch BRANCH
gpm add git https://github.com/hardalex/godot-debug-draw.git
gpm add --branch main --rev bc51ddd git https://github.com/hardalex/godot-debug-draw.git

asset store

usage: gpm add store [-h] [-v VERSION] [-s] slug

positional arguments:
  slug

options:
  -h, --help            show this help message and exit
  -v, --version VERSION
  -s, --skip-version-mismatch ignore any version mismatches
gpm add store hardpixel/debug-draw

asset library

usage: gpm add library [-h] [-v VERSION] [-s] [--prefer-git] id

positional arguments:
  id

options:
  -h, --help            show this help message and exit
  -v, --version VERSION
  -s, --skip-version-mismatch ignore any version mismatches
  --prefer-git          prefer using git if it exists
gpm add lib 3503

remove a dependency

usage: gpm remove [-h] [--purge] name

positional arguments:
  name

options:
  -h, --help  show this help message and exit
  --purge     remove all files from library
gpm add store gdquest/gdscript-formatter
gpm rm gdscript-formatter

gpm add --name formatter store gdquest/gdscript-formatter
gpm rm formatter

update config

usage: gpm config [-h] {project/name,library/path,godot/path} value

positional arguments:
  {project/name,library/path,godot/path}
  value

options:
  -h, --help            show this help message and exit
# update project name
gpm cfg project/name 'my game'

install defined dependencies

if there is a gpm.toml present with dependencies, this will ensure all of them are installed locally and symlinked to godot/addons/

usage: gpm install [-h]

options:
  -h, --help  show this help message and exit
gpm install

roadmap

  • verify and fetch dependencies
  • link to addons folder
  • nested addons folder resolution
  • option to prefer git source when adding asset library/store dependency if it exists
  • minimize network requests by eagerly caching certain values
  • option to use sparse-checkouts on git dependencies
  • add git dependencies as a submodule
  • write tests lmao
  • plugin to add gpm to godot's editor

maybe

  • manage dependencies directly from godot/addons/
  • other package sources