Learn ELVISH with Real Code Examples
Updated Nov 20, 2025
Installation Setup
Download Elvish from official website or GitHub
Install using system package manager (brew, apt, etc.)
Add Elvish to PATH and configure shell initialization
Test interactive REPL and command pipelines
Install optional modules or extensions
Environment Setup
Install Elvish via package manager or binaries
Add Elvish to PATH
Configure .elvish/init.elv for initialization
Test REPL and scripts
Install optional modules
Config Files
.elvish/ - configuration and init scripts
modules/ - custom modules
scripts/ - executable Elvish scripts
env/ - environment variable settings
docs/ - usage and documentation
Cli Commands
elvish - launch shell REPL
use myModule - import module
fn name { } - define function
echo $var - print value
ls | where $x > 5 - structured pipeline example
Internationalization
UTF-8 support for scripts and data
Structured data can contain multiple languages
User-defined formatting for localized output
REPL supports multi-language input
Modules can be written for locale-specific tasks
Accessibility
Available on Unix/Linux systems
Lightweight and easy to install
Interactive REPL for learning and debugging
Community documentation and examples
Modules and scripts easy to share
Ui Styling
Text-based REPL interface
Syntax highlighting in compatible editors
Interactive prompts for user input
Optional colors and formatting
Focus on readability and structured output
State Management
Variables scoped per namespace
Closures capture state
Modules encapsulate reusable state
REPL maintains interactive session state
Pipelines pass structured objects preserving state
Data Management
Lists, maps, records as primary structured data
Variables store data in namespaces
Files used for persistent input/output
Pipelines transform data sequentially
Modules provide reusable data operations