npm.io
0.5.0 • Published 2 years agoCLI

@xarunoba/clai

Licence
MIT
Version
0.5.0
Deps
1
Size
11 kB
Vulns
0
Weekly
0

@xarunoba/clai

Static Badge NPM License GitHub package.json version

clai — check lockfiles and install

Run package installation after checking for lockfile updates. Integrate with git hooks. Supports npm, pnpm, and yarn. Uses git and any of the supported package managers under the hood.

Why

Using a bot to update dependencies is becoming widespread. Installing after pulling from your remote repository is now needed in order to synchronize your local modules. clai fixes this issue by checking for lockfile updates and running install.

Installation

npm
npm install -D @xarunoba/clai
# run locally
npx clai
pnpm
pnpm install -D @xarunoba/clai
# run locally
pnpm clai
yarn
yarn add --dev @xarunoba/clai
# run locally
yarn run clai

Usage

npm
npx @xarunoba/clai
pnpm
pnpm dlx @xarunoba/clai
yarn
yarn dlx @xarunoba/clai
flags

You can add the following flags for clai:

  • -v, --version — Show version number
  • -h, --help — Show help
  • -c, --cleaninstall — use ci (npm) or --frozen-lockfile (pnpm, yarn) when installing
  • -s, --strict — Will immediately exit if any issues are found
  • -q, --quiet — Will not log anything to the console

Integrations

With simple-git-hooks

Integrating with simple-git-hooks is easy as a toasted bread:

// package.json
{
  ...
  "simple-git-hooks": {
    // I prefer always using the latest version of clai
    // instead of installing it as a dev dependency.
    // If you have installed it locally, you can use:
    // "post-merge": "npx clai"
    "post-merge": "npx @xarunoba/clai"
  }
  ...
}

Keywords