easily create complex multi-column command-line-interfaces.
Installations
npm install @isaacs/cliui
Developer Guide
Typescript
No
Module System
ESM
Min. Node Version
>=12
Node Version
18.16.0
NPM Version
9.6.5
Score
98.6
Supply Chain
99.1
Quality
75
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (55.42%)
TypeScript (44.58%)
validate.email 🚀
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Developer
yargs
Download Statistics
Total Downloads
1,632,993,147
Last Day
6,027,797
Last Week
32,996,896
Last Month
135,474,963
Last Year
1,204,668,553
GitHub Statistics
ISC License
373 Stars
134 Commits
43 Forks
10 Watchers
10 Branches
20 Contributors
Updated on Mar 17, 2025
Bundle Size
27.86 kB
Minified
7.79 kB
Minified + Gzipped
Package Meta Information
Latest Version
8.0.2
Package Id
@isaacs/cliui@8.0.2
Unpacked Size
27.15 kB
Size
5.95 kB
File Count
7
NPM Version
9.6.5
Node Version
18.16.0
Published on
May 02, 2023
Total Downloads
Cumulative downloads
Total Downloads
1,632,993,147
Last Day
1.3%
6,027,797
Compared to previous day
Last Week
3.2%
32,996,896
Compared to previous week
Last Month
9.1%
135,474,963
Compared to previous month
Last Year
181.3%
1,204,668,553
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
@isaacs/cliui
Temporary fork of cliui.
easily create complex multi-column command-line-interfaces.
Example
1const ui = require('cliui')() 2 3ui.div('Usage: $0 [command] [options]') 4 5ui.div({ 6 text: 'Options:', 7 padding: [2, 0, 1, 0] 8}) 9 10ui.div( 11 { 12 text: "-f, --file", 13 width: 20, 14 padding: [0, 4, 0, 4] 15 }, 16 { 17 text: "the file to load." + 18 chalk.green("(if this description is long it wraps).") 19 , 20 width: 20 21 }, 22 { 23 text: chalk.red("[required]"), 24 align: 'right' 25 } 26) 27 28console.log(ui.toString())
Deno/ESM Support
As of v7
cliui
supports Deno and
ESM:
1import cliui from "https://deno.land/x/cliui/deno.ts"; 2 3const ui = cliui({}) 4 5ui.div('Usage: $0 [command] [options]') 6 7ui.div({ 8 text: 'Options:', 9 padding: [2, 0, 1, 0] 10}) 11 12ui.div({ 13 text: "-f, --file", 14 width: 20, 15 padding: [0, 4, 0, 4] 16}) 17 18console.log(ui.toString())

Layout DSL
cliui exposes a simple layout DSL:
If you create a single ui.div
, passing a string rather than an
object:
\n
: characters will be interpreted as new rows.\t
: characters will be interpreted as new columns.\s
: characters will be interpreted as padding.
as an example...
1var ui = require('./')({ 2 width: 60 3}) 4 5ui.div( 6 'Usage: node ./bin/foo.js\n' + 7 ' <regex>\t provide a regex\n' + 8 ' <glob>\t provide a glob\t [required]' 9) 10 11console.log(ui.toString())
will output:
1Usage: node ./bin/foo.js 2 <regex> provide a regex 3 <glob> provide a glob [required]
Methods
1cliui = require('cliui')
cliui({width: integer})
Specify the maximum width of the UI being generated.
If no width is provided, cliui will try to get the current window's width and use it, and if that doesn't work, width will be set to 80
.
cliui({wrap: boolean})
Enable or disable the wrapping of text in a column.
cliui.div(column, column, column)
Create a row with any number of columns, a column can either be a string, or an object with the following options:
- text: some text to place in the column.
- width: the width of a column.
- align: alignment,
right
orcenter
. - padding:
[top, right, bottom, left]
. - border: should a border be placed around the div?
cliui.span(column, column, column)
Similar to div
, except the next row will be appended without
a new line being created.
cliui.resetOutput()
Resets the UI elements of the current cliui instance, maintaining the values
set for width
and wrap
.

No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE.txt:0
- Info: FSF or OSI recognized license: ISC License: LICENSE.txt:0
Reason
0 existing vulnerabilities detected
Reason
Found 3/19 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:60: update your workflow using https://app.stepsecurity.io/secureworkflow/yargs/cliui/ci.yaml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:61: update your workflow using https://app.stepsecurity.io/secureworkflow/yargs/cliui/ci.yaml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yaml:66: update your workflow using https://app.stepsecurity.io/secureworkflow/yargs/cliui/ci.yaml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/yargs/cliui/ci.yaml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/yargs/cliui/ci.yaml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/yargs/cliui/ci.yaml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/yargs/cliui/ci.yaml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:39: update your workflow using https://app.stepsecurity.io/secureworkflow/yargs/cliui/ci.yaml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/yargs/cliui/ci.yaml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:51: update your workflow using https://app.stepsecurity.io/secureworkflow/yargs/cliui/ci.yaml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/yargs/cliui/ci.yaml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/release-please.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/yargs/cliui/release-please.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-please.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/yargs/cliui/release-please.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-please.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/yargs/cliui/release-please.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-please.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/yargs/cliui/release-please.yml/master?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/ci.yaml:21
- Warn: npmCommand not pinned by hash: .github/workflows/ci.yaml:44
- Warn: npmCommand not pinned by hash: .github/workflows/ci.yaml:56
- Warn: npmCommand not pinned by hash: .github/workflows/ci.yaml:65
- Warn: npmCommand not pinned by hash: .github/workflows/release-please.yml:21
- Warn: npmCommand not pinned by hash: .github/workflows/release-please.yml:42
- Info: 0 out of 13 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 2 third-party GitHubAction dependencies pinned
- Info: 0 out of 6 npmCommand dependencies pinned
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/ci.yaml:1
- Warn: no topLevel permission defined: .github/workflows/release-please.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 22 are checked with a SAST tool
Score
3.9
/10
Last Scanned on 2025-03-10
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More