A simple, semi-toy Unix shell written in Rust.
Note: Rust environment is needed for installation.
You can try cicada
out without installing it by checking out the repository
and run cargo run
in its root directory.
$ git clone https://github.com/mitnk/cicada
$ cd cicada
$ cargo run
If you've checked out the cicada repository, you can do this:
$ make install
This will install cicada
under your /usr/local/bin
. Use sudo
if needed.
$ cargo install -f cicada
This will install cicada into ~/.cargo/bin/
.
Appending /usr/local/bin/cicada
into your /etc/shells
, then run
$ chsh -s /usr/local/bin/cicada
``` $ ls | head -n3 Desktop Documents Downloads
$ echo foo bar | awk -F " " '{print $2, $1}' bar foo ```
$ ls file-not-exist 2>&1 | wc > e.txt
$ cat e.txt
1 7 46
$ ls -l `which sh`
-r-xr-xr-x 1 root wheel 630464 Mar 23 07:57 /bin/sh
``` $ echo foo; echo bar foo bar
$ echo foo && echo bar foo bar
$ echo foo || echo bar foo ```
$ 1 + 2 * 3 - 4
3
$ (1 + 2) * (3 - 4) / 8.0
-0.375
Cicada use RC file: "~/.cicadarc". Currently only support ENVs and aliases:
```
export RUSTBACKTRACE='full' export LESS="-R" export COPYFILEDISABLE=1
export PATH="/usr/local/bin:$PATH"
export HISTORY_FILE=/Users/mitnk/.local/share/xonsh/xonsh-history.sqlite
alias ls="ls -G" alias ll="ls -lh" ```
Cicada currently only support simplifed completion. It uses YAML files
to define two level completion. Put your completion files under
~/.cicada/completers/
. And the completion files look like this:
``` $ ls ~/.cicada/completers/ brew.yaml git.yaml pip.yaml vox.yaml
$ cat ~/.cicada/completers/brew.yaml - doctor - info - install - list - search - uninstall - update - upgrade
$ brew u
Currently, cicada supports maximum 2 level completion:
``` $ cat ~/.cicada/completers/pip.yaml - install: - --force-reinstall - -U - --upgrade - -r - --requirement - --user - download - uninstall - freeze - list - show - check - search: - --no-cache-dir - --timeout - wheel - hash - completion - help
$ pip ins
$ pip install --re
Ctrl-Z
, fg
, bg
etc)