High-performance Counter-Strike 2 counter-strafe training tool written in Rust.
⚠️ AI-Generated Code Disclaimer This codebase was created with assistance from Claude (Anthropic AI). While functional and tested, use at your own discretion. Review code before use in production environments.
- ⚡ <1ms event latency - Precise keyboard event capture with
rdev - 🎨 Modern UI - GPU-accelerated rendering with
eguiat 144+ FPS - 📊 Real-time feedback - Live timing display with quality evaluation
- 🎯 Training metrics - Track perfect/good/failed counter-strafe attempts
- 🪶 Lightweight - ~8MB binary, <15MB RAM usage
- 🌍 Cross-platform - Linux & Windows support from single codebase
Download the latest release for your platform from the Releases page.
Linux:
# Download and make executable
chmod +x cs2-counter-strafe-trainer-linux-x64
./cs2-counter-strafe-trainer-linux-x64Windows:
Just run cs2-counter-strafe-trainer-windows-x64.exe
You can run directly from the flake without installation:
# Run from GitHub (always latest main branch)
nix run github:DerDaehne/CS2ST
# Or clone and run locally
git clone https://github.com/DerDaehne/CS2ST.git
cd CS2ST
nix runOr add to your configuration.nix or home.nix:
{ pkgs, ... }:
{
environment.systemPackages = [
(pkgs.callPackage (builtins.fetchGit {
url = "https://github.com/DerDaehne/CS2ST";
ref = "main";
}) {})
];
}# Enter development environment
nix develop
# Build and run
cargo run --release
# Or build with Nix directly
nix build
./result/bin/cs2-counter-strafe-trainerInstall dependencies:
# Ubuntu/Debian
sudo apt install pkg-config libxkbcommon-dev libwayland-dev libgl-dev
# Arch
sudo pacman -S pkgconf libxkbcommon wayland mesa
# For Windows cross-compilation
sudo apt install mingw-w64Then build:
# Linux
cargo build --release
# Windows (from Linux)
rustup target add x86_64-pc-windows-gnu
cargo build --release --target x86_64-pc-windows-gnuThe app needs keyboard access. Either:
Option 1: Add user to input group (recommended)
sudo usermod -a -G input $USER
# Log out and back inOption 2: Run with sudo
sudo ./cs2-counter-strafe-trainer- Press A or D to start strafing
- Release the key
- Press the opposite key (counter-strafe)
- Hold for ~80ms (aim for the green zone!)
- Release to complete
- ★ Perfect - 65-95ms (80ms ±15ms) 🟢
- ● Good - 60-120ms 🟡
- ✕ Failed - <60ms or >120ms 🔴
- A/D - Strafe keys
- ESC - Quit
✅ Event latency: <1ms ✅ UI rendering: 144+ FPS ✅ Binary size: 2-5MB ✅ Memory usage: 8-15MB ✅ Timing precision: Microsecond-level
src/
├── main.rs - Entry point & app loop
├── state.rs - Counter-strafe state machine
├── events.rs - Keyboard event capture (rdev)
├── feedback.rs - Feed system with fading
├── stats.rs - Session statistics
└── ui.rs - egui UI rendering
# Run tests
cargo test
# Check code
cargo clippy
# Format code
cargo fmt
# Build optimized binary
cargo build --release
# Check binary size
ls -lh target/release/cs2-counter-strafe-trainerPre-built binaries for Linux and Windows are available on the Releases page.
Releases are automated via GitHub Actions. To create a new release:
# Use the release script
./release.sh 2.0.1
# Review changes
git show HEAD
# Push to trigger automated build
git push && git push origin v2.0.1GitHub Actions will:
- Build Linux binary with Nix (reproducible)
- Cross-compile Windows binary
- Create GitHub release with binaries
- Generate SHA256 checksums
The workflow runs on every v*.*.* tag push.
To test the build process locally before releasing:
# Install act (GitHub Actions local runner)
# https://github.com/nektos/act
# Test Linux build
act -j build-linux
# Test Windows build
act -j build-windows
# Test full release workflow
act -j create-releaseMIT