ugdm
v0.8.1
Published
Universal GIT Dependency Manager
Readme
UGDM - Universal Git Dependency Manager
UGDM is a CLI tool that manages project dependencies directly via Git repositories, allowing you to clone, version, and install libraries in a standardized way — independent of registries like npm, pip, etc.
📦 Installation
npm install -g ugdmRequirements:
- Node.js and npm installed
- Git installed
📁 Project Structure
UGDM uses a single configuration file:
dependencies.jsonThis file defines:
- Installation directory (
path) - Dependencies
- Scopes (reusable URL prefixes)
- Variables (e.g. tokens)
⚙️ Commands
ugdm init [--path <dir>]
Creates the dependencies.json file.
ugdm add <name> <url | @scope/repo> [<version>] [--tag] [--auth <type:var>]
Adds a dependency.
ugdm scope <name> <base-url> [--auth <type:var>]
Defines a reusable URL scope.
ugdm set <variable> <value>
Defines a variable to be used in generated scripts.
ugdm install
Clones the repositories listed.
ugdm update [<lib>] [--branch <branch>] [--tag]
Updates cloned repositories.
ugdm remove <lib>
Removes the cloned repository (does not modify generated scripts).
ugdm build [<os>] [--auth | --no-auth]
Generates dependencies (Linux/macOS) and dependencies.bat (Windows) scripts.
🔐 Authentication
Use --auth to access private repositories:
ugdm set token {{1}}
ugdm add lib-a https://gitlab.com/org/lib-a.git --auth "oauth2:{{token}}"
ugdm build./dependencies MY_TOKEN📄 Example dependencies.json
{
"path": "libs/",
"scopes": {
"internal": {
"url": "https://gitlab.com/org/libs",
"auth": "oauth2:{{token}}"
}
},
"dependencies": {
"core-lib": {
"url": "https://gitlab.com/org/core-lib.git",
"version": "master",
"commit": "25e8dbc470888ade90712532de6cc430fb3a10b9"
},
"shared-lib": {
"url": "@internal/shared-lib.git",
"version": "v1.0.0"
}
},
"variables": {
"token": "{{1}}"
}
}✅ Best Practices
- Use HTTPS URLs
- Never store tokens directly in the JSON
- Use variables and
--authfor safety - Version
dependencies.json,dependenciesanddependencies.bat, but addvendor/to.gitignore
🧪 Complete Example
ugdm init --path libs/
ugdm set token {{1}}
ugdm scope internal https://gitlab.com/org/libs --auth "oauth2:{{token}}"
ugdm add shared-lib @internal/shared-lib.git
ugdm build
./dependencies MY_TOKEN📄 License
MIT © 2025 — Thiago Leal
