set -euo pipefail
echo "Setting up development environment..."
git config core.hooksPath .githooks
echo "✓ Git hooks enabled"
if command -v cargo &> /dev/null; then
echo "✓ Rust toolchain found: $(rustc --version)"
else
echo "✗ Rust not found. Install from https://rustup.rs"
exit 1
fi
rustup component add rustfmt clippy 2>/dev/null || true
echo "✓ rustfmt and clippy installed"
if ! command -v cargo-nextest &> /dev/null; then
echo "Installing cargo-nextest..."
cargo install cargo-nextest --quiet
fi
echo "✓ cargo-nextest installed"
echo "Fetching dependencies..."
cargo fetch --quiet
echo "✓ Dependencies fetched"
echo "Building project..."
cargo build --quiet
echo "✓ Build successful"
echo "Running tests..."
cargo nextest run --status-level=fail
echo "✓ All tests passed"
echo ""
echo "Setup complete! You can now:"
echo " cargo nextest run - Run tests"
echo " cargo build - Build debug binary"
echo " cargo clippy - Run linter"
echo " cargo run -- <cmd> - Run the CLI"