logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

The Elvish command, elvish, contains the Elvish shell and is the main way for using the Elvish program‐

Introduction

       The  Elvish  command, elvish, contains the Elvish shell and is the main way for using the Elvish program‐
       ming language.  This documentation describes its behavior that is not part of the language or any of  the
       standard modules.

Other Command-Line Flags

       Running elvish -help lists all supported command-line flags, which are not repeated here.

Elvish 0.17.0                                     Nov 18, 2024                                 elvish-command(7)

Running A Script

       Invoking  Elvish with one or more arguments will cause Elvish to execute a script (unless there are flags
       that suppress this behavior).

       If the -c flag is given, the first argument is executed as a single code chunk.

       If the -c flag is not given, the first argument is taken as a filename, and the content of  the  file  is
       executed as a single code chunk.

       The remaining arguments are put in $args.

Using Elvish Interactively

       Invoking  Elvish  with no argument runs it in interactivemode (unless there are flags that suppress this
       behavior).

       In this mode, Elvish runs a REPL (read-eval-print loop) that evaluates input  continuously.   The  “read”
       part  of the REPL is a rich interactive editor, and its API is exposed by the edit: module.  Each unit of
       code read is executed as a code chunk.

   RCfile
       Before the REPL starts, Elvish will execute the RCfile.  Its path is determined as follows:

       • If the legacy ~/.elvish/rc.elv exists, it is used (this will be ignored in a future version).

       • Otherwise:

         • On  UNIX  (including  macOS),  $XDG_CONFIG_HOME/elvish/rc.elv  is   used,   defaulting   to   ~/.con‐
           fig/elvish/rc.elv if $XDG_CONFIG_HOME is unset or empty.

         • On Windows, %AppData%\elvish\rc.elv is used.

       If the RC file doesn’t exist, Elvish does not execute any RC file.

   Databasefile
       Elvish  in  interactive mode uses a database file to keep command and directory history.  Its path is de‐
       termined as follows:

       • If the legacy ~/.elvish/db exists, it is used (this will be ignored in a future version).

       • Otherwise:

         • On  UNIX  (including  macOS),   $XDG_DATA_HOME/elvish/db.bolt   is   used,   defaulting   to   ~/.lo‐
           cal/state/elvish/db.bolt if $XDG_DATA_HOME is unset or empty.

         • On Windows, %LocalAppData%\elvish\db.bolt is used.

See Also