{"id":18910059,"url":"https://github.com/cheton/github-release-cli","last_synced_at":"2025-05-08T21:25:20.756Z","repository":{"id":39649642,"uuid":"80796787","full_name":"cheton/github-release-cli","owner":"cheton","description":"A command-line tool for managing release assets on a GitHub repository.","archived":false,"fork":false,"pushed_at":"2021-11-06T13:22:33.000Z","size":41,"stargazers_count":72,"open_issues_count":5,"forks_count":17,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-28T10:24:17.799Z","etag":null,"topics":["cli","command-line","github","releases"],"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/cheton.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":null,"patreon":null,"open_collective":"cheton","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2017-02-03T04:24:35.000Z","updated_at":"2023-12-10T06:45:36.000Z","dependencies_parsed_at":"2022-09-20T06:50:15.921Z","dependency_job_id":null,"html_url":"https://github.com/cheton/github-release-cli","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheton%2Fgithub-release-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheton%2Fgithub-release-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheton%2Fgithub-release-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheton%2Fgithub-release-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cheton","download_url":"https://codeload.github.com/cheton/github-release-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252820025,"owners_count":21809140,"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":["cli","command-line","github","releases"],"created_at":"2024-11-08T09:39:17.328Z","updated_at":"2025-05-08T21:25:20.731Z","avatar_url":"https://github.com/cheton.png","language":"JavaScript","readme":"# github-release-cli [![build status](https://travis-ci.org/cheton/github-release-cli.svg?branch=master)](https://travis-ci.org/cheton/github-release-cli)\n\n[![NPM](https://nodei.co/npm/github-release-cli.png?downloads=true\u0026stars=true)](https://www.npmjs.com/package/github-release-cli)\n\nA command-line tool for managing release assets on a GitHub repository.\n\n## Installation\n\n```\nnpm install -g github-release-cli\n```\n\n## Command Line Usage\n\nRun `github-release` with `-h` or `--help` options:\n\n```\nUsage: github-release \u003ccommand\u003e [\u003cargs\u003e]\n\nOptions:\n  -V, --version          output the version number\n  --baseurl \u003cbaseurl\u003e    API endpoint (default: \"https://api.github.com\")\n  --token \u003ctoken\u003e        OAuth2 token (default: null)\n  --owner \u003cowner\u003e        The repository owner. (default: \"\")\n  --repo \u003crepo\u003e          The repository name. (default: \"\")\n  --tag \u003ctag\u003e            The name of the tag.\n  --commitish \u003cvalue\u003e    Specifies the commitish value for tag. Unused if the tag already exists.\n  --release-id \u003cid\u003e      The release id.\n  --release-name \u003cname\u003e  The name of the release. (default: \"\")\n  --body \u003cbody\u003e          Text describing the contents of the tag.\n  --draft [value]        `true` makes the release a draft, and `false` publishes the release.\n  --prerelease [value]   `true` to identify the release as a prerelease, `false` to identify the release as a full release.\n  -h, --help             display help for command\n```\n\n## Commands\n\n### List\n\n```sh\ngithub-release list\n  --owner cheton \\\n  --repo github-release-cli\n```\n\n### Upload\n\n```sh\ngithub-release upload \\\n  --owner cheton \\\n  --repo github-release-cli \\\n  --tag \"v0.1.0\" \\\n  --release-name \"v0.1.0\" \\\n  --body \"This release contains bug fixes and imporvements, including:\\n...\" \\\n  archive.zip index.html app.min.css app.min.js\n```\n\n#### Specify the commitish value for tag\n\n```sh\ngithub-release upload \\\n    --owner cheton \\\n    --repo github-release-cli \\\n    --commitish 6a8e375 \\\n    --tag \"v0.1.0\" \\\n    --release-name \"v0.1.0\" \\\n    --body \"The commitish value for tag\"\n```\n\n#### Create a prerelease\n\n```sh\ngithub-release upload \\\n  --owner cheton \\\n  --repo github-release-cli \\\n  --tag \"v0.1.0\" \\\n  --release-name \"v0.1.0\" \\\n  --body \"This is a prerelease\" \\\n  --prerelease\n```\n\n#### Change a prerelease to a published release\n\n```sh\ngithub-release upload \\\n  --owner cheton \\\n  --repo github-release-cli \\\n  --tag \"v0.1.0\" \\\n  --release-name \"v0.1.0\" \\\n  --body \"This is a published release\" \\\n  --prerelease=false\n```\n\n### Delete\n\n#### Delete release assets\n\nYou can use glob expressions to match files:\n```sh\ngithub-release delete \\\n  --owner cheton \\\n  --repo github-release-cli \\\n  --tag \"v0.1.0\" \\\n  archive.zip index.html \"app.*\"\n```\n\n#### Delete a release by specifying the tag name\n\n```sh\ngithub-release delete \\\n  --owner cheton \\\n  --repo github-release-cli \\\n  --tag \"v0.1.0\"\n```\n\n#### Delete a release by specifying the release id\n\n```sh\ngithub-release delete \\\n  --owner cheton \\\n  --repo github-release-cli \\\n  --release-id 17994985\n```\n\n## Examples\n\nhttps://github.com/cncjs/cncjs-pendant-tinyweb/blob/master/.travis.yml\n\n## Secure Setup\n\n### 1. Get an OAuth token from GitHub\n\nFirst you will need to get an OAuth Token from GitHub using your own username and \"note\":\n\n```sh\ncurl \\\n  -u 'username' \\\n  -d '{\"scopes\":[\"repo\"], \"note\":\"Publish to GitHub Releases\"}' \\\n  https://api.github.com/authorizations\n```\n\nFor users with two-factor authentication enabled, you must send the user's authentication code (i.e., one-time password) in the `X-GitHub-OTP` header:\n\n```sh\ncurl \\\n  -u 'username' \\\n  -H 'X-GitHub-OTP: 000000' \\\n  -d '{\"scopes\":[\"repo\"], \"note\":\"Publish to GitHub Releases\"}' \\\n  https://api.github.com/authorizations\n```\n\n### 2. Storing the OAuth token in an environment variable\n\nFor reducing security risks, you can store your OAuth token in an environment variable.\n\nExport the token using the one you got from above:\n\n```sh\nexport GITHUB_TOKEN=your_token\n```\n\n### 3. Set up a CI build\n\nNow you're ready to upload assets to a GitHub repository from a CI server. For example:\n\n```sh\nCOMMIT_LOG=`git log -1 --format='%ci %H %s'`\ngithub-release upload \\\n  --owner=cheton \\\n  --repo=github-release-cli \\\n  --tag=\"latest\" \\\n  --release-name=\"${TRAVIS_BRANCH}\" \\\n  --body=\"${COMMIT_LOG}\" \\\n  \"releases/myapp-0.1.0-win-x32.exe\" \\\n  \"releases/myapp-0.1.0-win-x64.exe\"\n```\n\nIf you're using Travis CI, you may want to encrypt environment variables:\n\n```sh\ntravis encrypt GITHUB_TOKEN=your_token\n```\n\nLearn how to define encrypted variables in .travis.yml:\u003cbr\u003e\nhttps://docs.travis-ci.com/user/environment-variables/#Defining-encrypted-variables-in-.travis.yml\n\n## License\n\nMIT\n","funding_links":["https://opencollective.com/cheton"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheton%2Fgithub-release-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcheton%2Fgithub-release-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheton%2Fgithub-release-cli/lists"}