Skip to content

Instantly share code, notes, and snippets.

@Maski0
Created June 30, 2026 10:40
Show Gist options
  • Select an option

  • Save Maski0/454ec99c525ae56b1b1698b8fed88679 to your computer and use it in GitHub Desktop.

Select an option

Save Maski0/454ec99c525ae56b1b1698b8fed88679 to your computer and use it in GitHub Desktop.
Template Project
$ErrorActionPreference = "Stop"
if (-not (Get-Command uv -ErrorAction SilentlyContinue)) {
Write-Host "uv is not installed. Install uv first."
exit 1
}
uv init
New-Item -ItemType Directory -Force -Path "src" | Out-Null
if (Test-Path "main.py") {
Remove-Item "main.py"
}
uv add fastapi uvicorn
@'
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
def root():
return {"message": "FastAPI app is running"}
'@ | Set-Content "src/main.py"
Write-Host "Done. Run with:"
Write-Host "uv run uvicorn src.main:app --reload"
#!/usr/bin/env sh
set -eu
if ! command -v uv >/dev/null 2>&1; then
echo "uv is not installed. Install uv first."
exit 1
fi
uv init
mkdir -p src
rm -f main.py
uv add fastapi uvicorn
cat > src/main.py <<'EOF'
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
def root():
return {"message": "FastAPI app is running"}
EOF
echo "Done. Run with:"
echo "uv run uvicorn src.main:app --reload"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment