Skip to content

Repository files navigation

GPM CLI - Game Package Manager

LicenseGo Version

A modern, secure command-line interface for the GPM (Game Package Manager) registry - designed specifically for game development workflows with npm-compatible commands and Unity Package Manager (UPM) support.

🚀 Features

  • npm-compatible workflows - Familiar commands for JavaScript/Node.js developers
  • Unity Package Manager (UPM) support - Reverse-DNS package naming and Unity-specific metadata
  • Studio-scoped registries - Multi-tenant architecture with subdomain-based access control
  • Secure authentication - Encrypted token storage and secure credential handling
  • Professional CLI experience - Rich terminal output, progress indicators, and helpful error messages
  • Cross-platform - Supports Windows, macOS, and Linux

📦 Installation

Quick Install (Recommended)

One-liner installation:

# Using curl
curl -fsSL https://gpm.sh/install.sh | bash
# Using wget
wget -qO- https://gpm.sh/install.sh | bash

Custom installation:

# Install specific version
curl -fsSL https://gpm.sh/install.sh | bash -s -- -v v0.1.0-alpha.2
# Install to custom directory
curl -fsSL https://gpm.sh/install.sh | bash -s -- -d ~/.local/bin
# Force reinstall
curl -fsSL https://gpm.sh/install.sh | bash -s -- --force

Download Pre-built Binaries

Download the latest release for your platform from the releases page.

Build from Source

Requirements:

  • Go 1.21 or later
  • Git
# Clone the repository
git clone https://github.com/gpm-sh/gpm-cli.git
cd gpm-cli
# Build and install
make build
sudo mv gpm /usr/local/bin/ # or add to your PATH# Or install directly with Go
go install gpm.sh/gpm/gpm-cli@latest

Verify Installation

gpm --version
gpm --help

🏃 Quick Start

1. Configure Registry

# Set your GPM registry URL
gpm config set registry https://your-studio.gpm.sh
# Or use the global registry
gpm config set registry https://gpm.sh

2. Authenticate

# Register a new account
gpm register
# Login with existing credentials
gpm login

3. Install Packages

# Install a package
gpm install com.unity.ugui
# Install specific version
gpm install com.unity.ugui@1.0.0
# Install and save to package.json
gpm install --save com.company.analytics
gpm install --save-dev com.company.test-utils

4. Publish Packages

# Create a package tarball
gpm pack
# Publish to registry
gpm publish your-package-1.0.0.tgz

📚 Commands Reference

Package Management

CommandDescriptionExample
gpm install [package]Install packagesgpm install com.unity.ugui@1.0.0
gpm uninstall <package>Remove packagesgpm uninstall com.unity.ugui
gpm listList installed packagesgpm list --production
gpm info <package>Show package informationgpm info com.unity.ugui
gpm search <term>Search for packagesgpm search analytics

Publishing

CommandDescriptionExample
gpm packCreate package tarballgpm pack
gpm publish <tarball>Publish packagegpm publish my-package-1.0.0.tgz

Authentication

CommandDescriptionExample
gpm registerCreate new accountgpm register
gpm loginAuthenticate with registrygpm login
gpm logoutClear authenticationgpm logout
gpm whoamiShow current usergpm whoami

Configuration

CommandDescriptionExample
gpm config set <key> <value>Set configurationgpm config set registry https://gpm.sh
gpm config get <key>Get configurationgpm config get registry
gpm config listList all settingsgpm config list

Utilities

CommandDescriptionExample
gpm versionShow CLI versiongpm version
gpm help [command]Show helpgpm help install

🔧 Global Flags

All commands support these global flags:

FlagDescription
--verbose, -vEnable verbose output
--debugEnable debug output
--quiet, -qSuppress non-essential output
--jsonOutput in JSON format

📋 Package.json Structure

GPM supports standard npm package.json with Unity-specific extensions:

{
"name": "com.company.my-package",
"version": "1.0.0",
"displayName": "My Unity Package",
"description": "A Unity package for amazing features",
"unity": "2022.3",
"license": "MIT",
"author": {
"name": "Your Name",
"email": "your.email@company.com"
},
"dependencies": {
"com.unity.ugui": "1.0.0"
},
"devDependencies": {
"com.company.test-utils": "^2.0.0"
},
"keywords": ["unity", "ui", "game-development"]
}

Required Fields

  • name - Reverse-DNS package name (e.g., com.company.package)
  • version - Semantic version (e.g., 1.0.0)
  • description - Package description

Unity-Specific Fields

  • displayName - Human-readable name shown in Unity
  • unity - Minimum Unity version (e.g., 2022.3)

🏗️ Development

Building

# Install dependencies
make deps
# Format code
make fmt
# Run linter
make lint
# Build binary
make build
# Build for all platforms
make build-all

Testing

# Run all tests
make test# Run unit tests only
make test-unit
# Run integration tests
make test-integration
# Generate coverage report
make test-coverage

Version Management

Version information is automatically injected at build time:

# Show build variables
make version
# Build with custom version
VERSION=1.2.3 make build

🔐 Security

Secure Credential Handling

  • Passwords are cleared from memory immediately after use
  • Input validation prevents injection attacks
  • HTTPS-only communication with registries
  • Secure file permissions on configuration files

🌍 Configuration

Configuration File

GPM stores configuration in ~/.gpmrc:

registry: https://gpm.shusername: your-usernametoken: your-auth-token

Environment Variables

VariableDescriptionDefault
GPM_REGISTRYRegistry URLhttps://gpm.sh
GPM_TOKENAuthentication token-
NO_COLORDisable colored output-

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Add tests for new functionality
  5. Run the test suite (make test)
  6. Commit your changes (git commit -m 'Add amazing feature')
  7. Push to the branch (git push origin feature/amazing-feature)
  8. Open a Pull Request

Development Guidelines

  • Follow Go best practices and idioms
  • Add tests for all new functionality
  • Update documentation for user-facing changes
  • Use conventional commit messages
  • Ensure all tests pass before submitting

📄 License

Licensed under the Apache License, Version 2.0. See LICENSE for the full license text.

🆘 Support

🗺️ Roadmap

  • Package dependency resolution and lock files
  • Workspace support for monorepos
  • Plugin system for custom commands
  • Integration with CI/CD platforms
  • Advanced package validation rules
  • Offline package caching

About

Official CLI tool for GPM (Game Package Manager) — a cross-engine package management system for Unity, Unreal, and Godot. Enables developers to publish, search, and install global and studio-scoped packages with full npm/UPM compatibility.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages