New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cli-eleven

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cli-eleven

Effortlessly build command line apps, with compile and run time type-safety by default

0.0.3
latest
npm
Version published
Maintainers
1
Created
Source

eleven

Effortlessly build command line apps, with compile and run time type-safety by default

:sparkles: Features

Fully typed arguments in runtime and dev

Minimal and simple API

  • No sub-commands

Supported types for flags

  • string
  • number
  • boolean
  • enum (todo)

Auto-complete (todo)

Automatic runtime type validation and error messages

Automatic help and version generation by default (todo)

Navigate help section interactively (todo) (optional)

Message when CLI version is outdated (todo) (optional)

Use: https://github.com/sindresorhus/latest-version

Runs in a separate thread to now slow down main functionality

Hints when command is misspelled

Watch mode (todo)

See how changes to your CLI immediately updates the help section

Color output (todo)

Can be turned off with flag or environment variable

Example usage

import { command, run } from 'cli-eleven'

const commands = [
  command({
    name: 'hello',
    flag: {
      world: { type: 'string' },
    },
    run({ world }) {
      console.log(world)
    },
  }),
]

run(commands)

API

command

name

string

run

(runtimeValues) => void

flag

Record<string, Flag>

flag: {
  hello: {
    type: 'string'
  }
}
type

'string' | 'number' | 'boolean'

defaultValue?

string | number | boolean

description?

string

alias?

string

Install

npm install cli-eleven

FAQs

Package last updated on 09 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts