2024-02-26 08:42:30 +08:00
|
|
|
<div class="intro">
|
|
|
|
<div class="intro-content">
|
2018-11-07 09:55:03 +08:00
|
|
|
|
2024-02-26 08:42:30 +08:00
|
|
|
**Elvish** (*noun*):
|
2018-10-16 17:18:59 +08:00
|
|
|
|
2024-02-26 08:42:30 +08:00
|
|
|
1. A powerful scripting language.
|
2018-10-16 17:18:59 +08:00
|
|
|
|
2024-02-26 08:42:30 +08:00
|
|
|
2. A shell with useful interactive features built-in.
|
2018-06-06 04:33:59 +08:00
|
|
|
|
2024-02-26 08:42:30 +08:00
|
|
|
3. A statically linked binary for Linux, BSDs, macOS or Windows.
|
2018-06-06 04:33:59 +08:00
|
|
|
|
2024-02-26 08:42:30 +08:00
|
|
|
</div>
|
|
|
|
<div class="action">
|
2024-02-29 04:02:37 +08:00
|
|
|
<a href="get/" class="primary button">Download</a>
|
|
|
|
<a href="learn/" class="button">Learn</a>
|
|
|
|
<a href="https://github.com/elves/elvish" class="button" target="_blank">GitHub</a>
|
2024-05-31 22:02:23 +08:00
|
|
|
<a href="sponsor/" class="sponsor button">Sponsor</a>
|
2024-02-26 08:42:30 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-06-06 04:33:59 +08:00
|
|
|
|
2024-02-26 08:42:30 +08:00
|
|
|
<section>
|
|
|
|
<header>
|
|
|
|
|
|
|
|
Powerful modern shell scripting
|
2018-06-06 04:33:59 +08:00
|
|
|
|
2024-02-26 08:42:30 +08:00
|
|
|
</header>
|
|
|
|
<div class="showcase content">
|
2018-06-06 04:33:59 +08:00
|
|
|
|
2024-02-26 08:42:30 +08:00
|
|
|
Write readable and maintainable scripts - no cryptic operators, no
|
|
|
|
double-quoting every variable.
|
2018-06-06 04:33:59 +08:00
|
|
|
|
2024-02-26 08:42:30 +08:00
|
|
|
```elvish jpg-to-png.elv [(explainer)](learn/scripting-case-studies.html#jpg-to-png.elv)
|
|
|
|
for x [*.jpg] {
|
|
|
|
gm convert $x (str:trim-suffix $x .jpg).png
|
|
|
|
}
|
|
|
|
```
|
2018-06-06 04:33:59 +08:00
|
|
|
|
2024-02-26 08:42:30 +08:00
|
|
|
Power up your workflows with data structures and functional programming.
|
2018-06-06 04:33:59 +08:00
|
|
|
|
2024-02-26 08:42:30 +08:00
|
|
|
```elvish update-servers-in-parallel.elv [(explainer)](learn/scripting-case-studies.html#update-servers-in-parallel.elv)
|
|
|
|
var hosts = [[&name=a &cmd='apt update']
|
|
|
|
[&name=b &cmd='pacman -Syu']]
|
|
|
|
# peach = "parallel each"
|
|
|
|
peach {|h| ssh root@$h[name] $h[cmd] } $hosts
|
|
|
|
```
|
2018-10-17 17:25:42 +08:00
|
|
|
|
2024-02-26 08:42:30 +08:00
|
|
|
Catch errors before code executes.
|
|
|
|
|
|
|
|
```elvish-transcript Terminal: elvish [(explainer)](learn/scripting-case-studies.html#catching-errors-early)
|
|
|
|
~> var project = ~/project
|
|
|
|
~> rm -rf $projetc/bin
|
|
|
|
compilation error: variable $projetc not found
|
|
|
|
```
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
<section>
|
|
|
|
<header>
|
|
|
|
|
|
|
|
Run it anywhere
|
|
|
|
|
|
|
|
</header>
|
|
|
|
<div class="showcase content">
|
|
|
|
|
|
|
|
Elvish comes in a single statically linked binary for your laptop, your server,
|
|
|
|
your PC, or your Raspberry Pi.
|
|
|
|
|
|
|
|
```elvish-transcript Terminal: Raspberry Pi
|
|
|
|
~> wget dl.elv.sh/linux-arm64/elvish-HEAD.tar.gz
|
|
|
|
~> tar -C /usr/local/bin -xvf elvish-HEAD.tar.gz
|
|
|
|
elvish
|
|
|
|
~> elvish
|
|
|
|
```
|
|
|
|
|
|
|
|
Use Elvish in your CI/CD pipelines. Convenient shell syntax and modern
|
|
|
|
programming language - why not both?
|
|
|
|
|
|
|
|
```yaml github-actions.yaml
|
|
|
|
steps:
|
|
|
|
- uses: elves/setup-elvish@v1
|
|
|
|
with:
|
|
|
|
elvish-version: HEAD
|
|
|
|
- name: Run something with Elvish
|
|
|
|
shell: elvish {0}
|
|
|
|
run: |
|
|
|
|
echo Running Elvish $version
|
|
|
|
```
|
2018-06-06 04:33:59 +08:00
|
|
|
|
2018-10-16 17:18:59 +08:00
|
|
|
</div>
|
2024-02-26 08:42:30 +08:00
|
|
|
</section>
|
|
|
|
<section>
|
|
|
|
<header>
|
|
|
|
|
|
|
|
Interactive shell with batteries included
|
|
|
|
|
|
|
|
</header>
|
|
|
|
<div class="showcase content">
|
|
|
|
|
|
|
|
Press <kbd>Ctrl-L</kbd> for directory history, and let Elvish find
|
|
|
|
`java/com/acme/project` for you.
|
|
|
|
|
|
|
|
```ttyshot Terminal: elvish - directory history [(more)](learn/tour.html#directory-history)
|
|
|
|
home/dir-history
|
|
|
|
```
|
2018-06-06 04:33:59 +08:00
|
|
|
|
2024-02-26 08:42:30 +08:00
|
|
|
Press <kbd>Ctrl-R</kbd> for command history. That beautiful `ffmpeg` command you
|
|
|
|
crafted two months ago is still there.
|
|
|
|
|
|
|
|
```ttyshot Terminal: elvish - command history [(more)](learn/tour.html#command-history)
|
|
|
|
home/cmd-history
|
|
|
|
```
|
|
|
|
|
|
|
|
Press <kbd>Ctrl-N</kbd> for the builtin file manager. Explore directories and
|
|
|
|
files without leaving the comfort of your shell.
|
|
|
|
|
|
|
|
```ttyshot Terminal: elvish - file manager [(more)](learn/tour.html#navigation-mode)
|
|
|
|
home/file-manager
|
|
|
|
```
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
<section>
|
|
|
|
<div class="columns content">
|
2018-10-16 17:18:59 +08:00
|
|
|
<div class="column">
|
2024-02-26 08:42:30 +08:00
|
|
|
<header>
|
|
|
|
|
|
|
|
Chat with the community
|
2018-06-06 04:33:59 +08:00
|
|
|
|
2024-02-26 08:42:30 +08:00
|
|
|
</header>
|
2018-06-06 04:33:59 +08:00
|
|
|
|
2022-12-06 08:54:38 +08:00
|
|
|
Join any of the following channels -- they are all bridged together thanks to
|
|
|
|
[Matrix](https://matrix.org)!
|
2018-06-06 04:33:59 +08:00
|
|
|
|
2022-04-19 18:05:10 +08:00
|
|
|
- Telegram: [Elvish user group](https://t.me/+Pv5ZYgTXD-YaKwcP)
|
2018-06-06 04:33:59 +08:00
|
|
|
|
2024-03-04 20:13:19 +08:00
|
|
|
- Discord: [Elvish Shell](https://discord.gg/jrmuzRBU8D)
|
|
|
|
|
2024-03-04 20:28:52 +08:00
|
|
|
- Matrix: [#users:elv.sh](https://matrix.to/#/#users:elv.sh)
|
|
|
|
|
2022-07-31 18:09:36 +08:00
|
|
|
- IRC: [#elvish](https://web.libera.chat/#elvish) on Libera Chat
|
|
|
|
|
2021-02-18 18:57:54 +08:00
|
|
|
- Gitter: [elves/elvish](https://gitter.im/elves/elvish)
|
|
|
|
|
2024-02-26 08:42:30 +08:00
|
|
|
</div>
|
|
|
|
<div class="column">
|
|
|
|
<header>
|
|
|
|
|
|
|
|
More resources
|
|
|
|
|
|
|
|
</header>
|
|
|
|
|
|
|
|
- [Try Elvish](https://try.elv.sh) directly from the browser (beta)
|
2018-06-06 04:33:59 +08:00
|
|
|
|
2019-12-26 23:48:14 +08:00
|
|
|
- [Awesome Elvish](https://github.com/elves/awesome-elvish): Official list of
|
|
|
|
unofficial Elvish modules
|
2018-06-06 04:33:59 +08:00
|
|
|
|
2021-01-28 07:53:43 +08:00
|
|
|
- [@ElvishShell](https://twitter.com/elvishshell) on Twitter
|
2018-10-16 17:18:59 +08:00
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-02-26 08:42:30 +08:00
|
|
|
</section>
|