# Elvish — Expressive Programming Shell for the Modern Terminal > Elvish is a cross-platform shell that combines a powerful scripting language with a modern interactive experience including structured data pipelines, a built-in file manager, and persistent shared command history. ## Install Save in your project root: # Elvish — Expressive Programming Shell for the Modern Terminal ## Quick Use ```bash # macOS brew install elvish # Linux sudo apt install elvish # or download from GitHub releases elvish ``` ## Introduction Elvish is a shell designed to be both a comfortable interactive environment and a real programming language. It supports structured data (lists, maps) in pipelines instead of plain text, has a built-in file navigation mode, and stores command history in a searchable database shared across sessions. ## What Elvish Does - Passes structured data (lists, maps) through pipelines alongside traditional byte streams - Provides a real programming language with closures, exceptions, namespaces, and modules - Offers an interactive navigation mode for browsing directories, history, and locations - Stores command history in a persistent database with instant fuzzy search across all sessions - Supports syntax highlighting and completion as you type without additional plugins ## Architecture Overview Elvish is a single Go binary with no external dependencies. The shell implements its own language parser, compiler, and bytecode evaluator. Pipelines carry two parallel channels: a byte stream (compatible with Unix pipes) and a value stream for structured data. The interactive frontend uses a custom terminal rendering engine that supports multi-line editing and UI modes (navigation, history, location). Modules are loaded from `~/.config/elvish/lib/` using an import system with explicit namespaces. ## Self-Hosting & Configuration - Install a single binary—no dependencies beyond a terminal emulator - Configuration lives in `~/.config/elvish/rc.elv`, the equivalent of `.bashrc` - Modules install by placing `.elv` files in `~/.config/elvish/lib/` - Environment variables set in `rc.elv` with `set-env NAME value` or `set E:NAME = value` - Customize keybindings by modifying `$edit:insert:binding` and other binding maps ## Key Features - Value pipelines: pass lists and maps between commands, not just text lines - Built-in `ctrl-N` navigation mode for browsing the filesystem without `cd` - Directory history with `ctrl-L` for instant access to frequently visited paths - Exception handling with `try`/`catch`/`finally` blocks for robust scripts - First-class closures and functional programming constructs (each, map, filter) ## Comparison with Similar Tools - **Bash/Zsh** — text-based pipelines only; Elvish adds structured data and a real type system - **Fish** — user-friendly with autosuggestions; Elvish adds structured data and a more expressive scripting language - **Nushell** — also structured pipelines; Elvish uses a more traditional shell syntax and has a smaller binary - **PowerShell** — object pipelines on .NET; Elvish is a lightweight Go binary that runs natively on Unix and Windows - **Oil/Oils** — aims to fix Bash syntax; Elvish is a clean-slate design rather than a Bash superset ## FAQ **Q: Can I use Elvish as my daily login shell?** A: Yes. Elvish is a fully functional login shell. Add it to `/etc/shells` and set it with `chsh`. It can run most simple sh-compatible commands, though complex Bash scripts should still be run with `bash`. **Q: Does Elvish run Bash scripts?** A: No. Elvish has its own language that is not Bash-compatible. You can call Bash scripts explicitly with `bash script.sh` from within Elvish. **Q: How does the structured pipeline work in practice?** A: Commands can output values with `put`, and downstream commands receive them as arguments. For example: `put a b c | each {|x| echo $x }` passes three string values through the pipeline. **Q: Is Elvish fast enough for daily use?** A: Yes. Elvish is compiled to bytecode and runs promptly. The Go runtime adds a small startup cost compared to C-based shells, but it is imperceptible in interactive use. ## Sources - https://github.com/elves/elvish - https://elv.sh --- Source: https://tokrepo.com/en/workflows/asset-157aaa0c Author: AI Open Source