Python script to detect the width of your text and put a box around it
#!/usr/bin/env python3
import sys
lines = [line.rstrip("\n") for line in sys.stdin]
if not lines:
sys.exit()
width = len(lines[0])
for n, line in enumerate(lines, 1):
if len(line) > width:
sys.exit(f"Line {n} is {len(line)} characters, exceeds box width {width}")
print("+" + "-" * (width + 2) + "+")
for line in lines:
print(f"| {line:<{width}} |")
print("+" + "-" * (width + 2) + "+")
