Giter Site home page Giter Site logo

topictool's Introduction

Topictool

CLI Tool to manage topic labels on Github repositories

Installation

go get github.com/cbrgm/topictool

or

git clone [email protected]:cbrgm/topictool.git && cd topictool
go mod vendor && make

Usage

You'll need a Github Personal Access Token to use this tool. Create one for your user (Settings -> Developer Settings -> Personal Access Token) and grant read/write access for repositories to it. In case you want to modify private repositories of an organization please authorize SSO.

export GH_ACCESS_TOKEN=<your-token>

then run the topictool.

Usage: topictool <subcommand> <search pattern> <topic labels...>

Replace, add or remove topic labels from multiple Github repositories

Subcommands:
    - replace   - replaces all existing topic labels with new ones
    - add       - adds topic labels to existing ones
    - rm        - removes topic labels from existing ones
    
Search Pattern:
    Searches repositories via various criteria.
    See Github docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/search/#search-repositories

Topic Labels:
    A list of strings representing topic labels

Examples

Add a labels foo and bar to the repository cbrgm/topictool

topictool add "cbrgm/topictool" "foo" "bar"
Repository Name	Topics	
 ---		---	
 cbrgm/topictool	

 Add labels [foo,bar] to 1 repositories? [y/n/q]:
 
 > y
 
 Done!

Add a labels foo and bar to all repositories of user cbrgm

topictool add "user:cbrgm" "foo" "bar"
Repository Name			Topics								
 ---				---								
 cbrgm/telegram-robot-rss		bot,messenger,python,rss,rss-feed,rss-reader,telegram-bot			
 cbrgm/go-t			        cli,command-line,go,golang,twitter,twitter-api,twitter-client		
 cbrgm/clickbaiter			advertising,clickbait,generation,generator,go,golang,useless		
 cbrgm/terraform-k8s-hetzner		bash,hetzner,hetzner-cloud,kubernetes,terraform				
 cbrgm/authproxy			api,authentication,client,kubernetes,middleware,token,webhook		
 cbrgm/kubernetes-rbac-groups		authorization,cluster,kubernetes,rbac	
 
Add labels [foo,bar] to 6 repositories? [y/n/q]:

> y

Done!

Replace all labels with foo and bar for all repositories of user cbrgm already having a topic foo

topictool replace "user:cbrgm topic:foo" "foo" "bar"
Repository Name			Topics								
 ---				---								
 cbrgm/telegram-robot-rss		bot,messenger,python,rss,rss-feed,rss-reader,telegram-bot,foo			
 cbrgm/go-t			        cli,command-line,go,golang,twitter,twitter-api,twitter-client,foo		
 cbrgm/clickbaiter			advertising,clickbait,generation,generator,go,golang,useless,foo		
 cbrgm/terraform-k8s-hetzner		bash,hetzner,hetzner-cloud,kubernetes,terraform,foo				
 cbrgm/authproxy			api,authentication,client,kubernetes,middleware,token,webhook,foo		
 cbrgm/kubernetes-rbac-groups		authorization,cluster,kubernetes,rbac,foo	
 
Replace all existing topic labels with [foo,bar] in 6 repositories? [y/n/q]:

> y

Done!

Contributing & License

Feel free to submit changes! See the Contributing Guide. This project is open-source and is developed under the terms of the Apache 2.0 License.

topictool's People

Contributors

dependabot[bot] avatar cbrgm avatar

Stargazers

Andrew Johnson avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.