{"id":20066420,"url":"https://github.com/itgalaxy/labelify","last_synced_at":"2026-05-02T18:40:46.192Z","repository":{"id":37686756,"uuid":"131302483","full_name":"itgalaxy/labelify","owner":"itgalaxy","description":"Automate and simplify the creation of labels for your repository.","archived":false,"fork":false,"pushed_at":"2023-01-04T21:36:35.000Z","size":2587,"stargazers_count":0,"open_issues_count":19,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-13T13:05:01.206Z","etag":null,"topics":["git","github","gitlab","label","labeling","labeling-tool","labels"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itgalaxy.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-27T13:49:17.000Z","updated_at":"2019-11-05T16:29:45.000Z","dependencies_parsed_at":"2023-02-02T20:46:20.552Z","dependency_job_id":null,"html_url":"https://github.com/itgalaxy/labelify","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itgalaxy%2Flabelify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itgalaxy%2Flabelify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itgalaxy%2Flabelify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itgalaxy%2Flabelify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itgalaxy","download_url":"https://codeload.github.com/itgalaxy/labelify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241494184,"owners_count":19971871,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","github","gitlab","label","labeling","labeling-tool","labels"],"created_at":"2024-11-13T13:57:03.709Z","updated_at":"2026-05-02T18:40:41.170Z","avatar_url":"https://github.com/itgalaxy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--lint disable no-html--\u003e\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"logo/vertical.png\" alt=\"labelify\" height=\"150px\"\u003e\u003c/p\u003e\n\n\u003c!--lint enable no-html--\u003e\n\n# labelify\n\n[![NPM version](https://img.shields.io/npm/v/labelify.svg)](https://www.npmjs.org/package/labelify)\n[![Travis Build Status](https://img.shields.io/travis/itgalaxy/labelify/master.svg?label=build)](https://travis-ci.org/itgalaxy/labelify)\n[![dependencies Status](https://david-dm.org/itgalaxy/labelify/status.svg)](https://david-dm.org/itgalaxy/labelify)\n[![devDependencies Status](https://david-dm.org/itgalaxy/labelify/dev-status.svg)](https://david-dm.org/itgalaxy/labelify?type=dev)\n\nAutomate and simplify the creation of labels for your GitHub/GitLab/Send_a_PR_For_You_Platform repository.\n\n## Highlights\n\n- Support configuration file.\n- Support GitHub/GitLab platforms (include self hosted solutions).\n- CLI.\n- Promise interface.\n- Simple usage.\n\n## Installation\n\n```shell\nnpm i -D labelify\n```\n\n## Getting Started\n\n1.  Create configuration file with your labels (add options if you need them) in root of your project.\n    Recommended to create `labelify.config.js` file in root project directory or use `labelify` property in `package.json`.\n\n    Example `labelify.config.js` file (basic `github` labels):\n\n    ```js\n    module.exports = {\n      // You can use any config options here.\n      // config: { overlap: true },\n      labels: [\n        {\n          color: \"#ee0701\",\n          name: \"bug\"\n        },\n        {\n          color: \"#cccccc\",\n          name: \"duplicate\"\n        },\n        {\n          color: \"#84b6eb\",\n          name: \"enhancement\"\n        },\n        {\n          color: \"#128A0C\",\n          name: \"help wanted\"\n        },\n        {\n          color: \"#e6e6e6\",\n          name: \"invalid\"\n        },\n        {\n          color: \"#cc317c\",\n          name: \"question\"\n        },\n        {\n          color: \"#ffffff\",\n          name: \"wontfix\"\n        }\n      ]\n    };\n    ```\n\n2.  Add `labelify` command in `package.json`.\n\n    ```json\n    {\n      \"scripts\": {\n        \"labelify\": \"labelify\"\n      }\n    }\n    ```\n\n3.  Creating a personal access token for the command line\n\n    - [github](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/)\n    - [gitlab](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html)\n\n4.  Run npm script.\n\n    NPM:\n\n    ```shell\n    TOKEN=YOUR_SECRET_TOKEN npm run labelify\n    ```\n\n    Yarn:\n\n    ```shell\n    TOKEN=YOUR_SECRET_TOKEN yarn labelify\n    ```\n\n## Configuration file\n\nConfiguration file contains:\n\n- List of labels (**Required**).\n- Config (**Optional**)\n\n[Find and load a configuration object algorithm](https://github.com/davidtheclark/cosmiconfig#cosmiconfig).\n\nExample configuration file:\n\n**labelify.config.js**\n\n```js\nmodule.exports = {\n  // You can use any config options here.\n  config: {\n    // overlap: true,\n  },\n  labels: [\n    {\n      color: \"#111111\",\n      name: \"1\"\n    },\n    {\n      color: \"#222222\",\n      name: \"2\"\n    },\n    {\n      color: \"#333333\",\n      name: \"3\"\n    }\n  ]\n};\n```\n\n### labels\n\nList of labels. [label fields](https://github.com/itgalaxy/labelify#optionslabels).\n\n### config\n\nList of config options. [list config options](https://github.com/itgalaxy/labelify#optionsconfig).\n\n### extends\n\nYour configuration can extend an existing configuration (whether your own or a third-party config).\nWhen one configuration extends another, it starts with the other's properties then adds to and overrides what's there.\n\nExample:\n\n```js\nmodule.exports = {\n  extends: \"labelify-config-standard\",\n  labels: [\n    {\n      color: \"#ffffff\",\n      name: \"extended-label\"\n    }\n  ]\n};\n```\n\n## API\n\n```js\nconst labelify = require(\"labelify\");\n\nconst options = {\n  // Looks on config options below\n  config: {},\n  // Looks on label fields below\n  labels: [\n    { color: \"#aaa\", name: \"a\" },\n    { color: \"#bbb\", name: \"b\" },\n    { color: \"#ccc\", name: \"c\" }\n  ]\n};\n\nlabelify(options)\n  .then(result =\u003e console.log(result))\n  .catch(error =\u003e console.log(error.stack));\n```\n\n---\n\n### options.labels\n\nType: `Array`\n\nDefault: `[]`\n\nArray of labels.\n\n### List of label fields\n\n#### name\n\n**Required**\n\nType: `String`\n\nName of label.\n\n#### color\n\n**Required**\n\nType: `String`\n\nColor of label. Support short (`#fff`) and long (`#ffffff`) hex notation.\n\n#### description\n\n**Optional**\n\nType: `String`\n\nDescription of label.\n\nIf you want remove priority for label use `null` value.\n\n#### priority\n\n**Optional**\n\nType: `Number`\n\nPriority of label. Must be equal 0 or greater.\n\nIf you want remove priority for label use `null` value.\n\n**Note:** works only for Gitlab platform.\n\n---\n\n### options.config\n\nType: `Object`\n\nDefault: `{}`\n\n**Notes:**\n\n- **`labelify` automatically resolve `platform` and `endpoint` options based on information in `package.json`.**\n- **Use `platform` option only when you have self hosted solution.**\n- **Use `endpoint` option only when you have nonstandard API URL fro your platform.**\n\n#### overlap\n\nType: `Boolean`\n\nDefault: `false`\n\nRemoves all labels which are not in options/configuration from the repository.\n\n#### platform\n\nType: `string`\n\nType of platform where your store repository.\n\nAvailable configuration:\n\n- github\n- gitlab\n\n#### endpoint\n\nType: `string`\n\nEndpoint for your API.\nExample for github it is `https://api.github.com/repos/itgalaxy/labelify/labels`.\n\n#### api\n\nAllow to pass own API. Should contain 4 method.\nYou can look on example API [here](./src/lib/api/github.js).\n\n#### token\n\nType: `string`\n\nDefault: `process.env.TOKEN || process.env.GITHUB_TOKEN || process.env.GITLAB_TOKEN`\n\nAccess token for your repository.\n\n**Note: store `token` in code or configuration file is insecurity**.\n\nHow to create token:\n\n- [github](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/)\n- [gitlab](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html)\n\n## CLI\n\n```none\n  Automate and simplify the creation of labels for your repository.\n\n  Usage: labelify [options]\n\n  Options:\n    --config\n      Path to a specific configuration file (JSON, YAML, or CommonJS), or the\n      name of a module in node_modules that points to one. If no --config\n      argument is provided, \"labelify\" will search for configuration files in\n      the following places, in this order:\n        - a labelify property in package.json\n        - a .labelify file (with or without filename extension:\n          .json, .yaml, .yml, and .js are available)\n        - a labelify.config.js file exporting a JS object\n      The search will begin in the working directory and move up the directory\n      tree until a configuration file is found.\n\n    --config-basedir\n      An absolute path to the directory that relative paths defining \"extends\"\n      are *relative to*. Only necessary if these values are relative paths.\n\n    --overlap, -o\n      Removes all labels which are not in configuration from the repository.\n\n    --platform, -p\n      Type of platform where your store repository.\n      Use platform option only when you have self hosted solution.\n\n    --endpoint, -e\n      Endpoint for your API.\n      Use endpoint option only when you have nonstandard API URL fro your platform.\n\n    --version, -v\n      Show the currently installed version of labelify.\n```\n\nExample usage:\n\n```shell\nTOKEN=YOUR_SECRET_TOKEN labelify\n```\n\n## Todo\n\nPR welcome\n\n- **medium** More tests.\n- **low** Respect `x-ratelimit-remaining` and `x-ratelimit-reset` from `github`.\n- **low** Support `bitbucket`.\n- **low** Basic presets.\n- **low** Integrate `ora` for better logging.\n\n## Thanks\n\n- [git-label](https://github.com/jasonbellamy/git-label) - inspiration and ideas.\n- [got](https://github.com/sindresorhus/got) - for great library without `several megabytes`.\n- the logo designed by [@reallinfo](https://github.com/reallinfo)\n\n## Contribution\n\nFeel free to push your code if you agree with publishing under the MIT license.\n\n## [Changelog](CHANGELOG.md)\n\n## [License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitgalaxy%2Flabelify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitgalaxy%2Flabelify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitgalaxy%2Flabelify/lists"}