# @clerc/utils

> Clerc utils

Latest version **1.3.1** (published 2026-02-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install @clerc/utils
pnpm add @clerc/utils
yarn add @clerc/utils
bun add @clerc/utils
```

## Health

**Score 65/100 (B)** — status: stable.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.3.1 |
| Published | 2026-02-22 |
| First published | 2022-11-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 0 |
| Unpacked size | 6.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 228 |
| Author | Ray |
| Maintainers | so1ve |
| Keywords | args, arguments, argv, clerc, clerc-utils, cli, terminal, utils |

## Links

- npm: https://www.npmjs.com/package/@clerc/utils
- Repository: https://github.com/clercjs/clerc
- Homepage: https://github.com/clercjs/clerc/tree/main/packages/utils#readme
- Issues: https://github.com/clercjs/clerc/issues
- npm.io page: https://npm.io/package/@clerc/utils

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.3.1 (latest) — 2026-02-22
- 1.3.0 — 2026-02-22
- 1.3.0-beta.2 — 2026-02-20
- 1.3.0-beta.1 — 2026-01-18
- 1.2.1 — 2026-01-07
- 1.2.0 — 2026-01-07
- 1.1.1 — 2025-12-28
- 1.1.0 — 2025-12-28
- 1.0.3 — 2025-12-19
- 1.0.2 — 2025-12-19
- 1.0.1 — 2025-12-19
- 1.0.0 — 2025-12-19
- 1.0.0-beta.30 — 2025-12-18
- 1.0.0-beta.29 — 2025-12-17
- 1.0.0-beta.28 — 2025-12-16
- … 103 more at https://npm.io/package/@clerc/utils/versions

## README

![Clerc Card](.github/assets/ClercCard.png)

<p align="center">
	<a target="_blank" href="https://clerc.so1ve.dev" noreferrer noopener>Clerc</a> is a full-featured library (tool set) for building CLI Apps in Node.js, Deno or Bun.
</p>

<div align="center">

[![Version](https://img.shields.io/npm/v/clerc.svg)](https://npmjs.org/package/clerc)
[![CI](https://github.com/clercjs/clerc/actions/workflows/conventional-ci.yml/badge.svg)](https://github.com/clercjs/clerc/actions/workflows/conventional-ci.yml)
[![Downloads/week](https://img.shields.io/npm/dw/clerc.svg)](https://npmjs.org/package/clerc)
[![License](https://img.shields.io/npm/l/clerc.svg)](https://github.com/clercjs/clerc/blob/main/package.json)

</div>

<hr/>

<!-- toc -->

- [✨ Features](#-features)
- [😊 The simplest CLI example](#-the-simplest-cli-example)
- [📖 Documentation](#-documentation)
- [🦄 Examples](#-examples)
- [🤔 More...](#-more)

<!-- tocstop -->

> [!NOTE]  
> This package is ESM-only.

# ✨ Features

- **Lightweight** - Dependencies are bundled.
- **Plugin system** - Add rich features on demand.
- **Chainable APIs** - Composable.
- **Developer friendly** - Strongly typed, converts flags and parameters to camelCase.
- **Parses parameters** - No need to read them by yourself.

# 😊 The simplest CLI example

Install clerc, and create a file named `cli.mjs`:

```ts
import { Cli } from "clerc";

Cli() // Create a new Clerc instance with help and version plugins installed
  .scriptName("foo") // CLI Script Name
  .description("A foo CLI") // CLI Description
  .version("0.0.0") // CLI Version
  .command(
    "bar", // Command name
    "A bar command", // Command description
  )
  .on(
    "bar",
    (
      _ctx, // The command context, but we haven't used it yet
    ) => {
      console.log("Hello, world from Clerc!");
    },
  )
  .parse(); // Parse the arguments and run!
```

Then run: `node cli.mjs bar`. It should log in your shell: `Hello, world from Clerc!`

# 📖 Documentation

Please see https://clerc.so1ve.dev.

# 🦄 Examples

Check the examples made with `Clerc`:

- [Greeting](./examples/greeting) - The example from above
- [Bumpp](./examples/bumpp) - Reimplementation of [`Bumpp`](https://github.com/antfu/bumpp)'s CLI

# 🤔 More...

## Why using Clerc?

Clerc uses [`@clerc/parser`](https://github.com/clercjs/clerc/blob/main/packages/parser) to parse arguments. It is strongly-typed, which brings you better DX. It is powerful(supports custom type) and quite small and performant!

Clerc has a plugin system, which means you can add features on demand (e.g. auto completions, help text generation...). It also provides chainable APIs for better composability.

Clerc's flexible architecture and plugin system offer vast potential for further exploration and customization in diverse CLI application scenarios. There are more and more opportunities to leverage Clerc's capabilities to create unique and powerful command-line tools!

## 📝 License

[MIT](./LICENSE). Made with ❤️ by [Ray](https://github.com/so1ve)

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