Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
G

ghee

> 编程语言
Open source

This is an unofficial ruby client for the Github API. The end goal is a complete, simple, and intuitive ruby API for all things Github.

161 stars0 likes2 views
WebsiteGitHub

About

This is an unofficial ruby client for the Github API. The end goal is a complete, simple, and intuitive ruby API for all things Github.

Ghee

This is an unofficial ruby client for the GitHub API. The end goal is a complete, simple, and intuitive ruby API for all things Github.

Usage

Instantiate the client with basic auth:

gh = Ghee.basic_auth("rauhryan","password")

Instantiate the client with auth token:

gh = Ghee.access_token("1234oijgakjioewj1o4oij")

Create an OAuth access token:

user_name, password, scopes = "rauhryan", "secret", ["user","repo"]
token = Ghee.create_token(user_name, password, scopes)

Create a client for github enterprise

gh = Ghee.access_token("your_token","https://foo.com")
gh = Ghee.basic_auth("your_user", "your_pass", "https://foo.com")

Gists

Usage

List a user's gists:

gh.user('jonmagic').gists

List authenticated users gists:

gh.gists

List all public gists:

gh.gists.public

List the authenticated user's starred gists:

gh.gists.starred

Get a single gist:

gist_id = "1393990"
gh.gists(gist_id)

Create a gist (see docs for all possible params):

gh.gists.create({
  :description => 'Ghee'
  :public => true,
  :files => {
    'file1.txt' => {
      :content => 'buttah yo bread'
    }
  }
})

Edit a gist:

gh.gists("1393990").patch({
  :files => {
    'gistfile1.md' => {
      :content => 'clarified I say'
    }
  }
})

Star a gist:

gh.gists("1393990").star

Unstar a gist:

gh.gists("1393990").unstar

Check if a gist is starred:

gh.gists("1393990").starred?

Delete a gist:

gh.gists("1393990").destroy

Comments

List comments for a gist:

gh.gists("1382919").comments

Get a single gist comment:

gh.gists.comments("1231414")

Create a single gist comment:

gh.gists.comments("1231414").create({
   :body => "new body"
})

Patch a single gist comment:

gh.gists.comments("1231414").patch({
   :body => "new body"
})

Delete a comment for a gist:

gh.gists.comments("1231441").destroy

Repos

Get a single repo:

gh.repos("rauhryan", "ghee")

Pulls

List pull requests on a repo (see List pull requests )

gh.repos("rauhryan", "ghee").pulls

gh.repos("rauhryan", "ghee").pulls({
  :state => "closed" # optional
})

Get a single pull request on a repo (see Get a single pull request )

gh.repos("rauhryan", "ghee").pulls(1097)

Create a pull request (see Create a pull request )

gh.repos("rauhryan", "ghee").pulls.create({
    :title=>"take my awesome code!",
    :body=>"This code is so awesome. Let me tell you why...",
    :base=>"master",
    :head=>"octocat:awesomebranch"
})

Update a pull request (see Update a pull request )

gh.repos("rauhryan", "ghee").pulls(1097).patch({:title=>"New title", :body=>"New body", :state=>"closed"})

List commits on a pull request (see List commits a pull request )

gh.repos("rauhryan", "ghee").pulls(1097).commits

List files on a pull request (see List files a pull request )

gh.repos("rauhryan", "ghee").pulls(1097).files

Get if a pull request has been merged (see Get if a pull request has been merged )

gh.repos("rauhryan", "ghee").pulls(1097).merged? #=> true

Merge a pull request (see Merge a pull request )

gh.repos("rauhryan", "ghee").pulls(1097).merge!  
gh.repos("rauhryan", "ghee").pulls(1097).merge!("It's like hitting the Merge Button(TM)")

Commits

List commits on a repo:

gh.repos("rauhryan", "ghee").commits

gh.repos("rauhryan", "ghee").commits({
  :sha => "awesome_branch" # optional
})

gh.repos("rauhryan", "ghee").commits( {
  :path => "/path/to/file" # only commits containing this path
})

Get a single commit:

gh.repos("rauhryan", "ghee").commits("sha")

List commit comments for a repo:

gh.repos("rauhryan", "ghee").comments

List comments for a single commit:

gh.repos("rauhryan", "ghee").commits("sha").comments

Create a commit comment:

gh.repos("rauhryan", "ghee").commits("sha").comments.create({
  :body => "sweet codez yo!", #required
  :commit_id => "sha", #required
  :line => 123, #required
  :path => "/path/to/file", #required
  :position => 4 #required
})

Get a single commit comment:

gh.repos("rauhryan", "ghee").comments(123)

Update a commit comment:

gh.repos("rauhryan", "ghee").comments(123).patch(:body => "new text")

Destroy a commit comment:

gh.repos("rauhryan", "ghee").comments(123).destroy

Compare two commits:

gh.repos("rauhryan", "ghee").compare("basesha","headsha")

Collaborators

List a repos collaborators:

gh.repos("rauhryan", "ghee").collaborators

Get a single collaborator:

gh.repos("rauhryan", "ghee").collaborators("herp") # => false

gh.repos("rauhryan", "ghee").collaborators("jonmagic") # => true

Add a collaborator:

gh.repos("rauhryan", "ghee").collaborators.add("herp") # => true

Remove a collaborator:

gh.repos("rauhryan", "ghee").collaborators.remove("herp") # => true

Forks

List the hooks for a repo:

gh.repos("rauhryan", "ghee").forks

gh.repos("rauhryan", "ghee").forks(:sort => "newest") # => `newest`, `oldest`, `watchers`

Create a fork:

gh.repos("rauhryan", "ghee").forks.create # => forks the repo to the authenticated user

Keys

