Skip to main content
The /preview command manages your local development server. Use it to start, stop, restart, or check the status of your preview environment.

Sub-commands

/preview           # Show current status
/preview start     # Start server
/preview stop      # Stop server
/preview restart   # Restart server
/preview check     # Health check

When to use this

Local testing

Test changes in browser before committing

Iterative development

Restart after major changes

Port conflicts

Resolve port issues

Status checks

Verify server is running

Usage examples

Start server

/preview start
Response:
πŸš€ Starting preview...
   Port: 3000
   Type: Next.js

βœ… Preview ready!
   URL: http://localhost:3000

Status check

/preview
Response:
=== Preview Status ===

🌐 URL: http://localhost:3000
πŸ“ Project: C:/projects/my-app
🏷️ Type: nextjs
πŸ’š Health: OK

Port conflict

If the default port is already in use:
/preview start
Response:
⚠️ Port 3000 is in use.

Options:
1. Start on port 3001
2. Close app on 3000
3. Specify different port

Which one? (default: 1)

How it works

The preview system uses the auto_preview.py script to:
  • Detect framework: Automatically identifies Next.js, React, Vue, etc.
  • Start dev server: Runs the appropriate command (npm run dev, etc.)
  • Monitor health: Checks if server is responding
  • Handle conflicts: Resolves port conflicts automatically

Technical details

Under the hood, the preview system runs:
# Start preview on default or specific port
python .agent/scripts/auto_preview.py start [port]

# Stop running preview
python .agent/scripts/auto_preview.py stop

# Check status
python .agent/scripts/auto_preview.py status

Common scenarios

After making changes

Most changes hot-reload automatically. For major changes (like configuration), restart:
/preview restart

Multiple projects

Each project can run on a different port. Specify the port:
/preview start --port 3001

Stopping preview

Stop the server when you’re done:
/preview stop
  • /create - Creates app and starts preview automatically
  • /enhance - Updates preview after changes
  • /deploy - Deploy after testing locally
  • /status - Check overall project status

Build docs developers (and LLMs) love