Skip to content

Installation

DHD can be installed in several ways depending on your preferences and system setup.

  • Rust (for building from source)
  • Git (for cloning the repository)
  • Bun (optional, for TypeScript type checking in your modules) - install from https://bun.sh

The most up-to-date way to install DHD is by building from source:

Terminal window
# Clone the repository
git clone https://github.com/korora-tech/dhd
cd dhd
# Build and install
cargo install --path .

This will install the dhd binary to your Cargo bin directory (usually ~/.cargo/bin/).

Once DHD is published to crates.io:

Terminal window
cargo install dhd

Pre-built binaries for common platforms will be available from the GitHub Releases page.

Terminal window
# Download the latest release (example for Linux x64)
curl -LO https://github.com/korora-tech/dhd/releases/latest/download/dhd-linux-x64.tar.gz
# Extract
tar -xzf dhd-linux-x64.tar.gz
# Move to PATH
sudo mv dhd /usr/local/bin/
# Make executable
sudo chmod +x /usr/local/bin/dhd

Download the appropriate .exe file from the releases page and add it to your PATH.

Support for popular package managers is planned:

Terminal window
# Coming soon
brew install korora-tech/tap/dhd
Terminal window
# Coming soon
yay -S dhd

After installation, verify DHD is working:

Terminal window
# Check version
dhd --version
# Show help
dhd --help

DHD can generate shell completions for better command-line experience:

Terminal window
dhd completion bash > ~/.local/share/bash-completion/completions/dhd
Terminal window
dhd completion zsh > ~/.zfunc/_dhd
Terminal window
dhd completion fish > ~/.config/fish/completions/dhd.fish
Terminal window
dhd completion powershell | Out-String | Invoke-Expression

For the best development experience when writing DHD modules, install the TypeScript definitions:

Terminal window
# In your DHD modules directory
bun init -y
bun add --dev @korora-tech/dhd-types
# Generate type definitions
dhd codegen

This enables:

  • Autocompletion in your editor
  • Type checking for your modules
  • IntelliSense documentation

To update DHD to the latest version:

Terminal window
cd /path/to/dhd
git pull
cargo install --path . --force
Terminal window
cargo install dhd --force

To remove DHD from your system:

Terminal window
cargo uninstall dhd
Terminal window
sudo rm /usr/local/bin/dhd

If dhd is not found after installation, ensure the installation directory is in your PATH:

Terminal window
# For Cargo installations
export PATH="$HOME/.cargo/bin:$PATH"
# Add to your shell config file (.bashrc, .zshrc, etc.)
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.bashrc

If you encounter permission errors during installation:

  1. Avoid using sudo with cargo
  2. Ensure you have write permissions to the installation directory
  3. Consider using --root flag to install to a different location

If building from source fails:

  1. Ensure you have the latest stable Rust toolchain:

    Terminal window
    rustup update stable
  2. Check for missing system dependencies:

    Terminal window
    # Ubuntu/Debian
    sudo apt-get install build-essential pkg-config libssl-dev
    # Fedora
    sudo dnf install gcc pkg-config openssl-devel
    # macOS
    xcode-select --install

Now that you have DHD installed: