# @cmflow/cli

> An awesome Git Flow

Latest version **3.21.0** (published 2026-11-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install @cmflow/cli
pnpm add @cmflow/cli
yarn add @cmflow/cli
bun add @cmflow/cli
```

Provides the commands `cm`, `cmrelease`.

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.21.0 |
| Published | 2026-11-05 |
| First published | 2022-03-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 5.8 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | camfou |
| Maintainers | romakita, camfou |

## Links

- npm: https://www.npmjs.com/package/@cmflow/cli
- npm.io page: https://npm.io/package/@cmflow/cli

## Dependencies (3)

- [tsx](https://npm.io/package/tsx.md) ^4.19.0
- [@clack/prompts](https://npm.io/package/@clack/prompts.md) ^1.7.0
- [semantic-release](https://npm.io/package/semantic-release.md) >=25.0.9

## Recent versions

- 3.21.0 (latest) — 2026-11-05
- 3.4.0-beta.36 (beta) — 2026-08-27
- 3.4.0-alpha.5 (alpha) — 2026-08-21
- 2.0.0-rc.3 (rc) — 2025-05-19
- 3.20.0 — 2026-11-02
- 3.19.0 — 2026-11-02
- 3.18.0 — 2026-10-30
- 3.17.2 — 2026-10-29
- 3.17.1 — 2026-10-27
- 3.17.0 — 2026-10-27
- 3.16.0 — 2026-10-27
- 3.15.0 — 2026-10-03
- 3.14.1 — 2026-10-02
- 3.14.0 — 2026-09-25
- 3.13.2 — 2026-09-25
- … 157 more at https://npm.io/package/@cmflow/cli/versions

## README

<div align="center">
  <img src="https://ns.clubmed.com/fbs/RWD/branding2023/Logo/MicrosoftTeams-image%20(9).png" width="200" alt="Club Med" />
  <h1>@cmflow/cli</h1>
   <hr />

[![npm version](https://badge.fury.io/js/%40cmflow%2Fcli.svg)](https://badge.fury.io/js/%40cmflow%2Fcli)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![code style: oxfmt](https://img.shields.io/badge/code_style-oxfmt-ef4444.svg?style=flat-square)](https://oxc.rs/docs/guide/usage/formatter)
</div>

Club Med Flow command-line tooling for Git Flow, Semantic Release and publishing Yarn workspace packages.

## Installation

Install globally for the Git Flow commands:

```bash
npm install --global @cmflow/cli
cm --help
```

Install it as a development dependency when a project uses its release plugins or package-artifact commands:

```bash
npm install --save-dev @cmflow/cli
```

## Git Flow commands

`cm` provides commands for starting, finishing, pushing, pulling, merging, rebasing and deploying branches, plus release and Jira helpers.

```bash
cm --help
cm start --help
cm finish --help
cm deploy --help
```

### Jira releases

`jira-releases` lists release versions for a Jira project and component, generates delivery notes, and can mark versions as released.

```bash
cm jira-releases --project-id <PROJECT_KEY> --component <COMPONENT> --tag <VERSION> [--update] [--verbose]
```

It requires `JIRA_API`, `JIRA_EMAIL` and `JIRA_TOKEN`. Directus workflow support is optional and uses `DIRECTUS_URL`, `DIRECTUS_FLOW_ID` and `DIRECTUS_ACCESS_TOKEN`. Run without `--update` first to review the selected versions.

## Monorepo package artifacts

`cm packages build` creates the npm-ready artifacts of a Yarn-workspace monorepo. It performs the following steps:

1. Cleans the configured output directory.
2. Runs the configured build script.
3. Copies non-private workspace packages into `dist/<package-name>`.
4. Writes package manifests with the release version and rewritten internal dependencies.

```bash
cm packages build
cm packages build --version 3.4.0-alpha.3
```

The default output is `dist`. Private workspaces are never included in the artifacts or published. If `--version` is omitted, the current root `package.json` version is retained.

`cm packages build` is invoked by the Semantic Release `prepare` step for the `cmflow` bump method. Do not add it to the release command: Semantic Release owns the artifact lifecycle.

Use a dedicated script only to verify artifact generation locally or in a pre-release CI check:

```json
{
  "scripts": {
    "artifacts:prepare": "yarn build && cm packages build"
  }
}
```

## `flow` configuration

Configure package build and publication defaults in the root `package.json`:

```json
{
  "workspaces": ["packages/*"],
  "publishConfig": {
    "registry": "https://registry.npmjs.org/"
  },
  "flow": {
    "outputDir": "dist",
    "buildCmd": "build",
    "npmAccess": "public",
    "npmDistTag": "next",
    "npmFallbackDistTag": "latest",
    "registries": [],
    "skipNpmPublish": false,
    "trustedPublishing": true
  }
}
```

| Option               | Default             | Purpose                                                                |
| -------------------- | ------------------- | ---------------------------------------------------------------------- |
| `outputDir`          | `dist`              | Destination directory for generated package artifacts.                 |
| `buildCmd`           | `build`             | Root package script run by `cm packages build`.                        |
| `npmAccess`          | `public`            | npm access passed to `npm publish`.                                    |
| `npmDistTag`         | `publishConfig.tag` | Dist-tag written in generated package manifests.                       |
| `npmFallbackDistTag` | `latest`            | Tag used when npm rejects an implicit `latest` tag.                    |
| `registries`         | `[]`                | Additional registries to publish to.                                   |
| `skipNpmPublish`     | `false`             | Builds release artifacts but skips npm publication.                    |
| `trustedPublishing`  | `false`             | Enables npm trusted publishing; no npmjs token is written to `.npmrc`. |

A workspace package may set its own `flow.registries` array to replace the root registries for that package.

## Semantic Release

Use `cmrelease` to run Semantic Release:

```json
{
  "scripts": {
    "release": "cmrelease",
    "release:dry_run": "cmrelease --dry-run"
  }
}
```

For a workspace release, the publish sequence must push the release branch and tag before npm publication:

```js
import { defineConfig } from "@cmflow/cli";

export default defineConfig({
  prepare: ["@cmflow/cli/semantic/core/prepare/bump-version", "@cmflow/cli/semantic/core/prepare/commit"],
  publish: [
    "@cmflow/cli/semantic/core/push-release",
    "@cmflow/cli/semantic/core/publish-packages",
    "@cmflow/cli/semantic/core/sync-repository"
  ],
  npmPublish: false
});
```

`push-release` pushes the branch and release tag first. `publish-packages` publishes only non-private generated artifacts. It supports npmjs, GitHub Packages and additional registries; `trustedPublishing` uses npm’s OIDC-based trusted publishing flow. During a dry run, packages are packed but never published.

For CircleCI, export the OIDC token in each job that runs a real release:

```yaml
- run:
    name: Cm Release
    command: |
      export NPM_ID_TOKEN=$(circleci run oidc get --claims '{"aud":"npm:registry.npmjs.org"}')
      yarn release
```

Each npm package must also be configured with a CircleCI trusted publisher and allow the `npm publish` action. The Organization ID, Project ID, Pipeline definition ID and VCS origin configured on npm must match the CircleCI project exactly. [npm’s CircleCI trusted publishing guide](https://docs.npmjs.com/trusted-publishers/) details the required values.

## Atlas

API-to-backend catalogue tooling is published separately as [`@cmflow/atlas`](../atlas). Its project configuration is `atlas.config.ts`; it does not belong in this repository or in this CLI package.

## Development

From the monorepo root:

```bash
yarn workspace @cmflow/cli build
yarn workspace @cmflow/cli test
yarn check
```

## License

The MIT License (MIT)
Copyright (c) 2016 - Today ClubMed

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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