Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

shell

adaltas20.9kMIT0.12.0

Command line arguments parser and stringifier

shell, cli, arguments, parser, parameters, param, option, command, bash, sh, getopt

readme

Build Status

npm install shell

Shell.js is sugar for parsing typical unix command line options.

  • Reversibility, argument parser and stringifier
  • Auto-discovery, extract unregistered options
  • Standard and commands-based command lines (eg git pull ...)
  • Unlimited/multi level commands (eg myapp server start ...)
  • Type conversion ('string', 'boolean', 'integer', 'array')
  • Object literals, config and parsed results are serializable and human readable
  • Routing, run asynchronous functions or modules based on user commands
  • Auto-generated help
  • Complete tests coverages and samples

Documentation

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

0.12.0 (2024-11-24)

Features

  • shell: improve error messages (95d6e0e)
  • shell: new error_message error_stack and error_help router options (a8e1a1f)
  • shell: router exit option (8554263)

0.11.0 (2024-08-04)

Note: Version bump only for package shell

0.10.1 (2024-07-27)

Note: Version bump only for package shell

0.10.0 (2024-07-27)

Features

0.9.5 (2024-01-17)

Bug Fixes

  • shell: router handler error (3d627de)

0.9.4 (2022-03-15)

Bug Fixes

  • absolute paths in files field (7dcd0d4)

0.9.3 (2022-03-15)

Bug Fixes

0.9.2 (2022-02-24)

Bug Fixes

  • add let/const to variables (dd175ff)
  • commit lint config and comment coffee lint (719e3c2)
  • shell: throw error unless commands an object (96ef828)

0.9.1 (2022-02-17)

Bug Fixes

  • router: handle undefined with config promise (e4f04a4)

0.9.0 (2022-02-16)

Features

0.8.6 (2022-01-06)

Bug Fixes

  • shell: multi level default option (cdaaa9b)

0.8.5 (2021-12-02)

Bug Fixes

  • shell: prevent main collision with command (2a72240)

0.8.4 (2020-12-09)

Note: Version bump only for package shell

0.8.3 (2020-12-07)

Note: Version bump only for package shell

0.8.2 (2020-12-07)

Features

  • router: pass context stdin (17b5f4a)

0.8.1 (2020-11-24)

Bug Fixes

  • grpc_client: c++ version now optional (28b4f32)
  • grpc_server: c++ version now optional (0584565)

0.8.1-alpha.5 (2020-11-23)

Bug Fixes

0.8.1-alpha.4 (2020-11-23)

Bug Fixes

  • grpc: readme for client and server (19c830a)
  • grpc: remove unused shell proto file (35b3cdd)

0.8.1-alpha.3 (2020-11-23)

Note: Version bump only for package parameters

0.8.1-alpha.2 (2020-11-23)

Note: Version bump only for package parameters

Changelog

TODO

  • rename commands into actions
  • describe the anatomy of a command

Trunk

  • monorepos

Version 0.8.0

  • help: print main before options
  • help: new columns and one_column options
  • help: new indent option, default to 2 spaces
  • enum: renamed from one_of
  • options: required as a function
  • main: required as a function
  • utils: isolate all utils
  • router: rename route property to handler

Version 0.7.4

  • main: default to empty array
  • router: promise example
  • router: split writer to stdout and stderr
  • types: validate integer option is not NaN
  • router: route no longer accept process
  • router: remove end property

Version 0.7.3

  • docs: typos

Version 0.7.2

  • package: update author url

Version 0.7.1

  • options: enforce literal object

Version 0.7.0

Backward incompatibilities

  • help: remove help command inject in non leaf commands
  • parse: dont accept string command, only [string] and process
  • commands: only accept objects, no arrays
  • options: only accept objects, no arrays
  • compile: rename stringify method to compile

New functionality

  • options: new disabled property
  • help: new plugin
  • help: sort options
  • router: accept a context object
  • router: rename root property help to router
  • router: new router_call hook
  • hook: return value from handler
  • hook: configure_app_set hook
  • hook: configure_commands_set hook
  • hook: new plugin/hook system
  • config: dsl api plugin
  • project: plugin architecture

Fix and improvements

  • configure: persist name collision store

Version 0.6.0

New functionality

  • router: redirect error to help route
  • router: handle help options and commands

Fix and improvements

  • configure: immutable input
  • project: normalise error messages
  • options: fix collision detection for sibling commands
  • shortcut: no need to test in strict mode

Version 0.5.0

Breaking compatibility

  • run: 1st arg as info with params and extended
  • help: only accept a command, no params
  • route: rename run method and configuration to route
  • helping: only accept params, no more argv

New functionality

  • extended: parse and stringify without merging
  • main: string declaration shortcut
  • parse: main as an array
  • stringify: main from an array

Fix and improvements

  • configure: isolate into its own method
  • options: prevent collisions in flatten mode
  • help: new extended option
  • helping: complete re-implementation
  • stringify: check 2nd argument
  • help: new sample
  • help: remove info per command
  • parse: new extended option
  • parse: improve arguments validation
  • command: only declared at application level

Management

  • license: switch to MIT license
  • package: use mixme
  • package: use file instead of npm ignore
  • package: latest package dependencies

Version 0.4.4

  • one_of: handle optional params
  • lib: move load & merge to utils
  • readme: add author company
  • package: relative paths

Version 0.4.3

  • help: accept array as first argument
  • src: fix error thrown as string instead of object

Version 0.4.2

  • help: overwrittable by user

Version 0.4.1

  • help: handle shortcut
  • shortcut: improve err message
  • config: root property for internal use

Version 0.4.0

  • run: route help options and command
  • src: convert to literate coffee
  • helping: new function
  • help: new revisited format supporting nested commands
  • commands: unlimited nested dimensions
  • doc: improve run description
  • run: user arguments as last arguments, new extended option

Version 0.3.0

  • help: default app name and description
  • config: options and commands as objects literals

Version 0.2.2

  • load: custom user module loader

Version 0.2.1

  • commands: default to help fixed on presence of options
  • run: error handling for humans

Version 0.2.0

  • package: release commands
  • package: update Node.js version inside Travis
  • parse: better error handling
  • options: new default option
  • test: should required by mocha
  • help: fix shortcut in commands
  • options: run get context, argv and config
  • options: run options accepts a function or a module
  • readme: API documentation
  • package: upgrade to CoffeeScript 2