Code Monkey home page Code Monkey logo

git-labelmaker's Introduction

๐ŸŽ git-labelmaker travis-build-badge Coverage Status Join the chat at https://gitter.im/himynameisdave/git-labelmaker

Edit GitHub labels from the command line using git-labelmaker! You can easily add or remove GitHub labels, making it easier for your projects to adhere to a sane labelling scheme.

Install

Install git-labelmaker globally:

yarn global add git-labelmaker

OR

npm i -g git-labelmaker

Currently you must be using version >= 4.0.0 of node, because we're using some fancy-shmancy ES6 stuff (Promises are too awesome to not use), and also because the dependant package git-label also currently requires >= 4.0.0.

Use npm version >= 3.9.0,

Usage

Using this bad boy is a breeze. First cd into your git repository, run the command and follow the prompts!

git-labelmaker

Preview of git-labelmaker

Token

To interact with the GitHub API, you will need your own access token, which you can generate over here. Make sure your token has repo permissions.

Instead of having to enter your token each time, git-labelmaker will remember it and keep it secure for you while you instead only need to remember a password you create. You can make your password whatever you like - passwords are easier to remember than tokens!

Currently, git-labelmaker only supports calling the public GitHub API. If you are using GitHub Enterprise and have a custom API path, you might want to check out git-label instead.

Add Custom Labels

You can add your own labels one at a time. You will be prompted for your new label's text and color. Include the # in front of your 3 or 6 digit hex color. Add as many as you like!

Add Labels From Package

If you have a labels package in your current directory that you would like to use for adding labels, just supply the path and name of that file. So like if it's at the root of the current directory, just labels.json.

It must be a valid, parsable JSON file (although the extension doesn't matter). Check out these really good ones if you need a template.

Create Package From Labels

Create a git label package from the current labels on a repo, so that you can easily use it again.

Remove Labels

You can also remove labels. Just select the ones you want to ditch and ๐Ÿ’ฅ they're gone.

Contributing

Feel free to contribute to the project by opening a Pull Request, filing a new issue, or by barking at me on the twitters.

Related Stuff:

  • git-label by jasonbellamy, which git-labelmaker uses to add and remove labels
  • git-label-packages is a really good set of default packages if you really want to level up your projects
  • git-label-faces is a joke package set that you should totally never use for real
  • Sane GitHub Labels - an article I wrote about the importance of a good, rational labelling system in your projects

Created by Dave Lunny in the glorious year of 2017. Licensed under MIT โœ‹

git-labelmaker's People

Contributors

gitter-badger avatar himynameisdave avatar jameskmonger avatar newalexandria avatar perry-mitchell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

git-labelmaker's Issues

Allow plain word colors

I'd like to map each web color to it's hex value, that way users can specify a color using a simple word instead of a hex or rgb value

Buttercup throwing error

Not sure wtf is going on, but here's a log of the error:

screen shot 2016-03-21 at 7 46 02 pm

Happened when trying to run it for the first time in like a month

Better support for older noders

Right now everything is very ES6-entric but it would be better to do a src/ and bin/ or something where the distribution or bin/ file was run through like the babel or something. Those promises be risky.

And then also add to the docs about minimum node versions and stuff.

Display friendlier error

I think we should be showing a friendlier error than the "Encrypted content has been tampered with" when the user enters the incorrect password.

Allow resetting the token if you can't access it

Allowing the user to reset their token if they can't access the archive (a forgotten password kind of feature) would mean that they can delete the archive if it exists, and creates a new one.

It would prevent any issues similar to last night! ๐Ÿ˜›

ability to remove current labels

Ability to remove current labels. So the first prompt will be "add or remove" and then list all current ones and you can select which to remove.

Allow RGB colours

Rather than only accepting 3/6 digit hex colours, RGB colours could also be accepted as an input.

Add a list of project using this tool

Hello,

I think it would be a great addition to add a list of projects using this tool. It would be like a portfolio to show to someone to convince them to use it.

What do you think?

Add update warning

Would be nice to alert the user that there is a new version of the package available for download

Update inquirer dep

Upgrading would allow us to use the promise-based inuirer.

Currently at 0.11.4, wanted 3.0.6.

Safer token storage

See if we can lock that token.json file down or something, or store it as an env variable and then check it out every time?

Very least some kind of chmod so an malicious attack would have to sudo at least (?)

Error: Encrypted content has been tampered with

I got this error when running the program

capture d ecran 2016-02-22 a 12 21 17

โžœ ~/www/veldto.com (master) git-labelmaker
? What is your master password? *********
Failed opening archive: Error: Encrypted content has been tampered with
{ id: 'TOKEN',
  err: 'Failed opening archive: Error: Encrypted content has been tampered with' }

TypeError: Cannot read property 'split' of undefined

node -v
v6.10.1
npm -v
3.10.10
git-labelmaker
? What is your GitHub Access Token?
? What is your master password, to keep your access token secure? ******
TypeError: Cannot read property 'split' of undefined
at module.exports (/usr/lib/node_modules/git-labelmaker/bin/modules/readRepo.js:14:32)
at Promise.all.then (/usr/lib/node_modules/git-labelmaker/bin/index.js:38:19)

For now I have uninstalled git-labelmaker. It is promising though ;-)

Ability to reset the token

Tokens come and go and sometimes people fuck up and install the wrong one. Okay so there should be a parameter (-t or something) that will reset the token.

Password displayed in plain text

When entering your password to unlock the archived token (after you've already successfully set it), the password is displayed in plain text.

Path to labels.json

Currently with option Add Labels From Package I can only take the path from current directory, it would be awesome if I could specify path to some other directory with my labels.json or even HTTP so I can use a Gist.

"Clear All" option

"Clear All" option would be rad. It would delete all current labels in a repo.

Failed opening archive: Error: Encrypted content has been tampered with

Recently updated git-labelmaker and am now getting this error frequently. I've recreated the token multiple times now which gets it working for a few commands, but I see this message again within minutes.

To reproduce:

  • set your token
  • run commands (I can usually run a few in quick succession before seeing this error)
  • $ git-labelmaker
  • choose: use saved token
  • type your master password
  • See error: Failed opening archive: Error: Encrypted content has been tampered with


Not sure if this is a bug or a setup issue on my end. Hoping someone might point me in the right direction. (fwiw git-labelmaker has worked perfectly for me the better part of this year - saved me SO much time ๐Ÿ’ฅ )


Ninja edit: It appears that if I ctrl+c when shown that error and restart the process, it no longer thinks the content has been tampered with.

Feature Request: Support setting global package

One of the main pieces that would help speed up using git-labelmaker is including an option for using a package from a file as the default package to use when no input is given for Add Labels from Package. This way you can just simply use one package for all of your repos.

I'd definitely be willing to submit a PR if the maintainers think this is a good idea.

Will not accept custom package file

npm v3.6.0
node v5.6.0

Running git-labelmaker, enter my password, and choose Add Labels From Package. I'm prompted for a path. I have tried all of these (test file located at each)

packages/github_labels.json
github_labels.json
.github_labels.json

contents of file

[
  { "name": "ready", "color": "#159818" },
  { "name": "blocked", "color": "#e11d21" },
  { "name": "open comments", "color": "#eb6420" },
  { "name": "proposal-discussion", "color": "#84b6eb" },
  { "name": "question", "color": "#cc317c" },
  { "name": "On Hold", "color": "#666666" },
  { "name": "Revision Needed", "color": "#bfdadc" }
]

I hope this helps solve an issue - or improve the docs! Thanks for your help.

Add some testing

It's been too long that there aren't any tests for this... tsk tsk tsk ๐Ÿ‘Ž

Support GitLab

Just a question(type), I see that most of the code refers to GitHub,
but I was wondering if you are thinking of maybe supporting GitLab as well?

P.S.: The only decent NodeJS Gitlab API wrapper I found is this one, but doesn't support labels from what I can see...

TypeError: Cannot read property 'url' of undefined

TypeError: Cannot read property 'url' of undefined
 at module.exports (/usr/local/lib/node_modules/git-labelmaker/bin/modules/readRepo.js:13:40)
 at Promise.all.then (/usr/local/lib/node_modules/git-labelmaker/bin/index.js:38:19)

I've a repo with dots like com.foobar.www maybe that's a Problem.
Any Idea how I can fix that?

Node 7.4.0

Some metrics would be nice

Would be nice to track which features of the tool users are using most often. Also error reporting would be key.

Maybe mixpanel or something

Add a link to the article

Hello,

Nice project you got there. I just read your medium article and I think you should link it from this repo.
You can copy it and put it on the wiki. You can add an url to the Readme. As you want. ๐Ÿ˜„

Cheers,

Update npm description

I think that we should change:

Create git labels from the command line using git-label!

to:

Manage your GitHub labels from the command line!

Update buttercup dep

Update buttercup dependency from ~0.24.0 to latest (which is 0.37.0 at time of writing).

Tested it, and it looks like there were some significant changes as upgrading will break it git-labelmaker.

Require sudo to store token?

It seems that the .git-labelmaker.bcup is written to /usr/local/lib/node_modules/git-labelmaker, which means that I need to be a privileged user (sudo git-labelmaker) to store my token?
eg. If i dont run with sudo first, I'm prompted for my token every time.

Would not it make more sense to use some XDG directory (data or config or something) to store the token under the users home directory? Or is intended functionality? Or am I confused about something else?

Code Cleanup

  • Move some functions into modules (ie: fetchToken)
  • Maybe rename 'components/' directory?
  • Prompts should have their own directory for sure
  • see how to reduce code clutter/make functions more pure (pure-er?)
  • use a bin/ and a src/ directory, make babel compile shit to bin/ this is technically #16 so we'll call it out of scope for this issue

Provide a way for the user to escape from their current selection

If I select the wrong option in the CLI, or change my mind and want to return to the previous menu, it appears the only current recourse is to CTRL+C and restart the program. This requires re-entering a token or the saved token password and navigating back through the menus.

For example, if I follow the prompts to the "Which label would you like to remove?" option, I must select at least one, and there is no way back to the previous prompt. The keys 'esc' and 'q' (two intuitive options) don't appear to have any effect. Thus, if I don't actually want to remove a label, I'm stuck in at this prompt.

screen shot 2017-07-17 at 15 12 47

(Great tool by the way, super useful!)

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.