Cette page est affichée en anglais. Une traduction française est en cours.
ConfigsMay 19, 2026·3 min de lecture

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.

Prêt pour agents

Cet actif peut être lu et installé directement par les agents

TokRepo expose une commande CLI universelle, un contrat d'installation, le metadata JSON, un plan selon l'adaptateur et le contenu raw pour aider les agents à juger l'adaptation, le risque et les prochaines actions.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
Elvish Shell
Commande CLI universelle
npx tokrepo install 157aaa0c-533a-11f1-9bc6-00163e2b0d79

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

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires