Files
ajarbot/WINDOWS_QUICK_REFERENCE.md

225 lines
4.5 KiB
Markdown
Raw Normal View History

# Windows 11 Quick Reference
Quick command reference for testing and running Ajarbot on Windows 11.
## First Time Setup (5 Minutes)
```powershell
# Step 1: Navigate to project
cd c:\Users\fam1n\projects\ajarbot
# Step 2: Run automated setup
quick_start.bat
# Step 3: Set API key (if prompted)
# Get your key from: https://console.anthropic.com/
# Step 4: Verify installation
python test_installation.py
```
## Test Examples (Choose One)
### Option 1: Basic Agent Test
```powershell
python example_usage.py
```
**What it does:** Tests basic chat and memory
### Option 2: Pulse & Brain Monitoring
```powershell
python example_bot_with_pulse_brain.py
```
**What it does:** Runs cost-effective monitoring
**To stop:** Press `Ctrl+C`
### Option 3: Task Scheduler
```powershell
python example_bot_with_scheduler.py
```
**What it does:** Shows scheduled task execution
**To stop:** Press `Ctrl+C`
### Option 4: Multi-Platform Bot
```powershell
# Generate config file
python bot_runner.py --init
# Edit config (add Slack/Telegram tokens)
notepad config\adapters.local.yaml
# Run bot
python bot_runner.py
```
**To stop:** Press `Ctrl+C`
## Daily Commands
### Activate Virtual Environment
```powershell
cd c:\Users\fam1n\projects\ajarbot
.\venv\Scripts\activate
```
### Start Bot
```powershell
python bot_runner.py
```
### Check Health
```powershell
python bot_runner.py --health
```
### View Logs
```powershell
type logs\bot.log
```
### Update Dependencies
```powershell
pip install -r requirements.txt --upgrade
```
## API Key Management
### Set for Current Session
```powershell
$env:ANTHROPIC_API_KEY = "sk-ant-your-key-here"
```
### Set Permanently (System)
1. Press `Win + X`
2. Click "System"
3. Click "Advanced system settings"
4. Click "Environment Variables"
5. Under "User variables", click "New"
6. Variable: `ANTHROPIC_API_KEY`
7. Value: `sk-ant-your-key-here`
### Check if Set
```powershell
$env:ANTHROPIC_API_KEY
```
## Running as Service
### Quick Background Run
```powershell
Start-Process python -ArgumentList "bot_runner.py" -WindowStyle Hidden
```
### Stop Background Process
```powershell
# Find process
Get-Process python | Where-Object {$_.CommandLine -like "*bot_runner*"}
# Stop it (replace <PID> with actual process ID)
Stop-Process -Id <PID>
```
## Troubleshooting
### "Python not recognized"
```powershell
# Add to PATH
# Win + X -> System -> Advanced -> Environment Variables
# Edit PATH, add: C:\Users\fam1n\AppData\Local\Programs\Python\Python3XX
```
### "Module not found"
```powershell
.\venv\Scripts\activate
pip install -r requirements.txt --force-reinstall
```
### "API key not found"
```powershell
$env:ANTHROPIC_API_KEY = "sk-ant-your-key-here"
```
### Reset Memory
```powershell
Remove-Item -Recurse -Force memory_workspace
python example_usage.py
```
## Project Files Quick Reference
| File/Folder | Purpose |
|-------------|---------|
| `agent.py` | Main agent logic |
| `bot_runner.py` | Multi-platform bot launcher |
| `pulse_brain.py` | Monitoring system |
| `example_*.py` | Example scripts to test |
| `test_*.py` | Test scripts |
| `config/` | Configuration files |
| `docs/` | Full documentation |
| `adapters/` | Platform integrations |
| `memory_workspace/` | Memory database |
## Need More Help?
- **Full Windows Guide:** [docs/WINDOWS_DEPLOYMENT.md](docs/WINDOWS_DEPLOYMENT.md)
- **Main Documentation:** [docs/README.md](docs/README.md)
- **Project Overview:** [README.md](README.md)
## Common Workflows
### Development Testing
```powershell
# Activate environment
.\venv\Scripts\activate
# Make changes to code
# ...
# Test changes
python test_installation.py
python example_usage.py
# Format code (optional)
pip install black
black .
```
### Production Deployment
```powershell
# 1. Configure adapters
python bot_runner.py --init
notepad config\adapters.local.yaml
# 2. Test locally
python bot_runner.py
# 3. Set up as service (see docs/WINDOWS_DEPLOYMENT.md)
# Option A: NSSM (recommended)
# Option B: Task Scheduler
# Option C: Startup script
```
### Monitoring Costs
```python
# In Python script or interactive shell
from pulse_brain import PulseBrain
from agent import Agent
agent = Agent(provider="claude", enable_heartbeat=False)
pb = PulseBrain(agent)
# After running for a while
status = pb.get_status()
tokens = status['brain_invocations'] * 1000 # Average tokens
cost = tokens * 0.000003 # Claude pricing
print(f"Estimated cost: ${cost:.4f}")
```
---
**Quick Start Path:**
1. Run `quick_start.bat`
2. Set API key
3. Run `python test_installation.py`
4. Run `python example_usage.py`
5. Explore other examples!