PAI One-Command Installer
Production-ready installer for Personal AI Infrastructure (PAI). Install PAI with a single command on Ubuntu, Debian, or macOS.
Quick Start
curl -fsSL https://raw.githubusercontent.com/duanecollins/PAI/main/install.sh | bashOr download and inspect first:
curl -fsSL https://raw.githubusercontent.com/duanecollins/PAI/main/install.sh -o install.sh
less install.sh
bash install.shWhat It Does
The installer automates the complete PAI setup process:
- Detects OS - Ubuntu/Debian/macOS
- Checks prerequisites - Git, curl, etc.
- Installs Bun - Primary JavaScript runtime
- Installs dependencies - yt-dlp, tmux (optional)
- Creates directory structure - MEMORY/, KNOWLEDGE/, WORK/
- Clones PAI repository - Latest from GitHub
- Installs PAI dependencies -
bun install - Creates config files - settings.json, CLAUDE.md
- Installs systemd services - Optional background services
- Runs health check - Validates installation
- Prints next steps - How to configure and use PAI
Supported Platforms
| Platform | Version | Status |
|---|---|---|
| Ubuntu | 22.04 LTS | ✅ Fully tested |
| Ubuntu | 24.04 LTS | ✅ Fully tested |
| Debian | 12+ | ✅ Supported |
| macOS | 13+ | ✅ Supported |
Prerequisites
Minimum Requirements
- OS: Ubuntu 22.04+, Debian 12+, or macOS 13+
- CPU: 2 cores
- RAM: 4GB
- Storage: 20GB available
- Network: Reliable internet connection
Auto-Installed
The installer will automatically install:
- Bun - JavaScript runtime (required)
- Git - Version control (required)
- curl - HTTP client (required)
- yt-dlp - YouTube downloader (optional)
- tmux - Terminal multiplexer (optional)
Not Included (Optional)
These can be installed separately after PAI installation:
- Ollama - Local LLM inference
curl -fsSL https://ollama.com/install.sh | sh
Installation Steps
1. Run Installer
bash ~/.claude/PAI/install.shThe installer will:
- Display OS detection
- Check prerequisites
- Install missing dependencies
- Create directory structure
- Clone PAI repository
- Install PAI dependencies
- Run health check
2. Configure Settings
Edit your settings file:
nano ~/.claude/settings.jsonKey settings to configure:
{
"principal": {
"name": "Your Name",
"email": "your@email.com"
},
"daidentity": {
"name": "Nova",
"displayName": "NOVA"
}
}3. Add API Keys
Add your Anthropic API key:
export ANTHROPIC_API_KEY='sk-ant-...'Make it permanent:
echo 'export ANTHROPIC_API_KEY="sk-ant-..."' >> ~/.bashrc
source ~/.bashrcOptional API keys:
export OPENAI_API_KEY='sk-...' # For OpenAI models
export GOOGLE_API_KEY='AIza...' # For Gemini models
export ELEVENLABS_API_KEY='...' # For voice synthesis4. Test Installation
cd ~/.claude/PAI
bun test5. (Optional) Install Local Models
# Install Ollama
curl -fsSL https://ollama.com/install.sh | sh
# Pull recommended models
ollama pull llama3.2
ollama pull gemma2:9b
ollama pull qwen2.5:7b6. Start Using PAI
Open Claude Code and start working!
Directory Structure
After installation, you’ll have:
~/.claude/
├── PAI/ # PAI repository
│ ├── Algorithm/ # Core algorithm
│ ├── Tools/ # CLI tools
│ ├── skills/ # Skill system
│ ├── DOCUMENTATION/ # Full docs
│ └── install.sh # This installer
├── MEMORY/ # Persistent memory
│ ├── auto/ # Auto-saved context
│ ├── Research/ # Research outputs
│ ├── SESSIONS/ # Session logs
│ ├── STATE/ # State files
│ └── WORK/ # Work sessions
├── KNOWLEDGE/ # Knowledge base
│ ├── People/ # Person notes
│ ├── Companies/ # Company notes
│ ├── Ideas/ # Idea notes
│ └── Research/ # Research notes
├── WORK/ # Active work
├── downloads/ # Downloads
├── backups/ # Backups
├── settings.json # User settings
└── CLAUDE.md # System prompt
Systemd Services (Linux Only)
The installer can optionally set up systemd user services:
# During installation, answer 'y' when prompted:
Install systemd services? (y/N) yAvailable services:
pai-engine-bench-smoke.service- Quick engine smoke testspai-engine-bench-weekly.service- Weekly engine benchmarksupgrade-check.service- Check for PAI updatesopencode-exporter.service- Export OpenCode sessions
Start a service:
systemctl --user start pai-engine-bench-smokeEnable at boot:
systemctl --user enable pai-engine-bench-smokeCheck status:
systemctl --user status pai-engine-bench-smokeHealth Check
The installer runs a comprehensive health check:
[SUCCESS] ✓ Bun: 1.3.13
[SUCCESS] ✓ Git: 2.43.0
[SUCCESS] ✓ PAI repository
[SUCCESS] ✓ Dependencies installed
[SUCCESS] ✓ yt-dlp (optional)
[SUCCESS] ✓ tmux (optional)
[INFO] Ollama not installed (optional - for local models)
Health check: 4 passed, 0 failed
You can re-run the health check anytime:
# Manual health check
bun ~/.claude/PAI/Tools/SystemHealth.tsTroubleshooting
Bun Installation Fails
# Manual Bun installation
curl -fsSL https://bun.sh/install | bash
# Add to PATH
echo 'export PATH="$HOME/.bun/bin:$PATH"' >> ~/.bashrc
source ~/.bashrcPermission Denied
# Make installer executable
chmod +x install.sh
bash install.shRepository Clone Fails
# Clone manually
git clone https://github.com/duanecollins/PAI.git ~/.claude/PAI
cd ~/.claude/PAI
bun installDependencies Fail to Install
# Clean and reinstall
cd ~/.claude/PAI
rm -rf node_modules bun.lockb
bun installHealth Check Fails
Check specific components:
# Check Bun
bun --version
# Check Git
git --version
# Check directory structure
ls -la ~/.claude/
# Check PAI repository
ls -la ~/.claude/PAI/Updating PAI
Pull latest changes:
cd ~/.claude/PAI
git pull
bun installOr re-run the installer:
bash ~/.claude/PAI/install.sh
# Answer 'y' to update existing installationUninstalling
To remove PAI:
# Stop services (if installed)
systemctl --user stop pai-*.service
systemctl --user disable pai-*.service
# Remove PAI directory
rm -rf ~/.claude/PAI
# Optional: Remove all PAI data
rm -rf ~/.claude/Keep your data and just remove the code:
# Remove only the PAI repository
rm -rf ~/.claude/PAI
# Keep MEMORY/, KNOWLEDGE/, WORK/, settings.jsonTesting the Installer
Run the test suite:
bash ~/.claude/PAI/test-install.shExpected output:
PAI Installation Test Suite
═══════════════════════════════════════════════════════════
[TEST] Installer exists... PASS
[TEST] Installer is executable... PASS
[TEST] Has error handling... PASS
[TEST] Has OS detection... PASS
[TEST] Has Bun installation... PASS
[TEST] Has dependency installation... PASS
[TEST] Has health check... PASS
[TEST] Has directory creation... PASS
[TEST] Has version checks... PASS
[TEST] Has next steps... PASS
Passed: 10 Failed: 0
✓ All tests passed!
Next Steps
After successful installation:
-
Read the docs:
less ~/.claude/PAI/DOCUMENTATION/QUICKSTART.md less ~/.claude/PAI/DOCUMENTATION/DEPLOYMENT_GUIDE.md -
Configure your setup:
nano ~/.claude/settings.json -
Add API keys:
export ANTHROPIC_API_KEY='your-key' -
Test PAI:
cd ~/.claude/PAI bun test -
Start using Claude Code with PAI!
Support
- Documentation:
~/.claude/PAI/DOCUMENTATION/ - Issues: GitHub Issues
- Discussions: GitHub Discussions
License
See LICENSE file in the PAI repository.
Installation complete! 🎉
You now have a fully functional Personal AI Infrastructure. Start using Claude Code to interact with PAI.