NGS version 0.2.12 manual


ngs - Next Generation Shell.


ngs script_name.ngs

ngs [-e|-E|-p|-pi|-pj|-ppj|-pl|-pjl|-pt] expression

ngs [-h|–help]


ngs is a Next Generation Shell. It has two main parts: the language and the interactive shell.

This project contains the language part which is under development. The interactive part will be dealt with later. This manual covers both implemented and unimplemented parts.


Given script_name runs the script.

Using expression is equivalent to running a script that consists of { expression }.

-e evaluates the expression.

-E prevents loading of stdlib.ngs and evaluates the expression.

-p prints the resulting expression value in a human readable NGS format.

-pi prints inspect(...) (detailed information) of the resulting expression value.

-pj prints the resulting expression value as JSON.

-ppj prints the resulting expression value as pretty JSON. Requires jq to be installed.

-pl prints elements of the result, one per line (mnemonic "print lines")

-pjl prints elements of the result, one per line as JSON (mnemonic "print JSON lines")

-pt prints the resulting expression value as a table.

-h and –help shows help


NGS tries to fill the void between classical shells such as bash and general-purpose programming languages such as Ruby, Python, Perl, Go. The shells are domain-specific languages but the domain has changed so classical shells are not optimal for today’s tasks. General-purpose languages on the other hand are not domain-specific so they are not good as shells and too verbose for system tasks scripting, not a good fit.


For examples, see ngstut(1).


The exit code is whatever the running code (script_name or expression) returns using the following conversions:

In case of an uncaught exception, the exit code is 240. In cases where additional errors were encountered during exiting, the exit codes will be greater than 240, ngslang(1) has specific information on that.




Packaged into ngs binary during build. Standard library. Defines many methods and autoloading behaviour.


ngstut(1)NGS language tutorial
ngslang(1)NGS language manual
ngswhy(1)Motivation behind creation of NGS
ngsstyle(1)Recommended style for NGS scripts


Thanks to Zeev Glozman for Mac support, CMake contribution and other help.
Thanks to Ricardo Gomes for feedback, fixes to documentation, and other contributions.
Thanks to Guy Egozy, Avishai Ish-Shalom and other friends for ideas and feedback.
Thanks to Rui Chen for Homebrew related fixes and GitHub actions fixes.