Hubmaster is a rubygem that allows GitHub API interaction in Terminal. The current version only permits repository interactions, but feel free to fork and contribute!
Table of Contents ## Installation
To use as a library, add this line to your application's Gemfile:
And then execute:
To use as a command line tool, run:
sudo gem install hubmaster
Hubmaster is a library written in ruby that makes interfacing with github a snap! In adition to being a library, hubmaster also includes an executable command line tool that allows github web operations to be carried out in terminal. The rest of the document details how hubmaster should be used, but there are a few things to note beforehand.
The general form for executing commands is
hub repos --modifier [params]. All parameters that include spaces must be encased in quotes.
Any parameter that you ommit, you will be prompted for later. This can be helpful when dealing with multi-word parameters or absent-mindedness.
BEWARE: For the purposes of this document, when words are surrounded by brackets, the indicated value should be placed there without brackets.## Repository Documentation
This section of the documentation includes all the necessary information on interfacing with repositories through hubmaster. There are five main functions that will be described in further detail: List, Get, Create, Edit, and Delete.### List ***
The list function provides an easy way to see both your repositories, or the repositories of someone you know.
To list all of the repositories associated with your account, you would execute:
hub repos --list
To list all of the repositories linked with someone elses account, you would execute:
hub repos --list [username]
Remember: In place of "[username]" you should place the username of the person whos repositories you would like to see.### Get ***
The "get" function carries out operations that refer to a single repository. There are 7 simple modifiers bundled within this function that do the following:
- List the contributors of a repository,
- List the languages used in a repository,
- List the teams associated with a repository,
- List the tags of a repository,
- List the various branches of a repository,
- Return information on a specific branch, and
- Return information on a specific repository.
The general form for making get requests is as follows:
hub repos --get -operator [user] [repository name] [sometimes branch]
If you wish to get information on one of your own repositories, either use your login or "self" for the [user] parameter#### Get Contributors ***
To list all of the contributors for a specific repository, execute the following:
#### Get Languages ***
hub repos --get -contributors [user] [repository name]
To display all of the languages used and how many bits of each were used, the following can be used:
#### Get Teams ***
hub repos --get -languages [user] [repository name]
To show all of the teams associated with a specific repository, run:
#### Get Tags ***
hub repos --get -teams [user] [repository name]
If you want to find all of the tags for a given repository, type:
#### Get Branches ***
hub repos --get -tags [user] [repository name]
To list all of branches under a given repository, run:
#### Get Branch ***
hub repos --get -branches [user] [repository name]
If you want to get information on a specific branch of a repository, use:
#### Get Repository ***
hub repos --get -branch [user] [repository name] [branch name]
To get information on a specific repository, all you need to do is execute:
### Create ***
hub repos --get -repository [user] [repository name]
Creating repositories from terminal is both extreemly easy and usefull.
To create a new repository, all you have to do is run:
hub repos --create [name] [description]
If the description of your repository contains multiple words (usually they do), you have two options:
- Encase the description in quotes
- Execute the command with no description parameter and you will be prompted for it later.
If you wish to edit an existing repository, the general form is as follows:
hub repos --edit [name] -option [option dependent variable]
The edit command takes several parameters and can be kind of canfusing, so let me break it down a bit for you:
Identify the name of the repository you wish to edit -> [name].
Specify an option, or element, that you wish to edit -> -option.
Provide the new value for the element that you specified in step two -> [option dependent variable]
The edit command only allows you to modify the description of a repository at this time. An description specific example of this would look like:
hub repos --edit [name] -description [description]
If you wish to delete an existing repository, all you have to do is:
hub repos --delete [name]
To confirm that you do in fact wish to delete this repository, you will be prompted to enter the name of the repository again.