https://github.com/richardlitt/gh-topics
Set and get a GitHub repository's topics
https://github.com/richardlitt/gh-topics
cli gh github repos topic topics
Last synced: about 2 months ago
JSON representation
Set and get a GitHub repository's topics
- Host: GitHub
- URL: https://github.com/richardlitt/gh-topics
- Owner: RichardLitt
- License: mit
- Created: 2017-04-27T14:08:11.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-10-14T17:34:44.000Z (over 8 years ago)
- Last Synced: 2025-03-05T07:55:31.230Z (over 1 year ago)
- Topics: cli, gh, github, repos, topic, topics
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# gh-topics
[](https://travis-ci.org/RichardLitt/gh-topics)
[](https://github.com/RichardLitt/standard-readme)
> Set and get a GitHub repository topics
**NOTE:** GitHub's API does not yet adequately return the `topics` tag. As such, this code will not work, at all. See the note [here](https://developer.github.com/v3/repos/).
**If you think this is not true, ping me immediately by opening an issue. I will make this work.**
## Install
```
npm install --save gh-topics
```
or
```
npm install --global gh-topics
```
## Usage
```js
const ghTopics = require('gh-topics');
ghTopics('RichardLitt/gh-topics');
//=> 'Set and get a GitHub repository topics'
ghTopics('RichardLitt/gh-topics', 'unicorns & rainbows');
//=> 'unicorns & rainbows'
```
## API
### ghTopics(repoName, topics, [options], token)
#### repoName
Type: `string`
The name for the repository to test.
#### topics
Type: `string`
The new topics to set. To set, you must also supply the repoName first.
#### options
None.
#### token
Your GitHub access token, if not set as an env variable or supplied in the CLI.
## CLI
The `gh-topics` command uses [ghauth](https://github.com/rvagg/ghauth) to generate and [locally store](https://github.com/LinusU/node-application-config#config-location) a GitHub API personal token.
You can skip this step by [manually generating a token](https://help.github.com/articles/creating-an-access-token-for-command-line-use/) and setting it as an environment variabled named `GH_DESCRIPTION_TOKEN`.
```
$ gh-topics --help
Usage
$ gh-topics
Examples
$ gh-topics
Current topics: Set and get a GitHub repository topics
$ gh-topics RichardLitt/gh-topics 'ponies and unicorns'
New topics: ponies and unicorns
```
## Contribute
PRs and [issues](https://github.com/RichardLitt/gh-topics/issues) gladly accepted!
## License
MIT © [Richard Littauer](http://burntfen.com)