Skip to content
Theblackcat98Public

About

Terminal chat app in Rust

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

27 Commits

Folders and files

Repository files navigation

Veritas

A terminal-native chat client (TUI) for OpenAI-compatible APIs, written in Rust.

Streams responses token-by-token over SSE against any /v1/chat/completions endpoint — Ollama, llama.cpp server, OpenAI, OpenRouter, vLLM, etc.

TUI mockup

Features

  • Token-by-token SSE streaming with Esc-to-cancel, animated bouncing braille bar for pre-token thinking, and shimmer status line paired with live spinner
  • Full markdown rendering for agent replies — headings, lists, tables, links, blockquotes, and syntax-highlighted code blocks
  • PgUp/PgDn and Ctrl-U/Ctrl-D scrolling with follow-tail
  • Shift+Enter for newlines, /clear to reset the conversation
  • Sessions: auto-saved JSON transcripts, Ctrl-S picker overlay, markdown export
  • Live sidebar telemetry: RAM (sysinfo), AMD GPU VRAM + utilization (kernel DRM sysfs), context-window usage from server-reported tokens when available
  • Slash commands with status-line feedback
  • Live / command popup: fuzzy-finds the closest slash command above the input with a one-line description; ↑/↓ select, Tab completes, Enter runs (D031/D033)
  • Sidebar hide/show via Ctrl-B or /sidebar; auto-hides below 72×20 (D032)
  • Single-file theme (src/theme.rs) for reskinning

Configuration

Everything comes from environment variables:

Variable Default Purpose
OPENAI_BASE_URL http://localhost:11434/v1 API base (Ollama default shown)
OPENAI_API_KEY (empty) Bearer token; omitted from requests when unset
OPENAI_MODEL (unset — auto-detected) Model id; probed from the engine's GET /models when unset (D030)
VERITAS_THEME default Theme preset: default, amber, green, or monochrome

Engine-owned parameters are not client config: requests omit temperature unless you override it at runtime with /temp, and the context window is probed from the engine (D009).

Sidebar telemetry

  • RAM — always shown (sysinfo).
  • VRAM / GPU % — AMD GPUs (amdgpu) via the kernel's DRM sysfs, sampled every 500 ms; widgets are hidden on anything else. Never faked.
  • CTX — used tokens come from the server's usage in stream chunks when it sends them; otherwise a chars/4 estimate is shown. The window total is probed from the engine at startup and on /model (Ollama /api/show or llama.cpp server /props); on engines without model-info endpoints the window shows n/a and no ratio gauge. The gauge shifts green → yellow (≥70%) → red (≥90%) as it fills.

Commands

Type in the input box:

Command Effect
/help Show help overlay (keybindings and commands)
/copy [n] Copy latest code block (or block n) to system clipboard
/sessions, /session Open the session picker (same as Ctrl-S)
/export <file> Write the transcript as markdown
/model <id> Switch model (takes effect on next send; re-probes ctx window); bare /model re-detects from the engine (D030)
/temp <0.0-2.0> Override sampling temperature — bare /temp shows the effective setting
/clear Reset the conversation (next save starts a new session)
/sidebar Toggle sidebar visibility (same as Ctrl-B; auto-hides below 72×20)
/quit Exit the app (same as Ctrl-C / Ctrl-Q)

Sessions

Every exchange is auto-saved as JSON under $XDG_DATA_HOME/veritas/sessions (default ~/.local/share/veritas/sessions), one file per conversation, named sess-<unixsecs>.json. Sessions are titled from the first user message. Press Ctrl-S for the picker — ↑/↓ select, Enter loads, Esc cancels.

Run

export OPENAI_BASE_URL="http://localhost:11434/v1"
cargo run --release

Keys

  • Enter — send · Shift+Enter — newline
  • Esc — stop streaming / dismiss / popup / close overlays · Ctrl-S — session picker · Ctrl-B — toggle sidebar · Ctrl-C / Ctrl-Q — quit
  • Ctrl-Y — copy latest code block to system clipboard (OSC 52 + desktop tool)
  • /help — show help overlay; ? is entered as chat text
  • / at the start of input — live fuzzy command popup: ↑/↓ select · Tab completes the highlighted signature · Enter runs it · Esc dismisses
  • PgUp/PgDn or Ctrl-U/Ctrl-D — scroll

About

Terminal chat app in Rust

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages