Basic Usage¶
Perspt offers two interactive modes: the TUI (rich terminal UI) and simple-chat (plain-text streaming).
Launching the TUI¶
# Auto-detect provider from env keys
perspt
# Explicit provider + model
perspt chat --provider-type anthropic --model claude-sonnet-4-20250514
# Override API key
perspt chat --api-key sk-xxx --model gpt-4.1
The TUI provides:
Markdown rendering (code blocks, headers, lists, bold, italic)
Real-time response streaming
Scroll navigation
Status bar (provider, model, streaming indicator)
Keyboard Shortcuts¶
Key |
Action |
|---|---|
Enter |
Send message |
Ctrl+J |
Insert newline in input |
Page Up / Down |
Scroll chat history |
Ctrl+Up / Down |
Scroll by one line |
Home / End |
Jump to top / bottom |
Esc or Ctrl+Q |
Quit |
Ctrl+C |
Cancel current stream |
Chat Commands¶
Command |
Description |
|---|---|
|
Save conversation to a timestamped text file |
|
Exit the application |
Simple CLI Mode¶
For a minimal text interface suitable for piping and logging:
perspt simple-chat
perspt simple-chat --log-file session.txt
Type your message, press Enter. Responses stream to stdout. Type exit or
press Ctrl+D to quit.
Provider Auto-Detection¶
Perspt checks environment variables in this priority order:
Env Variable |
Provider |
Default Model |
|---|---|---|
|
Anthropic |
|
|
OpenAI |
|
|
Gemini |
|
|
Groq |
|
|
Cohere |
|
|
xAI |
|
|
DeepSeek |
|
(none) |
Ollama (local) |
|
See Providers for full provider details.