Simple cli to export github v2 projects to csv
./github-project-to-csv.rb --project https://github.com/users/fiedl/projects/2 --output project.csv
If you do encounter errors here, please check the troubleshooting section to make sure you have the correct ruby version and gems installed, or run the script via docker.
- Install the github cli:
brew install gh
- Clone this repo:
git clone https://github.com/fiedl/github-project-to-csv.git
Instead of using the gh
command-line client, this tool also supports github personal access tokens. However, github does only support classic personal access tokens for now; fine-grained tokens do not work, yet.
Create a classic token xxx
at https://github.com/settings/tokens. Then:
./github-project-to-csv.rb --project https://github.com/users/fiedl/projects/2 --output project.csv --token xxx
If you don't have a local ruby environment, it might be easiest to run this script via docker.
Install docker including the compose plugin: https://docs.docker.com/compose/install/
Then run this from the repository directory:
docker compose run app bundle exec ruby github-project-to-csv.rb --project https://github.com/users/fiedl/projects/2 --output project.csv --token xxx
When not using an access token, this might ask you to manually open a web browser and copy an authentication code in order to authenticate with github.
Your local ruby version is too old. Please update according to the ruby documentation or run the script via docker.
Some gems are missing locally. Run:
gem install pry httparty
- Github documentation on the projects api
- Introduction to GraphQL
- Understanding GraphQL Queries
- Github GraphQL Object Reference
- Github GraphQL API Explorer
(c) 2023, Sebastian Fiedlschuster
MIT License