| next |
|
|---|
There are lots of ways to get Nu up and running. You can download pre-built binaries from our release page, use your favourite package manager, or build from source.
The main Nushell binary is named nu (or nu.exe on Windows). After installation, you can launch it by typing nu.
@code
[[toc]]
Nu binaries are published for Linux, macOS, and Windows with each GitHub release. Just download, extract the binaries, then copy them to a location on your PATH.
Nu is available via several package managers:
For macOS and Linux, Homebrew is a popular choice (brew install nushell).
For Windows:
-
- Machine scope installation:
winget install nu --source winget --scope machine - Machine scope upgrade:
winget update nushell - User scope installation:
winget install nu --source wingetorwinget install nu --source winget --scope user - User scope upgrade: Due to winget-cli issue #3011, running
winget update nushellwill unexpectedly install the latest version toC:\Program Files\nu. To work around this, runwinget install nushellagain to install the latest version in the user scope.
- Machine scope installation:
-
Chocolatey (
choco install nushell) -
Scoop (
scoop install nu)
For Debian & Ubuntu:
curl -fsSL https://apt.fury.io/nushell/gpg.key | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/fury-nushell.gpg
echo "deb https://apt.fury.io/nushell/ /" | sudo tee /etc/apt/sources.list.d/fury.list
sudo apt update
sudo apt install nushellFor RedHat/Fedora & Rocky Linux:
echo "[gemfury-nushell]
name=Gemfury Nushell Repo
baseurl=https://yum.fury.io/nushell/
enabled=1
gpgcheck=0
gpgkey=https://yum.fury.io/nushell/gpg.key" | sudo tee /etc/yum.repos.d/fury-nushell.repo
sudo dnf install -y nushellFor Alpine Linux:
echo "https://alpine.fury.io/nushell/" | tee -a /etc/apk/repositories
apk update
apk add --allow-untrusted nushellCross Platform installation:
- npm (
npm install -g nushellNote that nu plugins are not included if you install in this way)
Docker images are available from the GitHub Container Registry. An image for the latest release is built regularly for Alpine and Debian. You can run the image in interactive mode using:
docker run -it --rm ghcr.io/nushell/nushell:<version>-<distro>Where <version> is the version of Nushell you want to run and <distro> is alpine or the latest supported Debian release, such as bookworm.
To run a specific command, use:
docker run --rm ghcr.io/nushell/nushell:latest-alpine -c "ls /usr/bin | where size > 10KiB"To run a script from the current directory using Bash, use:
docker run --rm \
-v $(pwd):/work \
ghcr.io/nushell/nushell:latest-alpine \
"/work/script.nu"You can also build Nu from source. First, you will need to set up the Rust toolchain and its dependencies.
For Rust to work properly, you'll need to have a compatible compiler suite installed on your system. These are the recommended compiler suites:
- Linux: GCC or Clang
- macOS: Clang (install Xcode)
- Windows: MSVC (install Visual Studio or the Visual Studio Build Tools)
- Make sure to install the "Desktop development with C++" workload
- Any Visual Studio edition will work (Community is free)
If you don't already have Rust on our system, the best way to install it is via rustup. Rustup is a way of managing Rust installations, including managing using different Rust versions.
Nu currently requires the latest stable (1.66.1 or later) version of Rust. The best way is to let rustup find the correct version for you. When you first open rustup it will ask what version of Rust you wish to install:
@code
Once you are ready, press 1 and then enter.
If you'd rather not install Rust via rustup, you can also install it via other methods (e.g. from a package in a Linux distro). Just be sure to install a version of Rust that is 1.66.1 or later.
You will need to install the "pkg-config", "build-essential" and "libssl-dev" packages:
@code
You will need to install "libxcb", "openssl-devel" and "libX11-devel":
@code
Using Homebrew, you will need to install "openssl" and "cmake" using:
@code
If using Nix for package management on macOS, the openssl, cmake, pkg-config, and curl packages are required. These can be installed:
- Globally, using
nix-env --install(and others). - Locally, using Home Manager in your
home.nixconfig. - Temporarily, using
nix-shell(and others).
Build from crates.io using Cargo
Nushell releases are published as source to the popular Rust package registry crates.io. This makes it easy to build and install the latest Nu release with cargo:
cargo install nu --lockedThe cargo tool will do the work of downloading Nu and its source dependencies, building it, and installing it into the cargo bin path.
Note that the default plugins must be installed separately when using cargo. See the Plugins Installation section of the Book for instructions.
You can also build Nu from the latest source on GitHub. This gives you immediate access to the latest features and bug fixes. First, clone the repo:
@code
From there, we can build and run Nu with:
@code
You can also build and run Nu in release mode, which enables more optimizations:
@code
People familiar with Rust may wonder why we do both a "build" and a "run" step if "run" does a build by default. This is to get around a shortcoming of the new default-run option in Cargo, and ensure that all plugins are built, though this may not be required in the future.