NiShiKi is a simple shell wrapper for UNIX-like OS. It has real-time completion functions to assist user command editing, and all completions are customizable by a user-defined config file. Also, you can extend NiShiKi by writing an external plugin software in your favorite language.
Note that NiShiKi is NOT a shell, just a shell wrapper to make command editing works easier. Input commands are processed by your background shell.
NiShiKi is provided as C++ source code that can be compiled easily by common build tools (e.g. GCC and Make), and the source code of NiShiKi is designed not to exceed 3,000 effective rows excluding comment lines, empty lines, and the configuration file.
Many of NiShiKi's behaviors, such as prompts, aliases, completions, and keybinds, can be customized through configuration files. Also users can constomize keybinds by writing an external software in any language you like, and register the software as NiShiKi's keybind.
NiShiKi is written in C++ and carefully designed to be fast enough to support the user's command editing work on one CPU. NiShiKi is just a shell wrapper, therefore it’s like putting the cart before the horse that NiShiKi occupied many CPUs and a software called from NiShiKi cannot use enough computational resources.
You can build NiShiKi using either of Clang (clang++) or GCC (g++). See the following instructions for more details.
# Install g++ and related tools.
sudo apt install build-essential g++ libncurses-dev
# Build NiShiKi.
make
If you prefer Clang over GCC, try the following commands instead.
# Install clang++ and related tools.
sudo apt install build-essential clang libc++-dev libc++abi-dev libncurses-dev
# Build NiShiKi.
make clang
# Move NiShiKi binary to somewhere in $PATH.
mv build/nishiki SOMEWHERE_IN_PATH
# Make NiShiKi config directory and copy config file.
mkdir -p ~/.config/nishiki
cp config.py ~/.config/nishiki
# Launch NiShiKi!
nishiki
Usage of NiShiKi is almost the same as the other shell, just type command and hit enter key. The followings are examples of NiShiKi's functions.
Command completion: Launch nishiki in the root directory of the NiShiKi's GitHub repository that you've cloned, and please type git diff README.md
. You can enjoy various types of command completions provided by nishiki while typing the words. A list of completion candidates is shown under your editing line, and if the number of candidates is only one, you can complete it by typing the TAB key. For example, git d[TAB]
results in git diff
and also, git diff R[TAB]
results in git diff README.md
.
History completion: If you want to type a command which was typed in the past, you don't need to type everything. For trying this functionality, type ls | grep AAA
and run it at first. Then, please type ls
. You might find that the rest of the previous command | grep AAA
will be displayed lightly in the editing area. You can complete the rest of the previous command by typing Ctrl-N
.
File selection: Please type ls[space]
and hit Ctrl-F
. Now the file selection view should be visible on your terminal. You can move the cursor by j
and k
, move to previous/next directory by h
and l
, and select items by [space]
. The selected items are marked as *
. Please hit [enter]
after selecting items, or just hit [enter]
on the item you want to select without selections. Then your terminal back to command editing window, and the items you've selected were added to the editing line.
Process ID selection: Please type ps --pid[space]
and hit Ctrl-P
. Now the process ID selection view should be visible on your terminal. You can move the cursor by j
and k
. In the process ID selection window, please type /chrome[enter]
. Now only chrome related process IDs are visible (if you are using Google Chrome now!). Please hit [enter]
one of the process ID. Then you will be back on the command editing window, and the selected process ID was inserted at the end of the cursor on the editing line.
History selection: It's very close to the file selection and process ID selection, so I will not explain much. Please hit Ctrl-H
!