Skip to main content
The tui command requires the tui feature to be enabled during installation.
The terminal user interface (TUI) provides an interactive dashboard for managing services and viewing logs in real-time.

Usage

apicentric tui
No additional flags are required. The TUI initializes the simulator automatically.

Interface overview

The TUI is divided into three main panels:

1. Services panel (left)

  • Lists all loaded services
  • Shows service status (running/stopped)
  • Displays port and base path information
  • Navigate with / arrow keys

2. Logs panel (center)

  • Real-time request log streaming
  • Shows method, path, status code, and timestamp
  • Automatic scrolling for new entries
  • Search and filter capabilities

3. Actions panel (right)

  • Quick actions for selected service
  • Performance metrics
  • Keyboard shortcuts reference
  • Service control buttons
  • Application title and version
  • Current mode indicator
  • System status

Keyboard shortcuts

Tab
key
Switch between panels
↑ / ↓
key
Navigate within lists
Page Up / Page Down
key
Scroll through logs

Actions

s
key
Start selected service
x
key
Stop selected service
r
key
Restart selected service
l
key
Clear logs

Views

d
key
Toggle dashboard view
e
key
Open endpoint explorer
c
key
Open configuration view
m
key
Open marketplace dialog

Filtering

f
key
Open filter dialog for logs
/
key
Open search dialog

System

?
key
Show help dialog
q or Ctrl+C
key
Quit the TUI

Features

Real-time monitoring

The TUI updates service status and logs every second:
  • Service status: Automatically reflects starts, stops, and crashes
  • Request logs: New requests appear instantly in the logs panel
  • Metrics: Request counts and performance stats update live

Dashboard view

Press d to toggle the dashboard view, which shows:
  • Total requests over time
  • Request rate sparklines
  • Error rate trends
  • Service health indicators
  • Response time distributions

Endpoint explorer

Press e to explore and test endpoints:
  1. Select an endpoint from the list
  2. View request/response schemas
  3. Send test requests
  4. See results inline

Log filtering

Press f to open the filter dialog:
  • Filter by HTTP method (GET, POST, etc.)
  • Filter by status code range
  • Filter by path pattern
  • Combine multiple filters
Press / to search through logs:
  • Search request paths
  • Search response bodies
  • Navigate between matches with n (next) and N (previous)

Marketplace

Press m to browse and install service templates:
  1. Browse available templates
  2. Preview template contents
  3. Install directly into your services directory

Performance metrics

The actions panel displays performance information:
  • Average input latency: Response time for keyboard input
  • Max input latency: Worst-case input lag
  • Render time: UI refresh duration
  • Loop time: Main event loop duration
The TUI is optimized to maintain sub-100ms input latency even with hundreds of log entries.

Configuration view

Press c to view and edit configuration:
  • Service definitions
  • Port assignments
  • Scenario settings
  • Behavior rules

Graceful shutdown

When you quit the TUI:
  1. Terminal is restored to normal mode
  2. Cursor visibility is restored
  3. Alternate screen buffer is released
  4. No artifacts left in your terminal

Troubleshooting

Terminal not supported

❌ Failed to initialize terminal: ...
💡 Ensure your terminal supports alternate screen mode
Solution: Use a modern terminal emulator like iTerm2, Alacritty, or Windows Terminal.

Raw mode error

❌ Failed to enable raw mode: ...
💡 Try running in a different terminal or check terminal permissions
Solution: Check that your terminal is not in a restricted environment (like some CI systems).

Terminal too small

❌ Render error: ...
💡 Terminal size may be too small. Try resizing your terminal window
Solution: Resize your terminal to at least 80x24 characters.

Cursor still hidden after exit

Solution: Run tput cnorm to manually restore cursor visibility.

Best practices

Monitor during development

Keep the TUI open while developing to see API requests in real-time

Use filters

Filter logs by status code to quickly find errors

Test with endpoint explorer

Verify endpoint behavior without leaving the terminal

Check metrics

Monitor performance metrics to ensure responsiveness

Comparison with other commands

FeatureTUIsimulator startsimulator monitor
Real-time logs
Interactive
Service control
Filtering
Dashboard
Background mode

Next steps

Build docs developers (and LLMs) love