Installation
Installation
Section titled “Installation”DHD can be installed in several ways depending on your preferences and system setup.
Prerequisites
Section titled “Prerequisites”- Rust (for building from source)
- Git (for cloning the repository)
- Bun (optional, for TypeScript type checking in your modules) - install from https://bun.sh
Installation Methods
Section titled “Installation Methods”From Source (Recommended)
Section titled “From Source (Recommended)”The most up-to-date way to install DHD is by building from source:
# Clone the repositorygit clone https://github.com/korora-tech/dhdcd dhd
# Build and installcargo install --path .This will install the dhd binary to your Cargo bin directory (usually ~/.cargo/bin/).
Using Cargo
Section titled “Using Cargo”Once DHD is published to crates.io:
cargo install dhdPre-built Binaries
Section titled “Pre-built Binaries”Pre-built binaries for common platforms will be available from the GitHub Releases page.
Linux/macOS
Section titled “Linux/macOS”# Download the latest release (example for Linux x64)curl -LO https://github.com/korora-tech/dhd/releases/latest/download/dhd-linux-x64.tar.gz
# Extracttar -xzf dhd-linux-x64.tar.gz
# Move to PATHsudo mv dhd /usr/local/bin/
# Make executablesudo chmod +x /usr/local/bin/dhdWindows
Section titled “Windows”Download the appropriate .exe file from the releases page and add it to your PATH.
Package Managers
Section titled “Package Managers”Support for popular package managers is planned:
Homebrew (macOS/Linux)
Section titled “Homebrew (macOS/Linux)”# Coming soonbrew install korora-tech/tap/dhdAUR (Arch Linux)
Section titled “AUR (Arch Linux)”# Coming soonyay -S dhdVerify Installation
Section titled “Verify Installation”After installation, verify DHD is working:
# Check versiondhd --version
# Show helpdhd --helpShell Completion
Section titled “Shell Completion”DHD can generate shell completions for better command-line experience:
dhd completion bash > ~/.local/share/bash-completion/completions/dhddhd completion zsh > ~/.zfunc/_dhddhd completion fish > ~/.config/fish/completions/dhd.fishPowerShell
Section titled “PowerShell”dhd completion powershell | Out-String | Invoke-ExpressionTypeScript Support (Optional)
Section titled “TypeScript Support (Optional)”For the best development experience when writing DHD modules, install the TypeScript definitions:
# In your DHD modules directorybun init -ybun add --dev @korora-tech/dhd-types
# Generate type definitionsdhd codegenThis enables:
- Autocompletion in your editor
- Type checking for your modules
- IntelliSense documentation
Updating DHD
Section titled “Updating DHD”To update DHD to the latest version:
From Source
Section titled “From Source”cd /path/to/dhdgit pullcargo install --path . --forceUsing Cargo
Section titled “Using Cargo”cargo install dhd --forceUninstalling
Section titled “Uninstalling”To remove DHD from your system:
Cargo Installation
Section titled “Cargo Installation”cargo uninstall dhdManual Installation
Section titled “Manual Installation”sudo rm /usr/local/bin/dhdTroubleshooting
Section titled “Troubleshooting”Command Not Found
Section titled “Command Not Found”If dhd is not found after installation, ensure the installation directory is in your PATH:
# For Cargo installationsexport PATH="$HOME/.cargo/bin:$PATH"
# Add to your shell config file (.bashrc, .zshrc, etc.)echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.bashrcPermission Errors
Section titled “Permission Errors”If you encounter permission errors during installation:
- Avoid using
sudowith cargo - Ensure you have write permissions to the installation directory
- Consider using
--rootflag to install to a different location
Build Errors
Section titled “Build Errors”If building from source fails:
-
Ensure you have the latest stable Rust toolchain:
Terminal window rustup update stable -
Check for missing system dependencies:
Terminal window # Ubuntu/Debiansudo apt-get install build-essential pkg-config libssl-dev# Fedorasudo dnf install gcc pkg-config openssl-devel# macOSxcode-select --install
Next Steps
Section titled “Next Steps”Now that you have DHD installed:
- Follow the Quick Start Guide to create your first module
- Learn about Core Concepts
- Explore Examples for inspiration