README

Elvish: Friendly Interactive Shell and Expressive Programming Language

Test Status on Linux Test Status on macOS Test Status on FreeBSD Test status on Windows Test Coverage Go Report Card GoDoc Twitter

Elvish is a friendly interactive shell and an expressive programming language. It runs on Linux, BSDs, macOS and Windows. Despite its pre-1.0 status, it is already suitable for most daily interactive use.

Visit the official website https://elv.sh for prebuilt binaries, blog posts, documentation and other resources.

User groups (all connected with matterbridge): Gitter Telegram Group

Building Elvish

Most users can just use prebuilt binaries and do not need to build from source.

To build Elvish from source, you need

  • A supported OS: Linux, {Free,Net,Open}BSD, macOS, or Windows.

    NOTE: Windows support is experimental, and only Windows 10 is supported.

  • Go >= 1.14.

To build Elvish from source, follow these steps:

# 1. Start from any directory you want to store Elvish's source code
# 2. Clone the Git repository
git clone https://github.com/elves/elvish
# 3. Change into the repository
cd elvish
# 4. Build and install Elvish
make get

This will install Elvish to ~/go/bin.

Alternatively, you can also just use go get to install Elvish:

go get -u github.com/elves/elvish

This will clone the Git repository to ~/go/src/github.com/elves/elvish, updating it if already exists, and install Elvish to ~/go/bin. However, Elvish built this way will lack version information, although it is otherwise fully functional.

Some tips on installation:

  • Remember to add $HOME/go/bin to your PATH so that you can run elvish directly.

  • If you want to install Elvish to a different place, follow these steps to set GOPATH, and Elvish will be installed to $GOPATH/bin instead.

Contributing to Elvish

See CONTRIBUTING.md for more notes for contributors.

Expand ▾ Collapse ▴

Documentation

