🖥️ BambiSleep Chat Terminal Interface
An HTOP-style terminal interface for BambiSleep Chat with real-time logging and interactive commands.
Features
- Real-time Log Display: See all server logs in a beautiful terminal interface
- Interactive Commands: Execute git, npm, and server commands without closing the terminal
- HTOP-style Layout: Familiar interface inspired by system monitoring tools
- Keyboard Shortcuts: Quick access to common operations
- Auto-scroll Logs: Always stay up-to-date with the latest activity
Quick Start
Start with Terminal Interface
npm run terminal
Start with Development Mode + Terminal
npm run terminal:dev
Start Boot Script with Terminal
npm run boot:terminal
Keyboard Shortcuts
Key | Action |
---|---|
g |
Git pull latest changes |
n |
NPM install dependencies |
r |
Restart server |
c |
Clear logs |
s |
Show system status |
? |
Show help |
q |
Quit interface |
↑/↓ |
Scroll logs |
PgUp/PgDn |
Page scroll |
Interface Layout
┌─────────────────────────────────────────────────────────────────┐
│ 📊 Real-time Logs │
│ │
│ [12:34:56] INFO: Server started successfully │
│ [12:34:57] SUCCESS: Database connected │
│ [12:34:58] INFO: Socket.io initialized │
│ │
│ (80% height) │
└─────────────────────────────────────────────────────────────────┤
│ 🚀 Status: Ready │ ⌨️ Commands: │
│ BambiSleep Chat running │ g - Git pull │
│ │ n - NPM install │
│ (10% height) │ r - Restart │
│ │ c - Clear logs │
│ │ ? - Help │
└──────────────────────────────────────┴───────────────────────────┘
Environment Variables
TERMINAL_UI=true
- Enable terminal interface mode- Add to your
.env
file or set when running commands
Integration with Existing Code
The terminal interface integrates seamlessly with:
- Logger: All log messages appear in the terminal interface
- AIGF Logger: AIGF interactions are displayed in real-time
- X-Hypno-Boot: Git pull, npm install, and restart commands reuse existing logic
Advanced Usage
Custom Terminal Interface
import TerminalInterface from './src/utils/terminalInterface.js';
const terminal = new TerminalInterface();
terminal.init();
// Add custom log
terminal.addLog('info', 'Custom message');
// Execute custom command
terminal.executeCommand('ls -la', 'List files');
Hook into Logger
import { enableTerminalInterface } from './src/utils/logger.js';
// Enable terminal interface programmatically
enableTerminalInterface();
Troubleshooting
Terminal Interface Not Starting
- Check that
blessed
is installed:npm install blessed
- Ensure terminal supports ANSI colors
- Try running with
TERM=xterm-256color
Commands Not Working
- Verify you're in the correct directory
- Check permissions for git operations
- Ensure npm is accessible in PATH
Logs Not Appearing
- Make sure logger is properly initialized
- Check console output for errors
- Try restarting the terminal interface
Contributing
The terminal interface is designed to be easily extensible:
- Add new commands in
setupKeyBindings()
- Extend log formatting in
addLog()
- Add new UI components using blessed widgets
Dependencies
blessed
- Terminal UI librarychalk
- Color formatting (already included)- Existing BambiSleep Chat dependencies
Part of the BambiSleep Chat project - enhancing the development and monitoring experience.