Building from Source
Shard is written in Rust with a React/Tauri frontend. Here’s how to build it yourself.
Prerequisites
Required
- Rust (latest stable) - Install via rustup
- Node.js 20+ or Bun - For the frontend
- Git - To clone the repository
macOS
# Install Xcode command line tools
xcode-select --install
# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Install Bun (recommended) or Node.js
curl -fsSL https://bun.sh/install | bashLinux
# Install system dependencies (Ubuntu/Debian)
sudo apt update
sudo apt install -y libwebkit2gtk-4.1-dev build-essential curl wget file libssl-dev libayatana-appindicator3-dev librsvg2-dev
# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Install Bun
curl -fsSL https://bun.sh/install | bashWindows
- Install Visual Studio Build Tools
- Install Rust
- Install Bun or Node.js
Clone the Repository
git clone https://github.com/Th0rgal/shard.git
cd shardBuild the CLI
The CLI/core library is in the launcher/ directory:
# Development build (fast, unoptimized)
cargo build -p shard
# Release build (slow, optimized)
cargo build -p shard --release
# Run the CLI
cargo run -p shard -- --helpBuild the Desktop App
The desktop app is in the desktop/ directory:
cd desktop
# Install frontend dependencies
bun install
# Development mode (with hot reload)
cargo tauri dev
# Build for production
cargo tauri build --releaseThe built app will be in desktop/src-tauri/target/release/bundle/.
Build Profiles
| Profile | Command | Build Time | Use Case |
|---|---|---|---|
dev | cargo build | ~10s | Development, debugging |
dev-release | cargo build --profile dev-release | ~30s | Quick testing |
release | cargo build --release | ~3-5min | Production builds |
Environment Variables
Create a .env file in the repository root:
# Required for Microsoft authentication
MICROSOFT_CLIENT_ID=your-client-id
# Optional: CurseForge API key
SHARD_CURSEFORGE_API_KEY=your-api-keySee .env.example for all available options.
Troubleshooting
Rust compilation errors
Make sure you have the latest Rust:
rustup update stableTauri build fails
Ensure you have all system dependencies installed. On macOS:
xcode-select --installFrontend dependency issues
Clear and reinstall:
cd desktop
rm -rf node_modules bun.lockb
bun installLast updated on