Overview

    Elvish is a cross-platform shell, supporting Linux, BSDs and Windows. It features an expressive programming language, with features like namespacing and anonymous functions, and a fully programmable user interface with friendly defaults. It is suitable for both interactive use and scripting.

    Source Files

    Directories

    Path Synopsis
    cmd
    examples/cli
    A test program for the cli package.
    A test program for the cli package.
    examples/cliaddon
    A test program for the cli package.
    A test program for the cli package.
    examples/widget
    Command widget allows manually testing a single widget.
    Command widget allows manually testing a single widget.
    withweb/elvish
    Command elvish is an alternative main program of Elvish that includes the web subprogram.
    Command elvish is an alternative main program of Elvish that includes the web subprogram.
    pkg
    buildinfo
    Package buildinfo contains build information.
    Package buildinfo contains build information.
    cli
    Package cli implements a generic interactive line editor.
    Package cli implements a generic interactive line editor.
    cli/addons/completion
    Package completion implements the UI for showing, filtering and inserting completion candidates.
    Package completion implements the UI for showing, filtering and inserting completion candidates.
    cli/addons/histlist
    Package histlist implements the history listing addon.
    Package histlist implements the history listing addon.
    cli/addons/histwalk
    Package histwalk implements the history walking addon.
    Package histwalk implements the history walking addon.
    cli/addons/instant
    Package instant implements an addon that executes code whenever it changes and shows the result.
    Package instant implements an addon that executes code whenever it changes and shows the result.
    cli/addons/lastcmd
    Package lastcmd implements an addon that supports inserting the last command or words from it.
    Package lastcmd implements an addon that supports inserting the last command or words from it.
    cli/addons/listing
    Package listing provides the custom listing addon.
    Package listing provides the custom listing addon.
    cli/addons/location
    Package location implements an addon that supports viewing location history and changing to a selected directory.
    Package location implements an addon that supports viewing location history and changing to a selected directory.
    cli/addons/navigation
    Package navigation provides the functionality of navigating the filesystem.
    Package navigation provides the functionality of navigating the filesystem.
    cli/addons/stub
    Package stub implements the stub addon, a general-purpose addon that shows a modeline and supports pluggable binding.
    Package stub implements the stub addon, a general-purpose addon that shows a modeline and supports pluggable binding.
    cli/clitest
    Package clitest provides utilities for testing cli.App.
    Package clitest provides utilities for testing cli.App.
    cli/histutil
    Package histutil provides utilities for working with command history.
    Package histutil provides utilities for working with command history.
    cli/lscolors
    Package lscolors provides styling of filenames based on file features.
    Package lscolors provides styling of filenames based on file features.
    cli/prompt
    Package prompt provides an implementation of the cli.Prompt interface.
    Package prompt provides an implementation of the cli.Prompt interface.
    cli/term
    Package term provides functionality for working with terminals.
    Package term provides functionality for working with terminals.
    daemon
    Package daemon implements a service for mediating access to the data store, and its client.
    Package daemon implements a service for mediating access to the data store, and its client.
    daemon/internal/api
    Package api defines types and constants useful for the API between the daemon service and client.
    Package api defines types and constants useful for the API between the daemon service and client.
    diag
    Package diag contains building blocks for formatting and processing diagnostic information.
    Package diag contains building blocks for formatting and processing diagnostic information.
    edit
    Package edit implements the line editor for Elvish.
    Package edit implements the line editor for Elvish.
    edit/complete
    Package complete implements the code completion algorithm for Elvish.
    Package complete implements the code completion algorithm for Elvish.
    edit/highlight
    Package highlight provides an Elvish syntax highlighter.
    Package highlight provides an Elvish syntax highlighter.
    env
    Package env keeps names of environment variables with special significance to Elvish.
    Package env keeps names of environment variables with special significance to Elvish.
    eval
    Package eval handles evaluation of parsed Elvish code and provides runtime facilities.
    Package eval handles evaluation of parsed Elvish code and provides runtime facilities.
    eval/errs
    Package errs declares error types used as exception causes.
    Package errs declares error types used as exception causes.
    eval/mods/bundled
    Package bundled manages modules written in Elvish that are bundled with the elvish binary.
    Package bundled manages modules written in Elvish that are bundled with the elvish binary.
    eval/mods/daemon
    Package daemon implements the builtin daemon: module.
    Package daemon implements the builtin daemon: module.
    eval/mods/math
    Package math exposes functionality from Go's math package as an elvish module.
    Package math exposes functionality from Go's math package as an elvish module.
    eval/mods/path
    Package path provides functions for manipulating filesystem path names.
    Package path provides functions for manipulating filesystem path names.
    eval/mods/platform
    Package platform exposes variables and functions that deal with the specific platform being run on, such as the OS name and CPU architecture.
    Package platform exposes variables and functions that deal with the specific platform being run on, such as the OS name and CPU architecture.
    eval/mods/re
    Package re implements a regular expression module.
    Package re implements a regular expression module.
    eval/mods/str
    Package str exposes functionality from Go's strings package as an Elvish module.
    Package str exposes functionality from Go's strings package as an Elvish module.
    eval/mods/unix
    Package unix exports an Elvish namespace that contains variables and functions that deal with features unique to UNIX-like operating systems.
    Package unix exports an Elvish namespace that contains variables and functions that deal with features unique to UNIX-like operating systems.
    eval/vals
    Package vals contains basic facilities for manipulating values used in the Elvish runtime.
    Package vals contains basic facilities for manipulating values used in the Elvish runtime.
    eval/vars
    Package vars contains basic types for manipulating Elvish variables.
    Package vars contains basic types for manipulating Elvish variables.
    fsutil
    Package fsutil provides filesystem utilities.
    Package fsutil provides filesystem utilities.
    getopt
    Package getopt implements a command-line argument parser.
    Package getopt implements a command-line argument parser.
    glob
    Package glob implements globbing for elvish.
    Package glob implements globbing for elvish.
    logutil
    Package logutil provides logging utilities.
    Package logutil provides logging utilities.
    parse
    Package parse implements the elvish parser.
    Package parse implements the elvish parser.
    parse/parseutil
    Package parseutil contains utilities built on top of the parse package.
    Package parseutil contains utilities built on top of the parse package.
    prog
    Package prog provides the entry point to Elvish.
    Package prog provides the entry point to Elvish.
    prog/progtest
    Package progtest provides utilities for testing subprograms.
    Package progtest provides utilities for testing subprograms.
    shell
    Package shell is the entry point for the terminal interface of Elvish.
    Package shell is the entry point for the terminal interface of Elvish.
    store
    Package store defines the permanent storage service.
    Package store defines the permanent storage service.
    store/storetest
    Package storetest keeps test suites against store.Store.
    Package storetest keeps test suites against store.Store.
    strutil
    Package strutil provides string utilities.
    Package strutil provides string utilities.
    sys
    Package sys provide convenient wrappers around syscalls.
    Package sys provide convenient wrappers around syscalls.
    testutil
    Package testutil contains common test utilities.
    Package testutil contains common test utilities.
    tt
    Package tt supports table-driven tests with little boilerplate.
    Package tt supports table-driven tests with little boilerplate.
    ui
    Package ui contains types that may be used by different editor frontends.
    Package ui contains types that may be used by different editor frontends.
    wcwidth
    Package wcwidth provides utilities for determining the column width of characters when displayed on the terminal.
    Package wcwidth provides utilities for determining the column width of characters when displayed on the terminal.
    web
    Package web is the entry point for the backend of the web interface of Elvish.
    Package web is the entry point for the backend of the web interface of Elvish.
    website
    cmd/highlight
    The highlight program highlights Elvish code fences in Markdown.
    The highlight program highlights Elvish code fences in Markdown.
    cmd/macros
    The macros program implements an ad-hoc preprocessor for Markdown files, used in Elvish's website.
    The macros program implements an ad-hoc preprocessor for Markdown files, used in Elvish's website.