Description #
Elvish is a modern, expressive shell that combines the power of traditional Unix shells with structured data, functional programming features, and a user-friendly interactive experience. It emphasizes structured pipelines, strong typing, and JSON-like data handling.
History #
Elvish was created by Zhiming Wang and released in 2016 as a next-generation shell focused on usability and programming clarity. It was inspired by shortcomings in existing shells like Bash and Zsh, especially when handling complex data. Elvish is still actively developed and has carved out a niche among users who want modern scripting with better error handling and readable syntax.
Key milestones:
- 2016: Initial release and GitHub project
- Introduced rich structured data in the shell (like lists and maps)
- Frequently updated with community-driven enhancements
- Gained adoption among devs interested in functional shell scripting
Hello World Code #
echo "Hello, World!"
How to Run #
Install Elvish:
- macOS:
brew install elvish
- Linux:
sudo snap install elvish --classic
- Windows:
Download from https://elv.sh
Run script:
- Save the code in
hello.elv
- Execute in terminal:
elvish hello.elv
Key Concepts #
- Built-in support for lists, maps, and structured output
- Uses
$
prefix for variables ($name
) - Supports closures and higher-order functions
- Syntax is whitespace-insensitive and clean
- Pipelines pass structured data, not just text
- Interactive shell with autosuggestions and syntax highlighting
- No silent errors — clear exceptions and stack traces
- Good for complex scripts with reusable logic
- Integrated command history and command completion
- Can interoperate with Unix tools and external commands
Try It Online #
- Replit – Elvish (community build) (search for Elvish shells)
- GitHub – Elvish Examples
- Best used by installing locally for full features
Fun Facts #
- Named after Tolkien’s Elvish language, emphasizing elegance and structure
- One of the few shells that treats data as first-class citizens
- Supports functions as values — rare in most shells
- The shell’s REPL (read-eval-print loop) feels like a programming language
- It’s one of the most experimental yet usable modern shell alternatives