forked from genewildish/Mainline
Add REPL usage documentation and fix raw mode handling
- Fix raw mode enabling to not duplicate with UI border mode - Add REPL_USAGE.md with comprehensive guide - Add examples/repl_demo_terminal.py example script
This commit is contained in:
54
examples/repl_demo_terminal.py
Normal file
54
examples/repl_demo_terminal.py
Normal file
@@ -0,0 +1,54 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
REPL Demo with Terminal Display - Shows how to use the REPL effect
|
||||
|
||||
Usage:
|
||||
python examples/repl_demo_terminal.py
|
||||
|
||||
This demonstrates the REPL effect with terminal display and interactive input.
|
||||
"""
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).parent.parent))
|
||||
|
||||
from engine.effects.plugins import discover_plugins
|
||||
from engine.pipeline.hybrid_config import PipelineConfig
|
||||
|
||||
|
||||
def main():
|
||||
"""Run REPL demo with terminal display."""
|
||||
print("REPL Demo with Terminal Display")
|
||||
print("=" * 50)
|
||||
|
||||
# Discover plugins
|
||||
discover_plugins()
|
||||
|
||||
# Create a pipeline with REPL effect
|
||||
# Using empty source so there's content to overlay on
|
||||
config = PipelineConfig(
|
||||
source="empty",
|
||||
effects=[{"name": "repl", "intensity": 1.0}],
|
||||
display="terminal",
|
||||
)
|
||||
|
||||
pipeline = config.to_pipeline(viewport_width=80, viewport_height=24)
|
||||
|
||||
# Initialize pipeline
|
||||
if not pipeline.initialize():
|
||||
print("Failed to initialize pipeline")
|
||||
return
|
||||
|
||||
print("\nREPL is now active!")
|
||||
print("Try typing commands:")
|
||||
print(" help - Show available commands")
|
||||
print(" status - Show pipeline status")
|
||||
print(" effects - List all effects")
|
||||
print(" pipeline - Show current pipeline order")
|
||||
print(" clear - Clear output buffer")
|
||||
print("\nPress Ctrl+C to exit")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user