- Move Windows storage to DPAPI-backed local app data - Keep non-Windows storage on the native credential store - Update docs and UI copy to describe the new behavior
9.7 KiB
9.7 KiB
Dev Cheat Sheet
Concise command reference for day-to-day work across Git, Python, Rust, Node, Tauri, and .NET.
Use this as a practical command sheet, not as a full tutorial.
Table of Contents 📑
- Setup
- Git
- PAQ-Next (Advanced Compression)
- Python
- Node and npm
- Rust
- Tauri v2
- Dotnet and CSharp
- Common Output Folder Pattern
- Docker
- Useful Cleanup Commands
- Recommended Habits
- Workflows and SDT DevTool
Setup
Setup w64devkit for C++ (PAQ-Next)
$env:PATH = "f:\w64devkit\w64devkit\bin;" + $env:PATH
Adds GCC/G++ and Unix tools to the current PowerShell session.
Probe toolchain availability
python scripts/diag.py probe --tool dotnet --json
python scripts/diag.py probe --tool python --json
python scripts/diag.py probe --tool node --json
python scripts/diag.py probe --tool npm --json
python scripts/diag.py probe --tool cargo --json
python scripts/diag.py probe --tool tauri --json
python scripts/diag.py probe --tool git --json
Checks if required tools are in the current path.
Shell bootstrap (doctor)
python scripts/dev_shell.py doctor
Analyzes the environment and reports missing components or configuration errors.
Git
Check where you are
git status --short --branch
git remote -v
git branch -vv
# See which files are ignored by git
git clean -nd
Stashing
git stash push -m "Description"
git stash pop
git stash drop # Discard
git stash clear # Wipe all stashes
Remotes & Pushing - THE FLAGS
# Safer 'force push' (fails if remote has moved)
git push --force-with-lease
# Push all branches and all tags at once
git push --all
git push --tags
# Delete a remote branch
git push origin --delete branch-name
# Set upstream for current branch (first push)
git push -u origin branch-name
History & Analysis
# Graphical log in terminal
git log --graph --oneline --decorate --all
# Search commit messages
git log --grep="bug fix"
# Find which commit introduced a string
git log -S "secret_key"
# See changes per line (last change for every line)
git blame file_path.py
Git Repository Cleanup
# Fast cleanup of untracked files
git clean -fd
# Prune stale remote tracking branches
git fetch origin --prune
PAQ-Next (Advanced Compression)
Compile PAQ-Next (C++)
# Add toolchain first (if not in path)
$env:PATH = "f:\w64devkit\w64devkit\bin;" + $env:PATH
# Build from root of src-paq-next/
g++ -O3 -mavx2 -Iinclude cli/main.cpp src/archiver.cpp -o paq_next_cli.exe
Compiles with AVX2 optimizations and include-path support.
Run PAQ-Next Compression
# Compress a folder
.\paq_next_cli.exe c <source_folder>
# Compress a folder to a specific file
.\paq_next_cli.exe c <source_folder> <output_name>.paq
# Extract an archive
.\paq_next_cli.exe x <archive>.paq <destination_folder>
Python
Package Management - THE FLAGS
# Install from requirements with upgrades
pip install -r requirements.txt --upgrade
# Install without saving to cache (Great for CI/Low disk)
pip install -r requirements.txt --no-cache-dir
# Target a specific directory
pip install -t ./lib <package>
# Search local packages for a string
pip list | Select-String "crypto"
# See everything about a package
pip show <package-name>
Quality & Performance
# Parallel testing
pip install pytest-xdist
pytest -n auto # Use all CPU cores
# Benchmark a script
python -m cProfile -s time script.py
Node and npm
Dependency Management - THE FLAGS
# Force install (when versions conflict)
npm install --force
# Ignore peer dependency errors (Common in React)
npm install --legacy-peer-deps
# Production only (Skip devDependencies)
npm install --production
# Deep security audit and auto-fix
npm audit fix --force
Scripts & Performance
# Build with specific log level
npm run build --loglevel silent
# Pass custom flags directly to a script
npm run dev -- --host 0.0.0.0 --port 3000
Rust
Essential Workflow - THE FLAGS
# Fast check (Skip code generation)
cargo check --all-targets --all-features
# Build with specific features enabled
cargo build --features "feature-a,feature-b"
# Build without default features
cargo build --no-default-features
# Cross-compilation (Requires target in toolchain)
cargo build --target x86_64-apple-darwin
cargo build --target aarch64-unknown-linux-gnu
Diagnostics & Performance
# See exactly why a build is slow
cargo build --timings
# Run specific test by name/substring
cargo test test_function_name
# Open local docs for all dependencies
cargo doc --open --no-deps
Tauri v2
Initialize Mobile (REQUIRED for first run)
# This creates the android/ios project folders in src-tauri/gen
npm run tauri android init
npm run tauri ios init
Desktop Builds - THE FLAGS
# Fast build (Binary only)
npm run tauri build -- --no-bundle
# Explicit config file (Great for multi-env)
npm run tauri build -- --config path/to/config.json
# Verbose output for debugging packaging
npm run tauri build -- --verbose
Mobile Builds
# Debug mode on Android device (or Emulator)
npm run tauri android dev
# Production APK/AAB generation
npm run tauri android build -- --target aarch64
Troubleshooting
# System diagnostic report
npm run tauri info
Frontend-only build
npm run build
Builds the web frontend assets (the dist/ folder) without launching or packaging the desktop app.
Dotnet and CSharp
Restore & Build - THE FLAGS
# Restore from specific NuGet source
dotnet restore --source https://api.nuget.org/v3/index.json
# Build without restoring (Great for build script repetition)
dotnet build --no-restore
# Build with minimal output (Keep it clean)
dotnet build --verbosity quiet # or minimal, normal, detailed, diagnostic
Run & Watch
# Run with custom environment variables
$env:ASPNETCORE_ENVIRONMENT="Development"; dotnet run
# Watch with specific project filter
dotnet watch --project Project.csproj
Advanced Publishing
# Single-File for Linux (Self-Contained)
dotnet publish -c Release -r linux-x64 --self-contained true `
-p:PublishSingleFile=true `
-p:IncludeNativeLibrariesForSelfExtract=true `
-o ./output/linux-x64-single
# Ready-To-Run (R2R) - Fast startup at the cost of size
dotnet publish -c Release -o ./output -p:PublishReadyToRun=true
Tools
# Install a dotnet tool globally
dotnet tool install -g <tool-name>
Common Output Folder Pattern
Use explicit output folders so results are easy to find and easy to clean up.
./output/
./output/win-x64/
./output/win-x64-single/
./output/linux-x64/
./output/linux-x64-single/
Docker
Build & Run
docker build -t app-name .
docker run -p 8080:80 app-name
Docker System Cleanup
docker system prune -a # Wipe everything unused
docker container prune
docker image prune
Useful Cleanup Commands
Remove Node artifacts
Remove-Item -Recurse -Force .\node_modules
Remove-Item -Recurse -Force .\dist
Remove Rust / Tauri artifacts
Remove-Item -Recurse -Force .\src-tauri\target
Remove .NET artifacts (Deep clean)
Get-ChildItem -Include bin,obj,output -Recurse | Remove-Item -Recurse -Force
Remove Python artifacts
Remove-Item -Recurse -Force .\.venv
Get-ChildItem -Include __pycache__ -Recurse | Remove-Item -Recurse -Force
Recommended Habits
Before any risky Git action:
git status --short --branch
git branch backup/pre-risk
git tag pre-risk-YYYY-MM-DD
git fetch origin --prune
Before publishing builds:
npm run build
cargo test
dotnet test
Adjust to the stack used by the current project.
Workflows and SDT DevTool
Build / Run SDT (DevTool)
# Quick build
python scripts/dotnet-min.py build
# Standard run
dotnet run --project DevTool.csproj
Route & Workflow Verification
# Static check
python scripts/verify-workflow-routes.py --project-root .
# Headless execution test
python scripts/verify-workflow-routes.py --project-root . --workflow build --workflow tauri --execute --env-profile dev
Build & Sync Output
# Publish web assets + app
python scripts/publish-app.py --target web
# Publish specific projects
python scripts/publish-sidecar.py --project path/to/sidecar.csproj
python scripts/publish-webgateway.py --project path/to/gateway.csproj
# Sync all results to central output/
python scripts/sync-output.py
Database Migration Gate
python scripts/migration-gate.py
NuGet / Node Cleanup
# NuGet cache export
python scripts/nuget-export-cache.py --output-zip cache-export.zip
# Clean node_modules safely
python scripts/npm-clean.py --working-dir .