Giter Site home page Giter Site logo

hub-get's Introduction

hub-get

hub-get is like apt-get or npm, but for github repositories. It uses the github api v3 for basic repo searches, and can install (git clone) and list copied projects.

What hub-get is not

hub-get does not do the following

  • create repos
  • deal with issues, friends, stars, gists
  • basically any github api resource other than repository search

What hub-get is

hub-get is a way to clone easily search and clone repositories from the console while keeping them neatly organized by user in a common directory.

It is also a fun side-project, and is not intending (or pretending) to be on the same level as the aforementioned legitimate package and repository managers. The purpose is to sharpen my bash, learn from mistakes and feedback, and have something semi-useful at the same time.

Install

A checkout contains install and uninstall, neither of which take arguments. Run them to perform the desired action. Please note that the behavior is different if you run as root.

$ ./install
Installing as regular user. bash_completion not included (requires root).
Symlinked hub-get.sh to ~/bin/hub-get 
copied default.cfg to ~/.hubget.cfg

Install complete!

$ sudo ./install
Installing as root.
Symlinked ~/hub-get.sh to /usr/local/bin/hub-get
copied default.cfg to /etc/hubget/hubget.cfg
installed /etc/bash_completion.d/hubget

Install complete!

Uninstall

The uninstall script will cleanly reverse the actions of install, taking into account the user context for which it is executed (root v regular user).

The repository checkout destination remains untouched, preserving anything you've downloaded.

Using hub-get

$ hub-get --help
hub-get - github "package" manager
	hub-get <action> <repo>
	actions:  get remove upgrade list configure
	repo: username/project,  ie bibby/hub-get

configure

hub-get uses a user config file at ~/.hub-get.cfg. If it does not exist, one will be created when you set a custom parameter. The default location for downloaded repos is ~/github. To change this, issue the configure command to set repo.dir:

hub-get configure repo.dir ~/repos

In order to use the search feature, you will first have to get a personal OAuth token from github. Once obtained, you may configure that as github.oauth:

hub-get configure github.oauth '0bc4d33...'

search

Search for projects by keyword

hub-get search "options parser"

The output of which is similar to the following:

+----------------------------------------------
| Project:  optconfig
| User:  tmtm
| Language:  Ruby
| URL:  https://github.com/tmtm/optconfig
| About:  Command line option parser
+----------------------------------------------
| Project:  OptionParserWithFileOption
| User:  bianchimro
| Language:  Python
| URL:  https://github.com/bianchimro/OptionParserWithFileOption
| About:  An extension of python optparse.OptionParser to read options and arguments from a file
+----------------------------------------------
| Project:  scala-optparse
| User:  frugalmechanic
| Language:  Scala
| URL:  https://github.com/frugalmechanic/scala-optparse
| About:  Command line option parsing for scala
+----------------------------------------------

get (install, clone)

To clone a project, call hub-get install {user}/{project}

$ hub-get install bibby/hub-get

Commands clone and get are aliases of install.

The repository will be cloned into {repo.dir}/{user}/{project}. Using the defaults, this would create ~/github/bibby/hub-get.

list

To list the repos you've cloned, call hub-get list

$ hub-get list
bibby/hub-get
bibby/sscfg
christopher-barry/revpipe

You can also list projects for a single user

$ hub-get list christopher-barry
christopher-barry/revpipe

upgrade (pull)

To get the latest version of a project, call hub-get upgrade {user}/{project}

$ hub-get upgrade bibby/hub-get

Command pull is an alias of upgrade, since that's what it actually does.

remove

Remove a project with hub-get remove {user}/{project} or by its aliases rm, del, or delete.

SubTrees

hub-get uses project sscfg for configuration management. You are invited to contribute to that project as well.

Also used is JSON.sh, which was forked from dominictarr to maintain stability, as it is an active project.

Contribute!

I'm no bash expert, and often do not consider environments other than Ubuntu. So I openly invite pull requests, issues, and other communication regarding this program; particularly when it comes to portability and overall bash style.

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.