Skip to main content

Prerequisites

Nash is written in Rust and requires the Rust toolchain to build from source.

Install Rust

If you don’t have Rust installed, install it using rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
After installation, restart your terminal or run:
source $HOME/.cargo/env

Verify Rust Installation

Check that you have Rust 1.75 or later:
rustc --version
Nash requires Rust 1.75+ due to modern language features and dependencies.

Build Nash from Source

Nash is currently distributed as source code. Follow these steps to build it:
1

Clone the repository

git clone https://github.com/sammwyy/nash
cd nash
2

Build the release binary

cargo build --release
This compiles Nash with optimizations enabled. The build process typically takes 1-3 minutes depending on your system.
The --release flag is important for performance. Debug builds are significantly slower.
3

Locate the binary

After building, the binary will be at:
target/release/nash
You can run it directly from this location:
./target/release/nash
4

(Optional) Install system-wide

To make Nash available from anywhere, copy it to a directory in your PATH:
sudo cp target/release/nash /usr/local/bin/
Or add to your user bin directory:
mkdir -p ~/.local/bin
cp target/release/nash ~/.local/bin/
# Add ~/.local/bin to your PATH if not already there
export PATH="$HOME/.local/bin:$PATH"

Verify Installation

Test that Nash is working correctly:

Check version

nash --version
You should see:
nash 0.1.0

Run interactive REPL

Start Nash in interactive mode:
nash
You should see the welcome banner:
Nash — Not A Shell  │  logged in as user  │  type help or Ctrl-D to exit

user@nash:/home/user$

Test basic commands

Try some commands in the REPL:
user@nash:/home/user$ pwd
/home/user

user@nash:/home/user$ ls
Desktop/  Documents/  Downloads/  welcome.txt

user@nash:/home/user$ cat welcome.txt
# Content of welcome.txt appears here

user@nash:/home/user$ echo "Nash is working!" | grep working
Nash is working!
Exit Nash with Ctrl-D or by typing exit.

Dependencies

Nash has minimal runtime dependencies. All dependencies are automatically handled by Cargo during build:
DependencyVersionPurpose
rustyline14.0REPL and readline functionality
clap4.0CLI argument parsing
anyhow1.0Error handling
thiserror1.0Error type derivation
indexmap2.0Ordered environment variables
No system dependencies are required at runtime. Nash is a fully self-contained binary.

Build Profile

The release build uses these optimizations (from Cargo.toml):
[profile.release]
opt-level = 3      # Maximum optimization
lto = true         # Link-time optimization
These settings produce a highly optimized binary suitable for production use.

Troubleshooting

Build fails with “cannot find crate”

Ensure you have a stable internet connection. Cargo needs to download dependencies:
cargo clean
cargo build --release

“error: linker cc not found”

You need a C compiler for linking. Install build tools:
sudo apt update
sudo apt install build-essential

Binary is too large

You can strip debug symbols to reduce size:
strip target/release/nash

Permission denied when installing

If sudo cp to /usr/local/bin/ fails, use the user bin directory instead:
mkdir -p ~/.local/bin
cp target/release/nash ~/.local/bin/
Then add to your shell’s RC file (~/.bashrc, ~/.zshrc, etc.):
export PATH="$HOME/.local/bin:$PATH"

Uninstalling

To remove Nash:
# If installed to /usr/local/bin
sudo rm /usr/local/bin/nash

# If installed to ~/.local/bin
rm ~/.local/bin/nash

# Remove the source directory if desired
cd ..
rm -rf nash

Next Steps

Now that Nash is installed, continue to the quickstart guide to learn how to use it:

Quickstart Tutorial

Get started with hands-on examples and learn Nash basics

Build docs developers (and LLMs) love