After reading this guide, you will be able to:
- Understand how the Baton SDK works
- Understand how to connect Baton SDK to your GitHub instance
- Understand how to use the CLI
- Understand how to export results in a
Before you begin
Before you begin, make sure you have everything from the list below:
- A GitHub account
Part one: Set up
Use this commands to install the Baton SDK and Baton GitHub connector:
$ brew install conductorone/baton/baton conductorone/baton/baton-github
If you don’t have Homebrew installed yet, follow this guide.
batontool by using this command:
$ baton --help
baton, you will see a console with all available commands. You can find a list of all the commands in our getting started guide, where we explain them in detail.
Now you have the
baton ready to use. It’s time to show you how to use
baton-github to create a
Once we’ve successfully run the
baton-github connector, we will be left with a new
c1zfiles contain all of the information that the connector has collected as part of a synchronization process. Using the Baton CLI, you can browse the contents of the
sync.c1zfile and export that data to a .csv or .xlsx file.
Part two: Connect GitHub connector
The Github connector allows you to manage access rights for all users across all repositories. Setting up the connector is very simple, so let’s take a look at how to do it.
Create a new Github Personal Access Token with the following permissions:
Area Scope of access repo All admin:org All user All
Save your Personal Access Token. You will need it in step 3.
baton-githubconnector, passing in the token value you just created.
$ BATON_TOKEN=<github access token goes here> baton-github --orgs <github org>
Now that you’ve run
baton-github successfully, you should find a new
sync.c1z file in your working directory.
Part three: Export your
.csv files from GitHub
For exporting your data from Github run this command:
$ baton export csv
This command creates a new file (
sync.csv) in your current directory.
Wasn’t that easy? This integration is the entry point to the Baton project. The Baton ecosystem aims to simplify gathering information from a number of other systems, including AWS and MySQL. You can even use the SDK to build your own connector for your internal applications or any other service that you’d like.
See how to use the Baton SDK for your application or check out our other tutorials to discover the full potential of Baton: