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

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 -sL api.github.com/repos/elves/elvish/issues |
all (from-json) |
each {|x| echo (exact-num $x[number]): $x[title] } |
head -n 10
1593: A mechanism to trap "interrupts" would be useful
1592: Should `make style` implicitly run the `codespell` t
arget?
1591: Add a &benchmark option to the time command
1590: Correct the documentation for the `try` command
1588: Support comparing booleans
1587: vi append command binding
1586: Add a `&benchmark` option to the `time` command
1585: boolean values are not comparable
1584: Documentation fixups
1583: Implement a `help` command

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 }
good
~> for x [lorem ipsum] {
echo $x.pdf
}
lorem.pdf
ipsum.pdf
~> try {
fail 'bad error'
} catch e {
echo error $e
} else {
echo ok
}
error [&reason=[&content='bad error' &type=fail]]

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.

~>                                                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

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.

~>                                                elf@host
HISTORY (dedup on)
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

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.

~/elvish>                                         elf@host
NAVIGATING
bash 1.0-release.md 1.0 has not been released yet.
elvish CONTRIBUTING.md
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 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