Markdown Rendering in Textual CLI
The --tui CLI mode now supports markdown rendering for agent responses! This makes the output much more readable and visually appealing.
Features
Headers
# Header 1β π· Header 1## Header 2β πΈ Header 2### Header 3β βͺοΈ Header 3
Text Formatting
**bold text**β [bold text]*italic text*β (italic text)__bold text__β [bold text]_italic text_β (italic text)
Code
`inline code`βinline code- Code blocks with syntax highlighting:
def hello(): print("Hello, World!")β π» Code: def hello(): print(βHello, World!β)
Lists
- Item 1β β’ Item 1* Item 2β β’ Item 2+ Item 3β β’ Item 31. Numberedβ 1οΈβ£ Numbered
Other Elements
> Blockquoteβ π¬ Blockquote[Link](https://example.com)β Link (https://example.com)---β ββββββββββββββββββββββββββββββββββββββββββββββββββ
Usage
Toggle Markdown Rendering
- Ctrl+M - Toggle markdown rendering on/off
- Status bar shows π when enabled, π when disabled
- Enabled by default
Example Agent Response
When an agent responds with markdown like:
# Analysis Results
## Summary
The code analysis found **3 issues**:
1. Missing error handling
2. Unused variables
3. Performance bottleneck
### Recommendations
- Add `try/catch` blocks
- Remove unused code
- Optimize the `process_data()` function
> **Note**: These are suggestions, not requirements.
It will be rendered as:
π· Analysis Results
πΈ Summary
The code analysis found [3 issues]:
1οΈβ£ Missing error handling
2οΈβ£ Unused variables
3οΈβ£ Performance bottleneck
βͺοΈ Recommendations
β’ Add `try/catch` blocks
β’ Remove unused code
β’ Optimize the `process_data()` function
π¬ [Note]: These are suggestions, not requirements.
Benefits
β
Better readability - Structured content with visual hierarchy
β
Emoji indicators - Quick visual scanning of content types
β
Terminal-friendly - Works well in any terminal environment
β
Toggle-able - Can be disabled if plain text is preferred
β
Preserves functionality - All CLI features still work normally
Keyboard Shortcuts
| Shortcut | Action |
|---|---|
| Ctrl+M | Toggle markdown rendering |
| Ctrl+T | Toggle theme (dark/light) |
| Ctrl+C | Interrupt agent |
| Ctrl+L | Clear output |
| Ctrl+D | Exit |
The markdown rendering makes agent responses much more pleasant to read while maintaining the powerful Textual CLI functionality!