Complete guide to using all slopdrop frontends: IRC, CLI, TUI, and Web.
Slopdrop now supports 4 different frontends that all use the same TCL backend:
| Frontend | Use Case | Interface | Best For |
|---|---|---|---|
| IRC | Chat-based bot | IRC channels | Team collaboration, public bots |
| CLI | Command-line REPL | Terminal | Quick testing, scripting |
| TUI | Full-screen terminal | Terminal | Development, debugging |
| Web | Browser + API | HTTP/Browser | Remote access, integration |
All frontends share:
- ✅ Same TCL interpreter and state
- ✅ Git-backed state persistence
- ✅ Output pagination
- ✅ History and rollback
- ✅ Admin privileges
# IRC only (default)
cargo build --release
# CLI only
cargo build --release --features frontend-cli
# TUI only
cargo build --release --features frontend-tui
# Web only
cargo build --release --features frontend-web
# All frontends
cargo build --release --features all-frontendsdefault=["frontend-irc"]- IRC onlyfrontend-cli- Adds CLI REPL (requires: rustyline)frontend-tui- Adds TUI (requires: ratatui, crossterm)frontend-web- Adds Web server (requires: axum, tower, tower-http)all-frontends- Enables all frontends
The original IRC bot interface - no changes to existing functionality.
# Run with default config
./slopdrop
# Or specify config
./slopdrop config.toml
# Or explicitly use IRC flag
./slopdrop --ircSee config.toml.example for full IRC configuration.
[server]
hostname = "irc.libera.chat"
port = 6697
use_tls = true
nickname = "slopdrop"
channels = ["#mychannel"]
[security]
eval_timeout_ms = 30000
privileged_users = [
"alice!*@*.example.com",
"bob!~bob@*"
]In channel:
tcl expr {1 + 1} # Evaluate TCL
tcl more # Get more paginated output
tclAdmin history # Show git history (admin only)
tclAdmin rollback <hash> # Rollback to commit (admin only)
Interactive command-line REPL with readline support.
# Start CLI
./slopdrop --cli
# With custom config
./slopdrop config.toml --cli- ✅ Readline - Arrow keys, history navigation
- ✅ History - Persistent command history in
.slopdrop_history - ✅ Tab completion - (future enhancement)
- ✅ Multi-line input - Write complex TCL scripts
- ✅ Special commands - Built-in commands prefixed with
.
slopdrop> expr {1 + 1}
2
slopdrop> set myvar "hello world"
hello world
slopdrop> proc greet {name} { return "Hello, $name!" }
slopdrop> greet Alice
Hello, Alice!
# Special commands
slopdrop> .help # Show help
slopdrop> .history # Show last 10 commits
slopdrop> .history 20 # Show last 20 commits
slopdrop> .rollback abc1234 # Rollback to commit
slopdrop> .more # Get more paginated output
slopdrop> .quit # Exit (or .exit)Ctrl+C- ExitCtrl+D- Exit (EOF)Up/Down- Navigate historyLeft/Right- Move cursorBackspace- Delete character
$ slopdrop --cli
Welcome to Slopdrop TCL Evalbot
Type '.help' for help, '.quit' to exit
slopdrop> # Let's create a factorial function
slopdrop> proc factorial {n} {
> if {$n <= 1} {
> return 1
> } else {
> return [expr {$n * [factorial [expr {$n - 1}]]}]
> }
> }
slopdrop> factorial 5
120
slopdrop> # Check git history
slopdrop> .history 3
Git History:
abc1234 - alice - Evaluated proc factorial...
def5678 - alice - Evaluated set myvar...
ghi9012 - bob - Evaluated proc greet...
slopdrop> .quit
$Full-screen terminal UI with multiple panes.
# Start TUI
./slopdrop --tui
# With custom config
./slopdrop config.toml --tui- ✅ Split-pane layout - Output, input, history, status
- ✅ Keyboard-driven - No mouse required
- ✅ Real-time updates - Git history refreshes automatically
- ✅ Multi-line editor - Write complex scripts
- ✅ Scrollable output - Review previous results
┌─────────────────────────────────────────────────────┐
│ Slopdrop TCL Evalbot [Admin] │
├─────────────────────────────────────────────────────┤
│ Output: │
│ > expr {1 + 1} │
│ 2 │
│ > set myvar "hello" │
│ hello │
│ [Git] abc1234 | 2 files (+3 -1) │
│ │
├─────────────────────────────────────────────────────┤
│ Input: (Ctrl+Enter to eval, Ctrl+C to quit) │
│ _ │
├─────────────────────────────────────────────────────┤
│ Git History: (F3 to refresh) │
│ abc1234 - alice - Evaluated set myvar "hello" │
│ def5678 - bob - Evaluated proc test... │
├─────────────────────────────────────────────────────┤
│ Status: Ready │
└─────────────────────────────────────────────────────┘
| Key | Action |
|---|---|
Ctrl+Enter |
Evaluate current input |
Ctrl+C |
Quit |
Enter |
New line in input |
Backspace |
Delete character |
Left/Right |
Move cursor |
F2 |
Get more paginated output |
F3 |
Refresh git history |
- Start TUI:
./slopdrop --tui - Type TCL code in input area
- Press
Ctrl+Enterto evaluate - See results in output area
- Git history updates automatically in sidebar
- Press
F2if output is truncated - Press
Ctrl+Cto quit
HTTP REST API with embedded web UI.
# Start web server (default: http://127.0.0.1:8080)
./slopdrop --web
# With custom config
./slopdrop config.toml --webThen open http://127.0.0.1:8080 in your browser.
- ✅ REST API - JSON endpoints for external tools
- ✅ Web UI - Single-page app with Monaco-style editor
- ✅ Real-time - Instant feedback
- ✅ Git history - Click to rollback
- ✅ CORS enabled - Use from any origin
- ✅ Responsive - Works on desktop and mobile
Evaluate TCL code.
Request:
{
"code": "expr {1 + 1}",
"user": "alice",
"is_admin": true
}Response:
{
"output": ["2"],
"is_error": false,
"commit_info": null,
"more_available": false
}Get more paginated output.
Response:
{
"output": ["line 11", "line 12", "..."],
"is_error": false,
"commit_info": null,
"more_available": true
}Get git commit history.
Response:
[
{
"commit_id": "abc1234567890...",
"author": "alice",
"message": "Evaluated set myvar...",
"files_changed": 2,
"insertions": 3,
"deletions": 1
},
...
]Rollback to a specific commit.
Request:
{
"commit_hash": "abc1234"
}Response:
{
"success": true,
"message": "Rolled back to commit abc1234. TCL thread restarted with new state."
}Health check.
Response:
{
"success": true,
"message": "OK"
}- Code Editor - Textarea with monospace font
- Syntax Highlighting - CSS-based highlighting
- Output Display - Scrollable output with colors
- Git History - Sidebar with commit list
- Keyboard Shortcuts:
Ctrl+Enter- Evaluate codeCtrl+L- Clear output
- Click to Rollback - Click any commit to rollback
JavaScript:
// Evaluate TCL code
const response = await fetch('http://localhost:8080/api/eval', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
code: 'expr {1 + 1}',
is_admin: true
})
});
const result = await response.json();
console.log(result.output); // ["2"]Python:
import requests
# Evaluate TCL code
response = requests.post('http://localhost:8080/api/eval', json={
'code': 'expr {1 + 1}',
'is_admin': True
})
result = response.json()
print(result['output']) # ['2']curl:
# Evaluate TCL code
curl -X POST http://localhost:8080/api/eval \
-H 'Content-Type: application/json' \
-d '{"code":"expr {1 + 1}","is_admin":true}'
# Get history
curl http://localhost:8080/api/history
# Rollback
curl -X POST http://localhost:8080/api/rollback \
-H 'Content-Type: application/json' \
-d '{"commit_hash":"abc1234"}'You can run multiple frontends simultaneously!
Perfect for team collaboration with web access:
./slopdrop --irc --web- IRC bot runs in channels
- Web UI available for admin/debugging
- Both share same TCL state
- Changes in IRC visible in web UI
Development setup with dual terminals:
# Terminal 1
./slopdrop --cli
# Terminal 2 (same config)
./slopdrop --tuiNote: Only one frontend can run at a time with the same state directory.
./slopdrop --irc --cli --tui --webWarning: CLI and TUI both use stdin, so this combination won't work well. Use IRC + Web or CLI/TUI + Web instead.
All frontends use the same config.toml:
[tcl]
state_path = "./state"
state_repo = "git@github.com:user/repo.git" # Optional remote
ssh_key = "/home/user/.ssh/id_rsa" # Optional SSH key
max_output_lines = 10
[security]
eval_timeout_ms = 30000
privileged_users = [
"alice!*@*.example.com"
]Future enhancement - not yet implemented
[frontends.cli]
prompt = "slopdrop> "
history_file = ".slopdrop_history"
[frontends.tui]
refresh_rate_ms = 100
[frontends.web]
bind_address = "127.0.0.1"
port = 8080
enable_auth = false
auth_token = "secret"Use CLI for quick TCL testing without IRC:
./slopdrop --cli
slopdrop> expr {1 + 1}
2
slopdrop> .quitUse TUI for better visibility during development:
./slopdrop --tui
# See output, input, and git history all at onceStart web server and access from anywhere:
./slopdrop --web
# Access from http://your-server:8080Run IRC bot with web interface for admin tasks:
./slopdrop --irc --web- Users interact via IRC
- Admins use web UI for rollback/history
Automate TCL evaluation from scripts:
#!/bin/bash
# evaluate.sh
curl -X POST http://localhost:8080/api/eval \
-H 'Content-Type: application/json' \
-d "{\"code\":\"$1\",\"is_admin\":true}"Usage: ./evaluate.sh "expr {1 + 1}"
Problem: Error creating readline editor
Solution: Ensure terminal supports readline features. Try a different terminal or use simpler input.
Problem: UI rendering incorrectly
Solution:
- Ensure terminal supports ANSI colors
- Try resizing terminal
- Check TERM environment variable
Problem: "Failed to bind to address"
Solution: Change port in configuration or stop other process using port 8080.
Problem: State directory issues
Solution:
- Check permissions on state directory
- Ensure git is initialized (happens automatically)
- Check disk space
- Use CLI for quick tests - Fast REPL for development
- Use TUI for debugging - Better visibility into state
- Use Web for integration - API access for external tools
- Use IRC for collaboration - Team-based TCL evaluation
- Version control - All state changes are git-committed
- Admin separation - Use privileged_users for sensitive ops
- Pagination - Large outputs are automatically paginated
- Run locally only
- Inherits system user's permissions
- No network exposure
- All users are admins by default
- Binds to 127.0.0.1 by default (local only)
- Change bind_address to allow remote access
- No authentication by default (future enhancement)
- CORS enabled (be careful in production)
- Consider firewall rules for port 8080
- Hostmask-based authentication
- Wildcard support in privileged_users
- PM notifications to admins only
- Rate limiting on API calls
See examples/ directory for:
- CLI scripts
- Web API clients (Python, JavaScript, curl)
- TUI session recordings
- IRC bot configuration examples
Want to add more frontends?
- Implement
Frontendtrait insrc/frontend.rs - Use
TclServicefor TCL evaluation - Add feature flag to
Cargo.toml - Update
main.rsto support new frontend - Add documentation and examples
Potential frontends:
- Discord bot
- Slack bot
- Matrix bridge
- Telegram bot
- gRPC server
- GraphQL API
- Mobile app
For issues, questions, or contributions, see:
- README.md
- MULTI_FRONTEND_DESIGN.md
- GitHub issues