List the keys for a repo:

gh.repos("rauhryan", "ghee").keys

Get a single key for a repo:

gh.repos("rauhryan", "ghee").keys(123)

Create a key for a repo:

gh.repos("rauhryan", "ghee").keys.create({
  :title => "customer deploy key",
  :key => "ssh-rsa AAA ..."
})

Update a key for a repo:

gh.repos("rauhryan", "ghee").keys.patch({
  :title => "customer deploy key",
  :key => "ssh-rsa AAA ..."
})

Destroy a key for a repo:

gh.repos("rauhryan", "ghee").keys(123).destroy # => true

Hooks

Get the hooks for a repo:

gh.repos("rauhryan", "ghee").hooks

Get a single hook for a repo:

gh.repos("rauhryan", "ghee").hooks(12)

Create a hook for a repo: (see docs for all possible params):

gh.repos("rauhryan", "ghee").hooks.create({
  :name => "web",
  :config => {:url => "http://huboard.com/webhook"}
})

Update a hook for a repo: (see docs for all possible params):

gh.repos("rauhryan", "ghee").hooks(12).patch({
  :name => "web",
  :config => {:url => "http://huboard.com/webhook"}
})

Destroy a hook for a repo:

gh.repos("rauhryan", "ghee").hooks(1).destory

Downloads

Get the downloads for a repo:

gh.repos("rauhryan", "ghee").downloads

Get a single download for a repo:

gh.repos("rauhryan", "ghee").downloads(12)

Create a download for a repo:

gh.repos("rauhryan", "ghee").downloads.create("/path/to/file","description")

Destroy a download for a repo:

gh.repos("rauhryan", "ghee").downloads(12).destroy

Watchers

List watchers for a repo:

gh.repos("rauhryan", "ghee").watchers

List repos being watched:

gh.user.watched

gh.users("jonmagic").watched

Check if you are watching a repo:

gh.user.watching? "rauhryan", "huboard"

Watch a repo:

gh.user.watch "rauhryan", "huboard"

Unwatch a repo:

gh.user.watch! "rauhryan", "huboard"

Milestones

Get the milestones for a repo:

gh.repos("rauhryan", "ghee").milestones

Get a single milestone for a repo:

gh.repos("rauhryan", "ghee").milestones(12)

Create a milestone for a repo: (see docs for all possible params):

gh.repos("rauhryan", "ghee").milestones.create({
  :title => "Remove the suck!",
  :description => "I found this suck, remove it please"
})

Update a milestone for a repo: (see docs for all possible params):

gh.repos("rauhryan", "ghee").milestones(12).patch({
  :description => "I found this suck, remove it please"
})

Destroy a milestone for a repo:

gh.repos("rauhryan", "ghee").milestones(1).destory

Issues

Get the issues for a repo:

gh.repos("rauhryan", "ghee").issues

Get a single issue for a repo:

gh.repos("rauhryan", "ghee").issues(12)

Create an issue for a repo: (see docs for all possible params):

gh.repos("rauhryan", "ghee").issues.create({
  :title => "Remove the suck!",
  :body => "I found this suck, remove it please"
})

Update an issue for a repo: (see docs for all possible params):

gh.repos("rauhryan", "ghee").issues(12).patch({
  :body => "I found this suck, remove it please"
})

Close an issue for a repo:

gh.repos("rauhryan", "ghee").issues(12).close

Get the closed issues for a repo:

gh.repos("rauhryan", "ghee").issues(12).closed

Comments

Get the comments for an issue:

gh.repos("rauhryan", "ghee").issues(12).comments

Get a single comment for an issue

gh.repos("rauhryan", "ghee").issues.comments(482910)

Create a comment for an issue:

gh.repos("rauhryan", "ghee").issues(12).comments.create({:body => "hey i'll help fix that suck"})

Update a single comment for an issue

gh.repos("rauhryan", "ghee").issues.comments(482910).patch({:body =>
      "nevermind I can't figure it out"})

Destroy a comment for an issue

gh.repos("rauhryan", "ghee").issues.comments(482910).destroy

Orgs

Usage

Get a list of orgs for the current user:

gh.orgs

Get a specific org:

gh.orgs("huboard")

Patch an organization:(see docs for all possible params):

gh.orgs("huboard").patch({ :company => "awesome company" })

Repos

Get a list of repos for an org:

gh.orgs("huboard").repos

Notes: see above for all the available api methods for repos

Teams

Get a list of teams for an org:

gh.orgs("huboard").teams

Get a single team for an org:

gh.orgs("huboard").teams(110234)

Create team for an org:

gh.orgs("huboard").teams.create :name => "awesome_developers"

Patch a team for an org:

gh.orgs("huboard").teams(110234).patch :name => "junior_developers"

Delete a team for an org:

gh.orgs("huboard").teams(110234).delete

Members

Get a list of members for a team:

gh.orgs("huboard").teams(110234).members

Add a member to a team:

gh.orgs("huboard").teams(110234).members.add("rauhryan")

Remove a member from a team:

gh.orgs("huboard").teams(110234).members.remove("rauhryan")

Teams

Usage

Get a single team:

gh.team(110234)

Create a team:

gh.team.create :name => "awesome_developers"

Patch a team:

gh.team(110234).patch :name => "junior_developers"

Delete a team:

gh.team(110234).delete

Members

Get a list of members for a team:

gh.team(110234).members

Add a member to a team:

gh.team(110234).members.add("rauhryan")

Remove a member from a team:

gh.team(110234).members.remove("rauhryan")

Users

Usage

Get a single user:

gh.users('jonmagic')

Get the authenticated user:

gh.user

Update authenticated user ([see docs for all po

Issues· 10 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Ruby

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言