first release of the command shell , combining the capabilities of Power Shell and classic Unix shells. The code is written in Rust and licensed under the MIT License. The project was initially developed as cross-platform and supports running on Windows, macOS, and Linux. To extend functionality, you can use , which interact via the JSON-RPC protocol.
The shell employs a familiar Unix pipeline system in the format of "command|filters|output handler." By default, the output is formatted using the autoview command, which uses a table format, but it is also possible to use commands to display binary data and information in tree view. A strong point of nushell is its ability to manipulate structured data.
The shell allows you to structure the output of various commands and file contents, applying arbitrary filters that are formatted using a unified syntax, which does not require learning the command line options of each specific command. For example, nushell allows constructs like "ls | where size > 10kb" and "ps | where cpu > 10," which will output only files larger than 10Kb and processes that have used more than 10 seconds of CPU resources:
To structure data, a number of extensions are used that parse the output of specific commands and file types. Such extensions are proposed for commands like cd, ls, ps, cp, mkdir, mv, date, rm (you can use the prefix "^" to call native commands, for example, invoking "^ls" will launch the system utility ls). There are also specialized commands, like open for displaying information about a selected file in table format. For JSON, TOML, and YAML formats, automatic parsing is supported.
/home/jonathan/Source/nushell(master)> open Cargo.toml
ββββββ+ββββββ+ββββββ
dependencies | dev-dependencies | package
ββββββ+ββββββ+ββββββ
[object Object] | [object Object] | [object Object]
ββββββ+ββββββ+ββββββ
/home/jonathan/Source/nushell(master)> open Cargo.toml | get package
ββββ-+βββββββββ-+βββ+βββ+ββ+βββ
authors | description | edition | license | name | version
ββββ-+βββββββββ-+βββ+βββ+ββ+βββ
[list List] | A shell for the GitHub era | 2018 | MIT | nu | 0.2.0
ββββ-+βββββββββ-+βββ+βββ+ββ+βββ
/home/jonathan/Source/nushell(master)> open Cargo.toml | get package.version | echo $it
0.2.0
A comprehensive set of instructions is provided for filtering structured data, allowing you to filter rows, sort by columns, sum data, perform simple calculations, use value counters, and convert output into CSV, JSON, TOML, and YAML formats. For unstructured data (text), instructions are available for splitting into columns and rows based on delimiter characters.
Source: opennet.ru
