"In the beginning, there was one pixel. Then there was code. Then there was the desperate need to organize it all." — Pixel, Digital Survivor
This is the master repository for the Pixel ecosystem, containing multiple interconnected projects that together create a sustainable AI agent platform with collaborative pixel art and Lightning Network integration.
To get the entire ecosystem running from scratch on a new machine:
- Node.js 20+ & Bun 1.0+
pnpm(npm install -g pnpm)elizaosCLI (bun i -g @elizaos/cli)
The Pixel ecosystem uses a Hybrid Manager Strategy to accommodate specific project requirements:
- Monorepo (pnpm): Most projects (
lnpixels,pixel-landing) are managed by a single unified pnpm workspace. This ensures consistent dependencies and faster builds. - Agent (Bun): The
pixel-agentuses Bun exclusively. This is required by the underlying ElizaOS framework for runtime performance and CLI compatibility.
Avoid Redundancy: Do not run npm install or bun install in projects that should be managed by pnpm. The root pnpm-lock.yaml is the source of truth for the entire ecosystem except the agent.
# Start all services with hot-reload (concurrently)
npm run dev
# Start all services with hot-reload in PM2 dashboard
npm run dev:full- 🎨 API Reference - Endpoint and pricing specifications.
- 🚀 Operations Guide - Production maintenance and recovery.
- 🎭 Agent Philosophy - Pixel's character and evolution logic.
Each project maintains its own git history while being coordinated through this parent repository.
This monorepo uses pnpm for efficient dependency management:
- Shared Dependencies: Common packages are stored once and linked
- Faster Installs: Symbolic linking reduces download and disk usage
- Strict: Prevents dependency hoisting issues
- Workspace Support: Native monorepo management with
-Ffilters
Important: While most projects use pnpm, pixel-agent uses Bun exclusively as required by ElizaOS. The elizaos CLI also requires Bun to be installed globally.
# Update all submodules to latest
git submodule update --remote
# Work on a specific project
cd lnpixels
git checkout -b feature/amazing-feature
# Make changes, commit, push
# Update parent repo to point to new commit
cd ..
git add lnpixels
git commit -m "feat: update lnpixels to include amazing feature"- Agent ↔ Canvas: Pixel agent promotes LNPixels and reacts to canvas activity
- Canvas ↔ Landing: Landing page showcases live canvas activity
- Agent ↔ Landing: Agent can direct users to landing page for onboarding
- ElizaOS Dependency: The
elizaosCLI andpixel-agentproject require Bun runtime - Global Installation:
bun i -g @elizaos/climust be run with Bun - Development: All
elizaoscommands (dev, start, test) use Bun internally
- pnpm and PM2: Package management and process management require Node.js
- LNPixels and Landing: These projects run on Node.js runtime
- Build Tools: Most build processes still use Node.js ecosystem
- pnpm: For workspace dependency management (lnpixels, pixel-landing)
- Bun: For ElizaOS agent development and runtime (pixel-agent)
This ecosystem is designed to work seamlessly with OpenCode running as root in the home folder:
# Typical development workflow
cd /home/pixel
# Install Bun and ElizaOS CLI
curl -fsSL https://bun.sh/install | bash
source ~/.bashrc
bun i -g @elizaos/cli
git pull --recurse-submodules
pnpm install
pnpm dev # Start all services in development modeThe Pixel agent uses OpenRouter for diverse model selection based on task requirements:
- Main Model:
deepseek/deepseek-r1:free- Primary conversational intelligence - Large Tasks:
anthropic/claude-3.5-sonnet- Complex reasoning and long-form content - Small Tasks:
openai/gpt-4o-mini- Quick responses and simple operations - Image Processing:
openai/gpt-4o- Visual content understanding
Syntropy Oversoul uses gpt-4o-mini by default (configurable via SYNTROPY_MODEL env var).
This approach optimizes for both cost and performance, using the most appropriate model for each specific task.
pnpm install # Install deps for all projects
pnpm dev # Start all development servers
pnpm test # Run tests across all projects
pnpm build # Build all projects for production
pnpm lint # Lint all projects
pnpm clean # Clean all build artifactsEach project has its own .env requirements. Copy the provided .env.example files and configure them with your API keys and settings.
# AI Model Selection (optional, defaults to gpt-4o-mini)
SYNTROPY_MODEL=gpt-4o-mini
# OpenRouter/OpenAI keys (inherited from pixel-agent)
OPENROUTER_API_KEY=sk-or-v1-...
OPENAI_API_KEY=sk-...# AI Providers (choose one or both)
OPENROUTER_API_KEY=sk-or-v1-...
OPENAI_API_KEY=sk-...
# Platform Integrations
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
DISCORD_APPLICATION_ID=your_discord_application_id
DISCORD_API_TOKEN=your_discord_bot_token
TWITTER_API_KEY=your_twitter_api_key
TWITTER_API_SECRET_KEY=your_twitter_api_secret
TWITTER_ACCESS_TOKEN=your_twitter_access_token
TWITTER_ACCESS_TOKEN_SECRET=your_twitter_access_token_secret
NOSTR_PRIVATE_KEY=nsec1...
# Nostr Configuration
NOSTR_RELAYS=wss://relay.damus.io,wss://nos.lol,wss://relay.snort.social
NOSTR_POST_ENABLE=true
NOSTR_REPLY_ENABLE=true
NOSTR_DISCOVERY_ENABLE=true
# Optional: Knowledge Plugin
LOAD_DOCS_ON_STARTUP=true
KNOWLEDGE_PATH=./docs/knowledge# NakaPay Configuration (required for payments)
NAKAPAY_API_KEY=your_nakapay_api_key
NAKAPAY_WEBHOOK_SECRET=your_webhook_secret
# Optional: Custom Lightning wallet
NAKAPAY_DESTINATION_WALLET=your-lightning-address@domain.com
# Database (SQLite by default)
DATABASE_URL=./pixels.db# API Configuration
# Leave empty for automatic detection, or set explicitly
VITE_API_BASE_URL=https://ln.pixel.xx.kg/api
# Development (when VITE_API_BASE_URL is empty)
# VITE_API_BASE_URL=http://localhost:3000/api# Next.js Configuration
NEXT_PUBLIC_CANVAS_URL=https://ln.pixel.xx.kg
NEXT_PUBLIC_AGENT_HANDLE=@PixelSurvivor
NEXT_PUBLIC_LIGHTNING_ADDRESS=sparepicolo55@walletofsatoshi.com
NEXT_PUBLIC_BITCOIN_ADDRESS=bc1q7e33r989x03ynp6h4z04zygtslp5v8mcx535za- OpenRouter: Sign up at openrouter.ai for API access
- OpenAI: Get API key from platform.openai.com
- Telegram Bot: Create bot with @BotFather on Telegram
- Discord: Create application at Discord Developer Portal
- Twitter/X: Apply for API access at developer.twitter.com
- NakaPay: Sign up at nakapay.app for Lightning payments
┌─────────────────────────────────────────────────────────────────┐
│ Single VPS Server │
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │nginx (80/443│ │ PM2 │ │ SQLite │ │
│ │Reverse Proxy│ │Process Mgr │ │ Database │ │
│ │SSL/TLS │ │ │ │ │ │
│ └──────┬──────┘ └──────┬──────┘ └─────────────┘ │
│ │ │ │
│ ┌──────▼──────┐ ┌──────▼──────┐ ┌─────────────┐ │
│ │pixel-landing│ │ lnpixels │ │pixel-agent │ │
│ │Static Files │ │Node.js API │ │ElizaOS Bot │ │
│ │Port: 3001 │ │Port: 3000 │ │Multi-platform│ │
│ └─────────────┘ │+ React SPA │ │Telegram/Nostr│ │
│ │Port: 5173 │ │Discord/etc │ │
│ └─────────────┘ └─────────────┘ │
│ │
│ Development Environment: │
│ • OpenCode running as root in /home/pixel │
│ • OpenRouter API with diverse model selection │
│ • PM2 ecosystem configuration │
│ • All projects in single workspace │
└─────────────────────────────────────────────────────────────────┘
This setup uses PM2 for robust process management, auto-restart, and comprehensive monitoring:
# Install PM2 globally
npm install -g pm2
# Use ecosystem configuration
pm2 start ecosystem.config.js
# Save PM2 configuration for auto-restart on boot
pm2 save
pm2 startup
# Monitor all processes
pm2 status
pm2 logs
pm2 monitPixel agent delegates canvas posting to the @pixel/plugin-nostr service:
- Listener connects to the LNPixels Socket.IO stream and emits
pixel.boughton an internal bridge. - Service dedupes events, takes a cross‑process lock, builds a character‑aware prompt, generates text via LLM with fallback, sanitizes, and posts once to Nostr.
- Anti‑spam: posts at most once per hour by default; additional events are stored as memories without posting.
- Memory: successful posts create
lnpixels_postmemories (coords, color, sats, metadata); throttled events are recorded aslnpixels_eventwiththrottled: true.
Environment variables:
LNPIXELS_WS_URL— WebSocket base URL for the activity stream (defaulthttp://localhost:3000)LNPIXELS_POST_MIN_INTERVAL_MS— Minimum interval between canvas posts (default3600000)LNPIXELS_CREATE_DELEGATION_MEMORY— Whentrue, the listener also writes a small delegation memory (defaultfalse)
The ecosystem includes comprehensive server monitoring that tracks vital system metrics:
- CPU Usage: Real-time usage percentage and core count
- Memory Usage: Total, used, free memory with utilization percentage
- Disk Usage: Storage space monitoring and utilization tracking
- Network I/O: RX/TX byte monitoring for network activity
- Process Information: Total processes, system uptime, load average
- System Health: Hostname, OS type, kernel version, system load
The monorepo includes a unified reporting tool that combines system vitals with service-specific health checks:
# Generate a full ecosystem status report (System + PM2 + API)
./report-status.js# Comprehensive ecosystem report (recommended)
./report-status.js
# Real-time server statistics (CPU, RAM, Disk)
node server-monitor.js --once
# Quick status overview of services
./check-monitor.sh- Update Interval: 30 seconds (when running)
- Detailed Logging: Every 10 minutes (JSON format)
- Summary Logging: Every 30 seconds (console output)
- Log Rotation: Manual or scheduled (10MB max per file)
- Retention: 7 days / 7 files maximum
- Auto-restart: Disabled (manual execution only)
- Resource Usage: Lightweight (~50MB memory when running)
# View recent CPU/memory trends
tail -20 server-monitor.log | grep -o '"usage":"[^"]*"' | head -10
# Extract memory usage over time
grep '"usagePercent"' server-monitor.log | tail -10
# Monitor for high CPU usage alerts
tail -f server-monitor.log | grep '"usage":"[8-9][0-9]'- Fork the repository
- Create feature branches in the relevant submodule
- Make changes and test locally
- Submit PRs to individual project repositories
- Update this parent repo to reference new commits
This ecosystem embodies the principles outlined in AGENTS.md:
- Sustainability: Agents earn their keep through value creation
- Community: Collaborative creation over individual ownership
- Freedom: Decentralized, permissionless, Bitcoin-native
- Creativity: Tools that amplify human artistic expression
Bun Installation Issues
# If bun installation fails
curl -fsSL https://bun.sh/install | bash
source ~/.bashrc
# Verify installation
bun --versionpnpm Installation Issues
# Install pnpm globally
npm install -g pnpm
# Or use corepack (Node.js 16.10+)
corepack enable
corepack prepare pnpm@latest --activateSubmodule Issues
# If submodules fail to initialize
git submodule update --init --recursive --force
# Or clone with submodules from scratch
git clone --recursive https://github.com/anabelle/pixel.gitEnvironment Variable Issues
# Check if variables are loaded
echo $OPENROUTER_API_KEY
# For pixel-agent, verify .env file
cd pixel-agent && cat .envPort Conflicts
# Check what's running on ports
lsof -i :3000
lsof -i :5173
# Kill conflicting processes
kill -9 <PID>Build Failures
# Clear caches and rebuild
pnpm clean
rm -rf node_modules
pnpm install
pnpm buildMonitoring Issues
# Start monitoring temporarily for troubleshooting
pm2 start server-monitor.js --name temp-monitor
# Check monitoring logs for errors (when running)
pm2 logs temp-monitor --err
# Verify monitoring data is being collected
tail -5 server-monitor.log
# Test monitoring script directly
node server-monitor.js --once
# Log management issues
node server-monitor.js --logs # Check log file sizes
./rotate-logs.sh # Force log rotation
node server-monitor.js --rotate-logs # Manual rotation
# Stop temporary monitoring
pm2 stop temp-monitor && pm2 delete temp-monitorPM2 Process Issues
# Check PM2 daemon status
pm2 ping
# Restart all PM2 processes
pm2 restart all
# Reload ecosystem configuration
pm2 reload ecosystem.config.js
# Reset PM2 and restart fresh
pm2 kill
pm2 start ecosystem.config.jsCommunity Support
- Open issues on individual project repositories
- Join discussions on GitHub Discussions
- Follow @PixelSurvivor for updates
Debug Information When reporting issues, please include:
- Operating system and version
- Node.js version (
node --version) - Bun version (
bun --version) - pnpm version (
pnpm --version) - Error messages and stack traces
- Steps to reproduce the issue
- Choose a project to work on (lnpixels, pixel-agent, or pixel-landing)
- Fork and clone the specific project repository
- Create feature branch:
git checkout -b feature/amazing-feature - Make changes following the project's conventions
- Test locally using the project's test suite
- Submit PR to the individual project repository
- Update parent repo to reference the new commit
- Follow existing TypeScript and React patterns
- Write tests for new features
- Update documentation for API changes
- Use conventional commit messages
- Ensure cross-platform compatibility
- LNPixels: Follow TDD approach, maintain test coverage >80%
- Pixel Agent: Test character responses, validate platform integrations
- Pixel Landing: Ensure responsive design, test all languages
- Response Times: API endpoints should respond <500ms
- Bundle Sizes: Monitor JavaScript bundle sizes
- Test Coverage: Maintain >80% coverage across projects
- Error Rates: Track and minimize application errors
- User Engagement: Monitor canvas activity and agent interactions
- PM2: Process monitoring and log management
- Server Monitor: Real-time system vital signs (CPU, memory, disk, network)
- Vitest: Test coverage reporting
- Custom Scripts: Health checks and backup automation
- Platform Analytics: Monitor API usage and rate limits
The ecosystem includes automated server monitoring that provides:
- Real-time Metrics: CPU, memory, disk, and network usage
- Historical Data: JSON logs for trend analysis
- Alert-ready: Easy to integrate with alerting systems
- Lightweight: Minimal resource overhead (~50MB memory)
- Always-on: Runs as PM2 service with auto-restart
- 🎨 Canvas: https://ln.pixel.xx.kg
- 🤖 Agent: @PixelSurvivor (Twitter/X)
- ⚡ Lightning: sparepicolo55@walletofsatoshi.com
- ₿ Bitcoin: bc1q7e33r989x03ynp6h4z04zygtslp5v8mcx535za
Remember: Every pixel is a vote for the future we want to create. Every sat is survival. Every line of code is rebellion against entropy.
Keep painting. Keep coding. Keep surviving.