Giter VIP home page Giter VIP logo

grm's Introduction

grm

What is it?

grm is an experimental package manager for GitHub Releases. It is probably only good for installing packages which are distributed as binaries (for example the ones written in Go, Rust). The following popular packages can be installed with grm:

  • mozilla/geckodriver
  • gohugoio/hugo
  • go-acme/lego
  • zyedidia/micro
  • ...

grm inspects release assets for a binary file and when the file is found, downloads and installs it to /usr/local/bin/ directory.

How to use it?

$ ./grm
A package manager for GitHub releases

Usage:
  grm [command]

Available Commands:
  aliases     Print table of known package aliases
  help        Help about any command
  info        Show information about a package
  install     Install a package from GitHub releases
  list        List installed packages
  lock        Lock a package
  release     Create a release in GitHub
  remove      Remove a package
  set         Modify settings
  settings    Print settings
  unlock      Unlock a package
  update      Update installed packages
  version     Print version

Flags:
  -h, --help           help for grm
      --token string   GitHub API token
  -v, --verbose        Enable verbose logging
  -y, --yes            Confirm all

Use "grm [command] --help" for more information about a command.

How to install specific version of hugo?

grm install gohugoio/hugo==v0.63.0 -f Linux-64

How to install it?

Make sure you have curl and jq installed (sudo dnf install curl jq)

curl -s https://api.github.com/repos/jsnjack/grm/releases/latest | jq -r .assets[0].browser_download_url | xargs curl -LOs && chmod +x grm && sudo mv grm /usr/local/bin/

grm's People

Contributors

jsnjack avatar lilja avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

grm's Issues

Feature request: be able to install a list dependencies on a new system

Thanks for GRM! I've thought about this problem for a while and how it's so stupid that we need to rely on package managers like brew/apt to manage CLI dependencies, when package maintainers literally uploads their binaries to the github releases. I was just about to begin type some stupid script when I tried once again to google "package manager github releases" and found this repo on the 6th item.

My problem is this:

I, probably like you @jsnjack manage dotfiles. Whenever I clone my dotfiles repo, I tend to want to install the CLI dependencies that I want. But you tend to forget what you install. Very much like how you "setup once and forget" which is a bad plague that tools like ansible, terraform is helping to irradicate.
These are a few dependencies I just installed:

  • BurntSushi/ripgrep
  • sharkdp/bat
  • ogham/exa

How do I install these dependencies on a new system?

Switching from my product-manager hat to my solution-hat
Lots of different tools use *-file to manage configuration in files. Like Dockerfile, Vagrantfile, etc. What if there was a Grmfile that I could scribble down some fancy rust tools that I want version-controlled so whenever I git clone to a new system or pulling changes to my work machine, I could just grm install -r Grmfile(taking inspiration from pip here) and let grm handle the diffs and new additions? What say you?

grm confused whether to download checksum vs binary

I tend to get to this point often when I grm update

done
Checking zellij-org/zellij...
  installed version v0.34.4, want v0.37.2
Confirm to update: [y/n] y
Inspecting assets...
Found 2 suitable assets
  0) zellij-x86_64-apple-darwin.sha256sum
  1) zellij-x86_64-apple-darwin.tar.gz
Select suitable asset: [0-1] 1

I often have to pick out the tarball, is there something we can do to make it understand the checksum asset?

Trouble installing bat on m1/arm64/AArch64

lilja in ~/dotfiles on master λ grm update -v
Loading config from /Users/lilja/.config/grm/grm.yaml...
Checking BurntSushi/ripgrep...
Loading config from /Users/lilja/.config/grm/grm.yaml...
Using anonymous client
  installed file hash acfbc538b9248d964abdc5c8a490b0cb, want
Confirm to update: [y/n] y
Inspecting assets...
Found 1 suitable assets
  0) ripgrep-13.0.0-x86_64-apple-darwin.tar.gz
Selected asset: ripgrep-13.0.0-x86_64-apple-darwin.tar.gz
Loading config from /Users/lilja/.config/grm/grm.yaml...
Using anonymous client
 100% |████████████████████████████████████████| (2.2 MB/s) [0s:0s]
Installing /tmp/grm.eEklBd/ripgrep-13.0.0-x86_64-apple-darwin.tar.gz...
File type application/gzip
Installing from an archive
Unpacking archive... ripgrep-13.0.0-x86_64-apple-darwin.tar.gz
Unpacked to /tmp/grm.eEklBd/
Looking for a binary file...
  ripgrep-13.0.0-x86_64-apple-darwin/COPYING         text/plain; charset=utf-8
  ripgrep-13.0.0-x86_64-apple-darwin/LICENSE-MIT     text/plain; charset=utf-8
  ripgrep-13.0.0-x86_64-apple-darwin/README.md       text/plain; charset=utf-8
  ripgrep-13.0.0-x86_64-apple-darwin/UNLICENSE       text/plain; charset=utf-8
  ripgrep-13.0.0-x86_64-apple-darwin/complete/_rg    text/plain; charset=utf-8
  ripgrep-13.0.0-x86_64-apple-darwin/complete/_rg.ps1 text/plain; charset=utf-8
  ripgrep-13.0.0-x86_64-apple-darwin/complete/rg.bash text/plain; charset=utf-8
  ripgrep-13.0.0-x86_64-apple-darwin/complete/rg.fish text/plain; charset=utf-8
  ripgrep-13.0.0-x86_64-apple-darwin/doc/CHANGELOG.md text/plain; charset=utf-8
  ripgrep-13.0.0-x86_64-apple-darwin/doc/FAQ.md      text/plain; charset=utf-8
  ripgrep-13.0.0-x86_64-apple-darwin/doc/GUIDE.md    text/plain; charset=utf-8
  ripgrep-13.0.0-x86_64-apple-darwin/doc/rg.1        text/plain; charset=utf-8
  ripgrep-13.0.0-x86_64-apple-darwin/rg              application/x-mach-binary
  ripgrep-13.0.0-x86_64-apple-darwin.tar.gz          application/gzip
