Skip to content

eduhds/gspm

Repository files navigation

gspm

Go Windows Linux macOS

Git Services Package Manager (GitHub supported only for now).

Support installing from releases with custom script.

✨ Features

  • Get asset from repository releases.
  • Run custom script to install, uncompress, move, etc.
  • Save repository/package info for future installs.
  • Interactive mode.
  • Multi-platform: Windows, Linux, MacOS.
  • Public and Private repositories

⬇️ Install

MacOS/Linux (recommended)

curl -sL https://dub.sh/gspm | bash

Friendly installers

Windows Linux macOS

Installing manually

First time

Download manually from releases.

Already have gspm installed

Use gspm to update itself:

  • MacOS/Linux
gspm update eduhds/gspm -s 'sudo tar -C /usr/local/bin -xzf {{ASSET}} gspm && rm {{ASSET}}'

📖 Usage

CLI

Usage: gspm [--configdir CONFIGDIR] [--githubtoken GITHUBTOKEN] [--script SCRIPT] [COMMAND [REPOS [REPOS ...]]]

Positional arguments:
  COMMAND                Command to run. Must be add, remove, update, install, edit, info or list.
  REPOS                  Repos from Git Services (GitHub supported only for now). Format: username/repository

Options:
  --configdir CONFIGDIR [env: GSPM_CONFIG_DIR]
  --githubtoken GITHUBTOKEN [env: GSPM_GITHUB_TOKEN]
  --script SCRIPT, -s SCRIPT
                         Script to run after download a asset. Use {{ASSET}} to reference the asset path.
  --help, -h             display this help and exit
  --version              display version and exit

Examples

# Add
gspm add username/repository
gspm add username/repository@tag
gspm add username/repository@latest

# Info, Edit or Update
gspm info username/repository
gspm edit username/repository
gspm update username/repository

# Using inline Script
gspm <add|update|edit> username/repository -s 'your script here'

# Remove (only from ~/.config/gspm.json)
gspm remove username/repository
# Remove (from ~/.config/gspm.json and running script to remove from system)
gspm remove username/repository -s 'your script here'

# List
gspm list

# Install (from ~/.config/gspm.json)
gspm install

# Custom config dir path
GSPM_CONFIG_DIR=/path/to/custom/dir gspm <command> ...

# GitHub private repositories
GSPM_GITHUB_TOKEN='your token here' gspm <command> <add|update>

🛠️ Development

# Run
go run . <command> <arguments>

# Build
task build:release

🤝 Support

BuyMeACoffee Ko-Fi

📜 License

GPL-3.0 license

🫂 Contributing

Contributions are welcome, see Contributions Guide and Code of Conduct.

🙏 Credits/Thanks