Installation
Crush ships as a single binary and installs just about everywhere. Pick your poison:
| Platform | Jump to |
|---|---|
| Anywhere with Node | npm |
| macOS | Homebrew |
| Linux | Arch, Nix, Debian/Ubuntu, Fedora/RHEL |
| Windows | Winget, Scoop |
| FreeBSD | pkg |
| Anywhere with Go | From source |
npm
The easiest option, and it works anywhere and everywhere Node runs — macOS, Linux, Windows:
npm install -g @charmland/crushmacOS
brew install charmbracelet/tap/crushLinux
Arch Linux (btw)
yay -S crush-binNix
nix run github:numtide/nix-ai-tools#crushNix (NUR)
Crush is available via the official Charm NUR in nur.repos.charmbracelet.crush, which is the most up-to-date way to get Crush in Nix.
You can also try out Crush via the NUR with nix-shell:
# Add the NUR channel.
nix-channel --add https://github.com/nix-community/NUR/archive/main.tar.gz nur
nix-channel --update
# Get Crush in a Nix shell.
nix-shell -p '(import <nur> { pkgs = import <nixpkgs> {}; }).repos.charmbracelet.crush'NixOS & Home Manager Module Usage via NUR
Crush provides NixOS and Home Manager modules via NUR. You can use these modules directly in your flake by importing them from NUR. Since it auto detects whether its a home manager or nixos context you can use the import the exact same way 😃
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nur.url = "github:nix-community/NUR";
};
outputs = { self, nixpkgs, nur, ... }: {
nixosConfigurations.your-hostname = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
nur.modules.nixos.default
nur.repos.charmbracelet.modules.crush
{
programs.crush = {
enable = true;
settings = {
providers = {
openai = {
id = "openai";
name = "OpenAI";
base_url = "https://api.openai.com/v1";
type = "openai";
api_key = "sk-fake123456789abcdef...";
models = [
{
id = "gpt-4";
name = "GPT-4";
}
];
};
};
lsp = {
go = { command = "gopls"; enabled = true; };
nix = { command = "nil"; enabled = true; };
};
options = {
context_paths = [ "/etc/nixos/configuration.nix" ];
tui = { compact_mode = true; };
debug = false;
};
};
};
}
];
};
};
}Debian/Ubuntu
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://repo.charm.sh/apt/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/charm.gpg
echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *" | sudo tee /etc/apt/sources.list.d/charm.list
sudo apt update && sudo apt install crushFedora/RHEL
echo '[charm]
name=Charm
baseurl=https://repo.charm.sh/yum/
enabled=1
gpgcheck=1
gpgkey=https://repo.charm.sh/yum/gpg.key' | sudo tee /etc/yum.repos.d/charm.repo
sudo yum install crushWindows
# Winget
winget install charmbracelet.crush
# Scoop
scoop bucket add charm https://github.com/charmbracelet/scoop-bucket.git
scoop install crushFreeBSD
pkg install crushFrom source
Or just install it with Go:
go install github.com/charmbracelet/crush@latestOn illumos (OpenIndiana, OmniOS), the command above works as-is. Only native OS notifications are unavailable there; terminal-based notifications (OSC) and the terminal bell still work. On Oracle Solaris, add -tags sqlite3_dotlk so the local database uses dot-file locking:
go install -tags sqlite3_dotlk github.com/charmbracelet/crush@latestBinaries
Or, download it:
