Windows Setup for PraisonAI Claw
Windows setup guide for the PraisonAI Claw dashboard with venv pattern
PraisonAI Claw (praisonai claw) is the PraisonAI Dashboard; this guide covers venv isolation and PowerShell setup on Windows. For the separate OpenClaw project, see Works with OpenClaw.
from praisonaiagents import Agent
agent = Agent(
name="assistant",
instructions="You are a helpful assistant with OpenClaw tools.",
llm="gpt-4o-mini",
)
agent.start("List available OpenClaw tools")The user runs PraisonAI Claw on Windows; the agent calls MCP tools exposed by the local daemon.
How It Works
Quick Start
- Create Virtual Environment
powershell # Create project directory and venv mkdir praisonai-claw cd praisonai-claw python -m venv .venv .venv\Scripts\Activate.ps1 - Install PraisonAI with Claw
powershell # Install with agents and tools extras pip install "praisonai[agents,tools,claw]" # Verify installation praisonai --version Get-Command praisonai | Format-List * - Configure Environment
Claw onboarding expects search tools to be available. Set
TAVILY_API_KEY(recommended) or rely on the free DuckDuckGo fallback ā without Tavily, web search quality is lower.powershell # Create .env file @' # Set keys from your provider dashboards OPENAI_API_KEY= TAVILY_API_KEY= PYTHONPATH=. '@ | Out-File -FilePath .env -Encoding utf8 - Launch PraisonAI Claw Dashboard
powershell praisonai claw # Dashboard opens at http://localhost:8082
PowerShell Setup Script
Create a standardized setup script for repeatable deployments:
Invoke-PraisonClaw.ps1
<#
.SYNOPSIS
Setup and run PraisonAI Claw on Windows
.DESCRIPTION
Creates venv, installs dependencies, and launches the Claw daemon
.PARAMETER ProjectPath
Directory to create/use for the project (default: current directory)
.PARAMETER VenvPath
Virtual environment path (default: .venv)
.PARAMETER LaunchDashboard
Whether to launch the dashboard after setup
#>
param(
[string]$ProjectPath = ".",
[string]$VenvPath = ".venv",
[switch]$LaunchDashboard = $true
)
$ErrorActionPreference = "Stop"
# Resolve absolute paths
$ProjectDir = Resolve-Path $ProjectPath
$VenvDir = Join-Path $ProjectDir $VenvPath
Write-Host "š¦ PraisonAI Claw Windows Setup" -ForegroundColor Cyan
Write-Host "Project: $ProjectDir" -ForegroundColor Green
# Check Python availability
try {
$PythonCmd = Get-Command python -ErrorAction Stop
Write-Host "Python found: $($PythonCmd.Source)" -ForegroundColor Green
} catch {
Write-Error "Python not found. Install Python 3.8+ and add to PATH"
}
# Create venv if it doesn't exist
if (!(Test-Path $VenvDir)) {
Write-Host "Creating virtual environment..." -ForegroundColor Yellow
python -m venv $VenvDir
}
# Activate venv
$ActivateScript = Join-Path $VenvDir "Scripts\Activate.ps1"
if (Test-Path $ActivateScript) {
Write-Host "Activating virtual environment..." -ForegroundColor Yellow
& $ActivateScript
} else {
Write-Error "Virtual environment activation script not found: $ActivateScript"
}
# Verify we're in venv
$VenvPython = Join-Path $VenvDir "Scripts\python.exe"
if (Test-Path $VenvPython) {
Write-Host "Using venv Python: $VenvPython" -ForegroundColor Green
} else {
Write-Error "Virtual environment Python not found"
}
# Install PraisonAI with extras
Write-Host "Installing PraisonAI with OpenClaw..." -ForegroundColor Yellow
& $VenvPython -m pip install --upgrade pip
& $VenvPython -m pip install "praisonai[agents,tools,claw]"
# Verify installation
Write-Host "Verifying installation..." -ForegroundColor Yellow
$PraisonCmd = Join-Path $VenvDir "Scripts\praisonai.exe"
if (Test-Path $PraisonCmd) {
& $PraisonCmd --version
Write-Host "Installation verified: $PraisonCmd" -ForegroundColor Green
} else {
Write-Error "PraisonAI command not found in venv"
}
# Create .env if it doesn't exist
$EnvFile = Join-Path $ProjectDir ".env"
if (!(Test-Path $EnvFile)) {
Write-Host "Creating .env template..." -ForegroundColor Yellow
@'
# OpenAI API Key (required) ā paste your key after the equals sign
OPENAI_API_KEY=
# Optional: Other LLM providers
# ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
# GOOGLE_API_KEY=${GOOGLE_API_KEY}
# Python path
PYTHONPATH=.
'@ | Out-File -FilePath $EnvFile -Encoding utf8
Write-Host "Created $EnvFile - Please add your API keys" -ForegroundColor Yellow
}
# Print diagnostics
Write-Host "`nš Environment Diagnostics:" -ForegroundColor Cyan
Write-Host "Working Directory: $(Get-Location)"
Write-Host "Python Path: $VenvPython"
Write-Host "PraisonAI Path: $PraisonCmd"
Write-Host "Environment File: $EnvFile"
# Launch dashboard if requested
if ($LaunchDashboard -and (Test-Path $EnvFile)) {
Write-Host "`nš Launching OpenClaw Dashboard..." -ForegroundColor Cyan
Write-Host "Dashboard will open at http://localhost:8082" -ForegroundColor Green
& $PraisonCmd claw
}Quick Setup
# One-liner setup and launch
irm https://raw.githubusercontent.com/MervinPraison/PraisonAIDocs/main/scripts/windows/Setup-PraisonClaw.ps1 | iexManual Commands
# Manual step-by-step setup
mkdir praisonai-openclaw
cd praisonai-openclaw
# Create and activate venv
python -m venv .venv
.\.venv\Scripts\Activate.ps1
# Install with all extras
pip install "praisonai[agents,tools,claw]"
# Create environment
echo "OPENAI_API_KEY=sk-..." > .env
# Verify and launch
praisonai --version
praisonai clawOpenClaw Configuration
Configure OpenClaw with absolute Windows paths and proper subprocess handling:
claw-config.yaml
# OpenClaw Configuration for Windows
name: "PraisonAI Claw"
description: "Windows MCP bridge for PraisonAI agents"
# Python executable path (use absolute path)
python_executable: "C:\\path\\to\\your\\project\\.venv\\Scripts\\python.exe"
# Working directory (use absolute path)
working_directory: "C:\\path\\to\\your\\project"
# Environment variables
environment:
PYTHONPATH: "."
OPENAI_API_KEY: "${OPENAI_API_KEY}"
# Subprocess configuration
subprocess:
# Use forward slashes or escaped backslashes
executable: ".venv/Scripts/praisonai.exe"
args: ["claw", "--port", "8082"]
# Windows-specific options
shell: false
capture_output: true
timeout: 60
# MCP server configuration
mcp:
servers:
filesystem:
command: "python"
args: ["-m", "mcp_server_filesystem", "C:\\path\\to\\project"]
praisonai_tools:
command: ".venv/Scripts/python.exe"
args: ["-m", "praisonai.mcp.server"]
# Health check configuration
health:
endpoint: "http://localhost:8082/health"
interval: 30
timeout: 5launch.ps1
# Windows launcher script for OpenClaw
param(
[string]$ConfigPath = "claw-config.yaml",
[int]$Port = 8082,
[switch]$Debug = $false
)
$ErrorActionPreference = "Stop"
# Resolve paths
$ProjectRoot = Split-Path -Parent $MyInvocation.MyCommand.Path
$VenvPython = Join-Path $ProjectRoot ".venv\Scripts\python.exe"
$ConfigFile = Join-Path $ProjectRoot $ConfigPath
# Validate environment
if (!(Test-Path $VenvPython)) {
Write-Error "Virtual environment not found. Run setup script first."
}
if (!(Test-Path $ConfigFile)) {
Write-Warning "Config file not found: $ConfigFile"
}
# Set environment
$env:PYTHONPATH = $ProjectRoot
Push-Location $ProjectRoot
try {
# Launch OpenClaw
Write-Host "š¦ Starting OpenClaw..." -ForegroundColor Cyan
Write-Host "Python: $VenvPython" -ForegroundColor Green
Write-Host "Config: $ConfigFile" -ForegroundColor Green
Write-Host "Port: $Port" -ForegroundColor Green
if ($Debug) {
& $VenvPython -c "
import sys
print(f'Python: {sys.executable}')
print(f'Working dir: {sys.path[0]}')
"
}
# Start the daemon
& $VenvPython -m praisonai claw --port $Port
} finally {
Pop-Location
}Verification Checklist
Environment Setup
- [ ] Python 3.8+ installed and in PATH
- [ ] Virtual environment created and activated
- [ ] PraisonAI installed with
[agents,tools,claw]extras - [ ]
.envfile created with API keys - [ ] Paths use absolute Windows format
OpenClaw Health Check
# Verify PraisonAI installation
praisonai --version
# Test OpenClaw launch
praisonai claw --help
# Check available tools
praisonai tools list
# Verify MCP connectivity
Invoke-RestMethod -Uri "http://localhost:8082/health" -Method GetMCP Tool Validation
# List available MCP servers
praisonai mcp list
# Test tool functionality
praisonai test-agent "List files in current directory"
# Verify subprocess paths
Get-Process | Where-Object {$_.ProcessName -like "*python*"}Security Validation
- [ ]
.envfile not committed to version control - [ ] API keys stored securely (Windows Credential Manager for production)
- [ ] Virtual environment isolated from global Python
- [ ] PowerShell execution policy allows script execution
- [ ] Firewall allows localhost:8082 (if needed)
Common Windows Issues
PowerShell Execution Policy
# Check current policy
Get-ExecutionPolicy
# Allow script execution (if needed)
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# Or run with bypass (temporary)
PowerShell -ExecutionPolicy Bypass -File .\Setup-PraisonClaw.ps1Path Resolution
# Use absolute paths to avoid working directory issues
$ProjectRoot = (Get-Location).Path
$VenvPath = Join-Path $ProjectRoot ".venv"
$PythonExe = Join-Path $VenvPath "Scripts\python.exe"
# Verify paths exist
Test-Path $PythonExeModule Import Errors
# Ensure venv is activated
.\.venv\Scripts\Activate.ps1
# Verify installation
python -c "import praisonai; print(praisonai.__version__)"
# Check PYTHONPATH
$env:PYTHONPATH = "."
python -c "import sys; print('\n'.join(sys.path))"Subprocess Issues
# Use console script instead of python -m
praisonai claw # Not: python -m praisonai claw
# Check if command exists
Get-Command praisonai
# Use full path if needed
& ".\.venv\Scripts\praisonai.exe" clawProduction Deployment
- Service Installation
powershell # Install as Windows Service (requires admin) # Create service wrapper script $ServiceScript = @' & "C:\path\to\project\.venv\Scripts\praisonai.exe" claw --port 8082 '@ # Register service (using NSSM or sc.exe) nssm install PraisonAIClaw PowerShell -ExecutionPolicy Bypass -File service.ps1 nssm set PraisonAIClaw Start SERVICE_AUTO_START - Security Configuration
powershell # Use Windows Credential Manager for API keys cmdkey /generic:praisonai_openai /user:api /pass:your-actual-key # Update .env to read from credential store # OPENAI_API_KEY will be read from secure storage - Monitoring Setup
powershell # Health check script $HealthCheck = @' $Response = Invoke-RestMethod -Uri "http://localhost:8082/health" -TimeoutSec 5 if ($Response.status -ne "ok") { Restart-Service PraisonAIClaw } '@ # Schedule health checks Register-ScheduledTask -TaskName "PraisonClawHealth" -Trigger (New-ScheduledTaskTrigger -RepetitionInterval (New-TimeSpan -Minutes 5) -Once -At (Get-Date))
Best Practices
Isolate PraisonAI in a dedicated venv
OpenClaw’s Windows pattern relies on a per-project virtual environment. Create and activate a venv before installing so system Python stays clean and tool versions are reproducible across machines and CI.
Point OpenClaw at the local daemon, not the internet
The agent reaches MCP tools through the local OpenClaw daemon (e.g. http://localhost:8082). Bind the daemon to localhost so the tool surface isn’t exposed on the network, and let Windows handle host-level access control.
Health-check and auto-restart the service
Long-running Windows deployments should watch the daemon’s /health endpoint and restart the service on failure. A scheduled health check (as shown above) keeps tools available without manual intervention after a crash or reboot.
Keep credentials out of PowerShell scripts
Store API keys as Windows environment variables or a secrets store, not inline in .ps1 files. Scripts committed to a repo or shared with a team should reference the environment so keys never leak.