Where Does Elvish Store Config and History?
Elvish reads ~/.config/elvish/rc.elv at startup, with command history in a bolt database under the state dir.
Last updated
Elvish follows XDG with a legacy escape hatch. The rc file lives at ~/.config/elvish/rc.elv unless the old ~/.elvish/rc.elv exists, which still takes precedence for now. Module libraries resolve from config lib, data lib, and system data dirs in order.
History is a bolt database, not text. Interactive sessions record commands and directories into db.bolt under the state dir (~/.local/state/elvish by default). Back up that one file to carry history between machines, and keep rc.elv in version control for the config half.
Where Elvish stores this, by platform
~/.config/elvish/rc.elv
Runs before every interactive session. Legacy dot folder path overrides it while present. Lib dir beside it holds personal modules.
~/.local/state/elvish/db.bolt
Bolt database with command and directory history. Defaults under the XDG state home; legacy installs use the old dot folder db instead.
~/.config/elvish/rc.elv
Same XDG layout as Linux on Mac. Windows builds use AppData paths for both the rc file and the history database.
Frequently asked questions
Should I use ~/.elvish or ~/.config/elvish?
Edit the XDG rc.elv for interactive setup. The legacy dot folder path still wins when present but is slated for removal, so migrate off it.
How do I read Elvish history outside the shell?
Open the db.bolt file under the state dir with a bolt viewer, or search history inside the shell. The store holds commands plus directory history.
Where do Elvish modules go?
Drop .elv files into the config lib dir for your own modules, or the data lib dir for installed packages. Both join the module search path.
Notice an outdated path? Let us know.