# semantic-release-cli

> setup automated semver compliant package publishing

Latest version **5.4.6** (published 2023-12-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install semantic-release-cli
pnpm add semantic-release-cli
yarn add semantic-release-cli
bun add semantic-release-cli
```

Provides the command `semantic-release-cli`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.4.6 |
| Published | 2023-12-08 |
| First published | 2015-07-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=7.6 |
| Dependencies | 24 |
| Unpacked size | 32.5 KB |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 371 |
| Author | Christoph Witzko |
| Maintainers | travi, pvdlg, semantic-release-bot, gr2m |
| Keywords | automation, changelog, publish, release, semver, version |

## Links

- npm: https://www.npmjs.com/package/semantic-release-cli
- Repository: https://github.com/semantic-release/cli
- Homepage: https://github.com/semantic-release/cli#readme
- Issues: https://github.com/semantic-release/cli/issues
- npm.io page: https://npm.io/package/semantic-release-cli

## Dependencies (24)

- [ini](https://npm.io/package/ini.md) ^1.3.4
- [npm](https://npm.io/package/npm.md) ^6.0.0
- [nopt](https://npm.io/package/nopt.md) ^4.0.0
- [pify](https://npm.io/package/pify.md) ^4.0.0
- [base32](https://npm.io/package/base32.md) 0.0.6
- [lodash](https://npm.io/package/lodash.md) ^4.16.4
- [npmlog](https://npm.io/package/npmlog.md) ^4.0.0
- [js-yaml](https://npm.io/package/js-yaml.md) ^3.3.1
- [p-retry](https://npm.io/package/p-retry.md) ^4.0.0
- [request](https://npm.io/package/request.md) ^2.85.0
- [inquirer](https://npm.io/package/inquirer.md) ^7.0.0
- [travis-ci](https://npm.io/package/travis-ci.md) ^2.1.1
- [user-home](https://npm.io/package/user-home.md) ^2.0.0
- [validator](https://npm.io/package/validator.md) ^13.7.0
- [clipboardy](https://npm.io/package/clipboardy.md) ^2.0.0
- [npm-profile](https://npm.io/package/npm-profile.md) ^4.0.1
- [tweetsodium](https://npm.io/package/tweetsodium.md) ^0.0.5
- [request-debug](https://npm.io/package/request-debug.md) ^0.2.0
- [git-config-path](https://npm.io/package/git-config-path.md) ^2.0.0
- [request-promise](https://npm.io/package/request-promise.md) ^4.1.1
- [update-notifier](https://npm.io/package/update-notifier.md) ^3.0.0
- [parse-git-config](https://npm.io/package/parse-git-config.md) ^3.0.0
- [github-url-from-git](https://npm.io/package/github-url-from-git.md) ^1.4.0
- [parse-github-repo-url](https://npm.io/package/parse-github-repo-url.md) ^1.0.0

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 5.4.6 (latest) — 2023-12-08
- 5.4.5 — 2023-12-08
- 5.4.4 — 2021-09-10
- 5.4.3 — 2021-01-20
- 5.4.2 — 2021-01-17
- 5.4.1 — 2021-01-03
- 5.4.0 — 2020-07-26
- 5.3.1 — 2020-05-19
- 5.3.0 — 2020-05-08
- 5.2.3 — 2019-11-03
- 5.2.2 — 2019-10-28
- 5.2.1 — 2019-09-02
- 5.2.0 — 2019-08-26
- 5.1.3 — 2019-08-23
- 5.1.2 — 2019-08-06
- … 65 more at https://npm.io/package/semantic-release-cli/versions

## README

# semantic-release-cli

[![Build Status](https://github.com/semantic-release/cli/workflows/Test/badge.svg)](https://github.com/semantic-release/cli/actions?query=workflow%3ATest+)

## Install

```bash
npm install -g semantic-release-cli

cd your-module
semantic-release-cli setup
```

![dialogue](https://cloud.githubusercontent.com/assets/908178/8766357/f3eadaca-2e34-11e5-8ebb-d40b9ae613d7.png)

## Options

	Usage:
	  semantic-release-cli setup [options]

	Options:
	  -h --help           Show this screen.
	  -v --version        Show version.
	  --[no-]keychain     Use keychain to get passwords [default: true].
	  --ask-for-passwords Ask for the passwords even if passwords are stored [default: false].
	  --tag=<String>      npm tag to install [default: 'latest'].
    --gh-token=<String>  GitHub auth token
    --npm-token=<String> npm auth token
    --circle-token=<String> CircleCI auth token
    --npm-username=<String>  npm username

	Aliases:
	  init                 setup

## What it Does
__semantic-release-cli performs the following steps:__

1. Asks for the information it needs. You will need to provide it with:
	* Whether your GitHub repository is public or private
	* Which npm registry you want to use (Default: https://registry.npmjs.org/)
	* Your npm username (unless passwords were previously saved to keychain)
	* Your npm email
	* Your npm password
	* Which continuous integration system you want to use. (Options: Travis CI / Pro / Enterprise / CircleCI, or Other)
	* [Travis only] Whether you want to test a single node.js version (e.g. - 8) or multiple node.js versions (e.g. - 4, 6, 8, etc.)
1. npm Add User
	* Runs `npm adduser` with the npm information provided to generate a `.npmrc`
	* Parses the npm token from the `.npmrc` for future use
1. Uses user supplied GitHub Personal Access Token (with the following permissions: `repo`, `read:org`, `repo:status`, `repo_deployment`, `user:email`, `write:repo_hook`)
	* Sets GitHub Personal Access Token in user choosen CI/CD environment variable
1. Update your `package.json`
	* Set `version` field to `0.0.0-development` (`semantic-release` will set the version for you automatically)
	* Add a `semantic-release` script: `"semantic-release": "semantic-release"`
	* Add `semantic-release` as a `devDependency`
	* Add or overwrite the [`repository` field](https://docs.npmjs.com/files/package.json#repository)

## Travis CI

### Versions 4.1.0+
`semantic-release-cli` does not perform any additional Travis-specific steps, but the cli output will provide a [link](https://github.com/semantic-release/semantic-release/blob/master/docs/03-recipes/travis.md) for assistance integrating Travis and `semantic-release-cli`.

### Prior to version 4.1.0
`semantic-release-cli` performs the following additional steps:
1. Overwrite your `.travis.yml` file
	* `after_success`: `npm install -g travis-deploy-once` and `travis-deploy-once "npm run semantic-release"`: run `semantic-release` exactly once after all builds pass
	* Set other sane defaults: `cache: directories: ~/.npm`, `notifications: email: false`
1. Login to Travis CI to configure the package. This step requires your module to define a valid, case-sensitive
[`repository` field](https://docs.npmjs.com/files/package.json#repository).
	* Enable builds of your repo
	* Add `GH_TOKEN` and `NPM_TOKEN` environment variables in the settings

## CircleCI

For CircleCI, `semantic-release-cli` performs the following additional steps:
1. Create minimal `config.yml` file (if CircleCI was selected)
```yml
version: 2
jobs:
  build:
    docker:
      - image: 'circleci/node:latest'
    steps:
      - checkout
      - run:
        name: install
        command: npm install
      - run:
        name: release
        command: npm run semantic-release || true
```
2. Login to CircleCI to configure the package
	* Enable builds of your repo
	* Add `GH_TOKEN` and `NPM_TOKEN` environment variables in the settings


## Github Actions

For Github Actions, `semantic-release-cli` performs the following additional step:
* Login to Github to configure the package
* Add `NPM_TOKEN` environment variables as a secret in the settings

For now you will have to manually modify your existing workflow to add a release step. Here is an example of a small complete workflow `.github/workflows/workflow.yml`:
```yaml
name: CI
on: push
jobs:
  test:
    runs-on: ubuntu-16.04
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v1
        with:
          node-version: '12'
      - run: npm ci
      - run: npm test
      - name: Release
        env:
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
        run: npx semantic-release
```

## Other CI Servers

By default, `semantic-release-cli` supports the popular Travis CI and CircleCI servers. If you select `Other` as your server during configuration, `semantic-release-cli` will print out the environment variables you need to set on your CI server. You will be responsible for adding these environment variables as well as configuring your CI server to run `npm run semantic-release` after all the builds pass.

Note that your CI server will also need to set the environment variable `CI=true` so that `semantic-release` will not perform a dry run. (Most CI services do this by default.) See the `semantic-release` documentation for more details.

## Setting defaults

This package reads your npm username from your global `.npmrc`. In order to autosuggest a username in the future, make sure to set your username there: `npm config set username <username>`.

## Contribute

Please contribute! We welcome issues and pull requests.

When committing, please conform to [the semantic-release commit standards](https://github.com/semantic-release/semantic-release#default-commit-message-format).

## License

MIT License
2015 © Christoph Witzko and [contributors](https://github.com/semantic-release/cli/graphs/contributors)

![https://twitter.com/trodrigues/status/509301317467373571](https://cloud.githubusercontent.com/assets/908178/6091690/cc86f58c-aeb8-11e4-94cb-15f15f486cde.png)

---
_Source: https://npm.io/package/semantic-release-cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
