|
| 1 | +# Console Carousel - Maintenance Guide |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +The Console Carousel is an interactive component that showcases llms.py features through terminal-style screens. It's designed to be easy to maintain and update. |
| 6 | + |
| 7 | +## File Structure |
| 8 | + |
| 9 | +``` |
| 10 | +app/(home)/ |
| 11 | +├── console-carousel.tsx # Main carousel component |
| 12 | +├── console-screens.ts # Screen data (EDIT THIS to add/remove screens) |
| 13 | +└── page.tsx # Home page (includes the carousel) |
| 14 | +``` |
| 15 | + |
| 16 | +## Adding a New Console Screen |
| 17 | + |
| 18 | +To add a new screen, edit `console-screens.ts` and add a new object to the `consoleScreens` array: |
| 19 | + |
| 20 | +```typescript |
| 21 | +{ |
| 22 | + id: 'unique-id', // Unique identifier |
| 23 | + title: '🎯 Feature Name', // Title with emoji |
| 24 | + description: 'Brief description', // Short description |
| 25 | + command: 'llms --example "query"', // The command to show |
| 26 | + output: `Output text here...` // The terminal output |
| 27 | +} |
| 28 | +``` |
| 29 | + |
| 30 | +### Example: Adding a Docker Command Screen |
| 31 | + |
| 32 | +```typescript |
| 33 | +{ |
| 34 | + id: 'docker-deploy', |
| 35 | + title: '🐳 Docker Deployment', |
| 36 | + description: 'Run llms.py in a Docker container', |
| 37 | + command: 'docker run -p 8000:8000 -e GROQ_API_KEY=$GROQ_API_KEY ghcr.io/servicestack/llms:latest', |
| 38 | + output: `🐳 Pulling image ghcr.io/servicestack/llms:latest... |
| 39 | +✓ Image pulled successfully |
| 40 | +
|
| 41 | +🚀 Starting container... |
| 42 | +✓ Container started |
| 43 | +
|
| 44 | +🌐 Server running at: |
| 45 | + • Web UI: http://localhost:8000 |
| 46 | + • API: http://localhost:8000/v1/chat/completions |
| 47 | +
|
| 48 | +Container ID: a1b2c3d4e5f6` |
| 49 | +} |
| 50 | +``` |
| 51 | + |
| 52 | +## Removing a Console Screen |
| 53 | + |
| 54 | +Simply delete the corresponding object from the `consoleScreens` array in `console-screens.ts`. |
| 55 | + |
| 56 | +## Reordering Screens |
| 57 | + |
| 58 | +The screens appear in the order they're defined in the array. To change the order, simply move the objects around in `console-screens.ts`. |
| 59 | + |
| 60 | +## Tips for Creating Good Console Screens |
| 61 | + |
| 62 | +### 1. Use Realistic Commands |
| 63 | +Base your commands on actual llms.py documentation. Check: |
| 64 | +- `content/docs/features/cli.mdx` |
| 65 | +- `content/docs/multimodal/*.mdx` |
| 66 | +- `content/docs/getting-started/*.mdx` |
| 67 | + |
| 68 | +### 2. Keep Output Concise |
| 69 | +- Aim for 5-15 lines of output |
| 70 | +- Use clear formatting (bullets, sections, emojis) |
| 71 | +- Make it scannable and easy to read |
| 72 | + |
| 73 | +### 3. Add Visual Interest |
| 74 | +- Use emojis in titles (🎯 💬 🖼️ 🎤 📄 🌐 ⚙️) |
| 75 | +- Use symbols in output (✓ ✗ • → ├ └ ┌ ┐) |
| 76 | +- Add color through formatting (the terminal uses syntax highlighting) |
| 77 | + |
| 78 | +### 4. Show Real Value |
| 79 | +Each screen should demonstrate a specific, useful feature: |
| 80 | +- ✅ "Analyze images with vision models" |
| 81 | +- ✅ "Transcribe audio files" |
| 82 | +- ❌ "Run a command" (too vague) |
| 83 | + |
| 84 | +### 5. Format Output Nicely |
| 85 | +```typescript |
| 86 | +output: `Section Header: |
| 87 | +
|
| 88 | +📊 Key Points: |
| 89 | +• Point one |
| 90 | +• Point two |
| 91 | +• Point three |
| 92 | +
|
| 93 | +✅ Results: |
| 94 | + Item 1: Value |
| 95 | + Item 2: Value` |
| 96 | +``` |
| 97 | + |
| 98 | +## Customizing the Carousel |
| 99 | + |
| 100 | +### Change Auto-Play Speed |
| 101 | + |
| 102 | +In `page.tsx`, modify the `autoPlayInterval` prop (in milliseconds): |
| 103 | + |
| 104 | +```typescript |
| 105 | +<ConsoleCarousel |
| 106 | + screens={consoleScreens} |
| 107 | + autoPlayInterval={7000} // 7 seconds instead of default 5 |
| 108 | +/> |
| 109 | +``` |
| 110 | + |
| 111 | +### Disable Auto-Play |
| 112 | + |
| 113 | +Set a very high interval or modify the component to not auto-play by default. |
| 114 | + |
| 115 | +### Styling |
| 116 | + |
| 117 | +The carousel uses Tailwind CSS classes. To customize: |
| 118 | +- Edit `console-carousel.tsx` for component styling |
| 119 | +- Terminal colors are defined in the component (green prompt, slate text, etc.) |
| 120 | + |
| 121 | +## Testing Your Changes |
| 122 | + |
| 123 | +1. Save your changes to `console-screens.ts` |
| 124 | +2. The dev server will hot-reload automatically |
| 125 | +3. Check the home page at `http://localhost:3000` |
| 126 | +4. Navigate through all screens to verify they look good |
| 127 | +5. Test on both light and dark modes |
| 128 | + |
| 129 | +## Common Issues |
| 130 | + |
| 131 | +### Screen Text Too Long |
| 132 | +- Break into multiple lines using `\n` |
| 133 | +- Use template literals with backticks for multi-line strings |
| 134 | +- Keep terminal output under 20 lines for best UX |
| 135 | + |
| 136 | +### Command Doesn't Fit |
| 137 | +- Commands automatically truncate on small screens |
| 138 | +- Keep commands under 80 characters when possible |
| 139 | +- Use line breaks for very long commands |
| 140 | + |
| 141 | +### Emojis Not Showing |
| 142 | +- Ensure you're using standard Unicode emojis |
| 143 | +- Test in multiple browsers |
| 144 | + |
| 145 | +## Best Practices |
| 146 | + |
| 147 | +1. **Keep it current**: Update screens when new features are added |
| 148 | +2. **Show variety**: Mix different types of commands (chat, multimodal, config) |
| 149 | +3. **Be accurate**: Commands should actually work as shown |
| 150 | +4. **Test thoroughly**: Check all screens before deploying |
| 151 | +5. **Get feedback**: Ask users which screens are most helpful |
| 152 | + |
| 153 | +## Quick Reference: Common llms.py Commands |
| 154 | + |
| 155 | +```bash |
| 156 | +# Basic |
| 157 | +llms "question" |
| 158 | +llms -m model "question" |
| 159 | +llms -s "system prompt" "question" |
| 160 | + |
| 161 | +# Multimodal |
| 162 | +llms --image file.png "question" |
| 163 | +llms --audio file.mp3 "question" |
| 164 | +llms --file document.pdf "question" |
| 165 | + |
| 166 | +# Server |
| 167 | +llms --serve 8000 |
| 168 | +llms --serve 8000 --verbose |
| 169 | + |
| 170 | +# Configuration |
| 171 | +llms --init |
| 172 | +llms --list / llms ls |
| 173 | +llms --enable provider |
| 174 | +llms --disable provider |
| 175 | +llms --default model |
| 176 | +llms --check provider |
| 177 | +``` |
| 178 | + |
| 179 | +## Need Help? |
| 180 | + |
| 181 | +- Check the docs: `/content/docs/` |
| 182 | +- See examples in: `content/docs/features/cli.mdx` |
| 183 | +- Review existing screens in: `console-screens.ts` |
| 184 | + |
0 commit comments