Nish is a non-POSIX, multiplatform command-line shell currently in a beta stage. It offers some features common for commands' shells, like Tab completion, syntax highlighting, variables, aliases. But it doesn't provide, for example, own scripting language.
Design goals
- Provide sane defaults: even if command shells are for power users, it doesn't mean that their time isn't valuable. Provide good default settings for the new installation of the shell.
- A simple, extendable core: the base shell should be small as possible, contains only things useful for everyone. The rest of functionality should be in the shell's plugins.
- Configure not rule: add an ability to configure, enable or disable almost everything: style, commands, functionality.
- Safety first: prioritize the safety and security over new features or even speed. A broken program is less useful than the working simple one.
- KISS: Keep It Simple, Stupid: when looking for a solution to a problem, use the simplest approach. After all, the code must be maintained for some time.
Main features
Use a database to store all data related to the shell
All the shell's data, configuration, history, variables and aliases are stored in SQLite database. It allows adding some interesting features to the shell, like searching through its history.
Global and local aliases
The shell allows declaring not only standard aliases, which are available everywhere, but also aliases which available only in the selected directories. For example, you can declare alias
build
which in one directory will be executingmake -j5
and in anothernim release
. Aliases can be declared for just one directory or for each subdirectory of the selected directory too.Advanced shell's commands' history
There are available a few commands to manipulate the shell's commands' history, like show history or clear it. It is also possible to set the amount of commands to store in the shell's history, or the shell should store also invalid commands or not. When there is some text entered by the user, the history search only commands which starts with the entered text. The shell sorts the commands' history not only by most recently used, but also by most frequently used. Additionally, the command allows selecting the amount of commands to show, their sorting order and criteria. These settings cam be set as permanent in the shell's options or ad hoc for the one time. It is also possible to search for a command in the history with the separated shell command.
Advanced shell's configuration
All shell's options can be previewed from the shell. Additionally, it is possible to set them inside the shell and reset options' values to the default values. Also, there are options which are read-only, like, for example, the current version of the shell's database schema.
Global and local environment variables
Beside standard support for environment variables, with set and unset commands, the shell offers also ability to set environment variables only for the selected directories, in the same way how aliases set.
Plugins
The shell's offers a very simple API which allows writing its plugins in any programming language. The communication between the shell and the plugin are made by standard input and output, where the API calls are sending as command line arguments. The plugins can reside in any location.
Advanced help system
The whole content of the help is added to the local database of the shell. It allows searching for help topics, but also to locally modify the help entries. The use can in any moment bring back the default content, or update the local with the new version, with the one command.
Tab completion for the user's entered commands with names of files and directories relative to the current directory and with available commands. It also allows selecting a completion from the list if there is more than one completion available. It is also possible to set the amount of the completions displayed on the list.
Coloring the user entered command on green when it is valid or red when it is invalid, separated colors for environment variables and commands' arguments which contains quotes or double quotes. Can be enabled or disabled in the shell's options.
Suggestions for commands when the user entered an unknown command. It is possible to set the precision of the suggestions with the shell's option. The feature can be disabled either.
Setting the terminal title, can be enabled or disabled in the shell's options.
Theming system. It is possible to set the colors and style, like use underline, bold or italic font (if the terminal emulator supports it) for various of the shell's outputs (errors, help entries, etc.).
Ability to execute command with or without the system's default shell. Additionally, the default behavior of the shell can be set in the shell's options.