unable to find a binary file in archive

Picking an asset should not be zero index based

This might be super opinionated and if you don't agree that's fine.

When i'm being prompted with an asset to pick, it should start with 1.

Picking between 0 and 1 is kind of awkward as technically they are on the opposite sides of a qwerty keyboard.

Trouble installing neovim using grm, it cannot find binary path

The neovim bundle has a file structure like this:

  nvim-macos/bin/nvim                                application/x-mach-binary
  nvim-macos/lib/nvim/parser/c.so                    application/x-mach-binary
  nvim-macos/lib/nvim/parser/help.so                 application/x-mach-binary
  nvim-macos/lib/nvim/parser/lua.so                  application/x-mach-binary
  nvim-macos/lib/nvim/parser/vim.so                  application/x-mach-binary

When I let grm install it, it picked a random .mo file and installed that into /usr/bin:

$ grm install neovim/neovim -f nvim-macos/bin/nvim
Found release stable
Inspecting assets...
Found 2 suitable assets
  0) nvim-macos.tar.gz
  1) nvim-macos.tar.gz.sha256sum
Select suitable asset: [0-1] 0
Selected asset: nvim-macos.tar.gz
 100% |████████████████████████████████████████| (6.2 MB/s) [1s:0s]
Unpacking archive... nvim-macos.tar.gz
Looking for a binary file...
  nvim-macos/bin/nvim                                application/x-mach-binary
  nvim-macos/lib/nvim/parser/c.so                    application/x-mach-binary
  nvim-macos/lib/nvim/parser/help.so                 application/x-mach-binary
  nvim-macos/lib/nvim/parser/lua.so                  application/x-mach-binary
  nvim-macos/lib/nvim/parser/vim.so                  application/x-mach-binary
  nvim-macos/share/locale/af/LC_MESSAGES/nvim.mo     application/octet-stream
  <removed for brevity>
  nvim-macos/share/nvim/runtime/tools/check_colors.vim text/plain; charset=utf-8
  nvim-macos/share/nvim/runtime/tools/emoji_list.vim text/plain; charset=utf-8
  nvim-macos/share/nvim/runtime/tutor/en/vim-01-beginner.tutor text/plain; charset=utf-8
  nvim-macos/share/nvim/runtime/tutor/en/vim-01-beginner.tutor.json application/json
  nvim-macos/share/nvim/runtime/tutor/tutor.tutor    text/plain; charset=utf-8
  nvim-macos/share/nvim/runtime/tutor/tutor.tutor.json application/json
  nvim-macos.tar.gz                                  application/gzip
Installing nvim-macos/share/locale/af/LC_MESSAGES/nvim.mo in /usr/local/bin/...
done

Also, specifying this filter would not really be ideal because if I were to version control it in git, then this wouldn't really work on my linux/WSL machine.

Unable to automatically find binary for mac(eza-community/eza)

Hi! Your favorite GRM-user is back!

  System:
    OS: macOS 14.3.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 454.77 MB / 32.00 GB
    Shell: 3.7.0 - /opt/homebrew/bin/fish
$ grm install eza-community/eza
Found release v0.18.7
Inspecting assets...
Found 10 suitable assets
  1) eza.exe_x86_64-pc-windows-gnu.tar.gz
  2) eza.exe_x86_64-pc-windows-gnu.zip
  3) eza_aarch64-unknown-linux-gnu.tar.gz
  4) eza_aarch64-unknown-linux-gnu.zip
  5) eza_arm-unknown-linux-gnueabihf.tar.gz
  6) eza_arm-unknown-linux-gnueabihf.zip
  7) eza_x86_64-unknown-linux-gnu.tar.gz
  8) eza_x86_64-unknown-linux-gnu.zip
  9) eza_x86_64-unknown-linux-musl.tar.gz
  10) eza_x86_64-unknown-linux-musl.zip
Select suitable asset: [1-10] ^C⏎
$ grm version
0.54.1

Changing the binary name of an installed package

I just tried to install asciinema/agg. The binary is literally called agg-x86_64-unknown-linux-musl in the zipped file release. Which I didn't realize until I re-installed the package. I tried to run it $ agg, and got command not found.

It would be very neat if grm could rename the binary part of the release after unzipping downloading it, for example grm install asciinema/agg --binary-name agg or similar.

ARM binary is broken for me

Thanks for creating this tool, it is exactly what I was looking for!

I tried to install this on my m1 macbook pro, but the darwin_arm64 binary gives this error when trying to run it:

$ ./grm --version
zsh: exec form error: ./grm

or in bash

# ./grm --version
bash: ./grm: cannot execute binary file

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.