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


Enable JavaScript to see demos as slides.

Powerful Pipelines

Text pipelines are intuitive and powerful. However, if your data have inherently complex structures, processing them with the pipeline often requires a lot of ad-hoc, hard-to-maintain text processing code.

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

~> curl https://api.github.com/repos/elves/elvish/issues |
from-json | all (one) |
each {|x| echo (exact-num $x[number]): $x[title] } |
head -n 7
1465: Pipelines.html still using legacy syntax.
1464: Ability to change the initial filter for completion
1463: No filtering when constructing the candidate list du
ring completion
1462: Add language.html and command.html to docset search
1460: Symbols Clobbered by Elvish?
1453: Add a `&uniq` option to the `builtin:order` command
and a `builtin:uniq` command
1449: Hard crash with an Alias module alias with closure

Intuitive Control Structures

If you know programming, you probably already know how if looks in C. So why learn another syntax?

Elvish comes with a standard set of control structures: conditional control with if, loops with for and while, and exception handling with try. All of them have a familiar C-like syntax.

~> if $true { echo good } else { echo bad }               
~> for x [lorem ipsum] {
echo $x.pdf
~> try {
fail 'bad error'
} except e {
echo error $e
} else {
echo ok
error ?(fail 'bad error')

Directory History

Do you type far too many cd commands? Do you struggle to remember which deeply/nested/directory your source codes, logs and configuration files are?

Backed by a real database, Elvish remembers all the directories you have been to, all the time. Just press Ctrl-L and search, as you do in a browser.

~>                                           xiaq@xiaqsmbp
* ~
* ~/go/src/github.com/elves/elvish
110 ~/on/elvish-site/code
62 ~/on/elvish-site/code/src
52 ~/go/src/github.com/elves/elvish/edit
34 ~/on/elvish-site/code/tty
33 ~/on/elvish-site/code/assets
32 ~/go/src/github.com/elves/elvish/eval
26 ~/on/chat-app/code
24 ~/on/elvish-site/code/dst
20 ~/go/src/github.com/elves/md-highlighter
14 ~/on/chat-app/code/public
13 ~/.elvish

Command History

Want to find the magical ffmpeg command that you used to transcode a video file two months ago, but it is buried under a million other commands?

No more cycling through history one command at a time. Press Ctrl-R and start searching your entire command history.

~>                                           xiaq@xiaqsmbp
13345 make tools/ttyshot
13346 make
13347 ./assets/
13348 ls
13349 ls
13350 rm *.png
13351 git st
13352 ..
13353 git st
13354 git add .
13355 git st
13356 git commit
13357 git push

Built-in File Manager

Want the convenience of a file manager, but can't give up the power of a shell?

You no longer have to make a choice. Press Ctrl-N to start exploring directories and preview files, with the full power of a shell still under your fingertip.

~/go/src/github.com/elves/elvish>            xiaq@xiaqsmbp
elvish CONTRIBUTING.md FROM golang:onbuild
fix-for-0.7 Dockerfile
images Gopkg.lock
md-highlighter Gopkg.toml

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 news, tips, and developers’ musings

  • Subscribe to the feed to keep updated

Join the Community

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

More Resources