Elvish is an expressive programming language and a versatile interactive shell, combined into one seamless package. It runs on Linux, BSDs, macOS and Windows.

Demos

Enable JavaScript to see demos as slides.

Powerful Pipelines

Pipelines in Elvish can carry structured data, not just text. Stream lists, maps and even functions through the pipeline.

~> range 1100 1111 |
each {|x| curl -sL xkcd.com/$x/info.0.json } |
from-json |
each {|x| printf "%g: %s\n" $x[num] $x[title] }
1100: Vows
1101: Sketchiness
1102: Fastest-Growing
1103: Nine
1104: Feathers
1105: License Plate
1106: ADD
1107: Sports Cheat Sheet
1108: Cautionary Ghost
1109: Refrigerator
1110: Click and Drag

Intuitive Control Structures

Control structures in Elvish have a familiar C-like syntax. Never spell if backwards again.

~> if $true { echo good } else { echo bad }
good
~> for x [lorem ipsum] {
echo $x.pdf
}
lorem.pdf
ipsum.pdf
~> try {
fail 'something bad happened'
} catch e {
echo (styled 'error:' red) $e[reason][content]
} else {
echo ok
}
error: something bad happened

Directory History

Press Ctrl-L and jump to any directory you've been to. Type cd java/com/lorem/ipsum once and only once.

~>                                          elf@host
LOCATION
10 ~/elvish
10 ~/.local/share/elvish
10 ~/elvish/website
10 ~/.config/elvish
9 ~/elvish/pkg/edit
9 ~/elvish/pkg/eval
9 /opt
9 /usr/local
9 /usr/local/share
9 /usr/local/bin
9 /usr
9 /tmp
8 ~/zsh

Command History

Press Ctrl-R and find that beautiful ffmpeg command you used to transcode a video file two months ago.

~>                                          elf@host
HISTORY (dedup on) Ctrl-D dedup
3 echo "hello\nbye" > /tmp/x
4 from-lines < /tmp/x
5 cd /tmp
6 cd ~/elvish
7 git branch
8 git checkout .
9 git commit
19 git status
20 cd /usr/local/bin
21 echo $pwd
22 * (+ 3 4) (- 100 94)
31 make
32 math:min 3 1 30

Built-in File Manager

Press Ctrl-N to explore directories and preview files, with the full power of a shell still under your fingertips.

~/elvish>                                   elf@host
NAVIGATING Ctrl-H hidden Ctrl-F filter
bash 1.0-release.m 1.0 has not been released y
elvis CONTRIBUTING.
zsh Dockerfile
LICENSE
Makefile
PACKAGING.md
README.md
SECURITY.md
cmd
go.mod
go.sum
pkg
syntaxes

Run Elvish

Use this Site

Start your Elvish journey in this very website!

  • Learn the fundamentals and interesting topics

  • Peruse the definitive reference documents

  • Read the blog for the latest news

  • Subscribe to the feed to keep updated

Join the Community

Join any of the following channels – they are all bridged together thanks to Matrix!

More Resources