43 releases

0.6.2 Sep 7, 2020
0.6.1 Jun 26, 2020
0.5.0 Oct 29, 2018
0.4.9 Jun 29, 2018
0.2.0 Mar 20, 2016

#825 in Web programming

Download history 62/week @ 2024-03-24 184/week @ 2024-03-31 51/week @ 2024-04-07 65/week @ 2024-04-14 74/week @ 2024-04-21 72/week @ 2024-04-28 68/week @ 2024-05-05 79/week @ 2024-05-12 90/week @ 2024-05-19 67/week @ 2024-05-26 67/week @ 2024-06-02 30/week @ 2024-06-09 79/week @ 2024-06-16 111/week @ 2024-06-23 15/week @ 2024-06-30 5/week @ 2024-07-07

218 downloads per month
Used in 13 crates

MIT license



a Rust interface for GitHub


Add the following to your Cargo.toml file

hubcaps = "0.6"


Basic usage requires a user agent string and optionally a flavor of hubcaps::Credentials for making requests as a particular GitHub user.

For user authenticated requests you'll typically want to use hubcaps::Credentials::Token with a personal access token.

use hubcaps::{Credentials, Github};

fn main() {
  let github = Github::new(

GitHub instances define methods for accessing api services that map closely to their url structure.

As a convention, api methods that expect arguments are represented as functions that accept a struct representing those arguments with an optional builder interface for convenience of construction.

See examples directory for some getting started examples


Typically the reference point of most GitHub services is a repository

let repo = github.repo("user", "repo");

With a repo instance on hand, you can access a number of sub services, like labels, deployments, pulls, issues, releases, and many more. Each of this are named functions exported from the repo interface.

See examples directory for examples


Branches is a service for listing repository branches

let branches = repo.branches();


Labels is a service for tagging resources like issues and pulls with names which you can later group and filter on.

use hubcaps::labels::LabelOptions;

let labels = repo.labels();

// create new labels
      "rustic", "ccc"


Deployments is a service for orchestrating deployments of applications sourced from GitHub repositories

let deployments = repo.deployments();

See examples directory for examples


Pulls is a service for issuing code change requests against a repository

let pulls = repo.pulls();

See examples directory for examples


Issues is a service for tracking bugs for a repository

let issues = repo.issues();

See examples directory for examples


Releases is a service for tracking changes for a stable releases of a versioned library or application

let releases = repo.releases();


Gists is a service for micro repositories

let gists = github.gists();

See examples directory for examples


Hooks is a service for managing repository hooks

let hooks = repo.hooks();

See examples directory for examples

Search provides a raw string query search for indexed data. Currently only search for issues is supported

let search_issues = github.search().issues();


Teams is a service for listing repository and organization teams

let teams = repo.teams();

See examples directory for examples

Doug Tangren (softprops) 2015-2020


~588K SLoC