Skip to main content

LiteMind CLI

  _     _ _       __  __ _           _    ____ _     ___ 
 | |   (_) |_ ___|  \/  (_)_ __   __| |  / ___| |   |_ _|
 | |   | | __/ _ \ |\/| | | '_ \ / _` | | |   | |    | | 
 | |___| | ||  __/ |  | | | | | | (_| | | |___| |___ | | 
 |_____|_|\__\___|_|  |_|_|_| |_|\__,_|  \____|_____|___|

         Terminal interface for LiteMindUI  ·  Chat · RAG

A fully-featured terminal user interface (TUI) for the LiteMindUI backend, built with Textual.

Chat with local and cloud AI models, and query your own documents — all from your terminal, with no browser required.


Features

Feature Description
💬 Chat Streaming AI chat with full conversation history
📚 RAG Upload documents, query your knowledge base
🔄 Provider switching Switch provider and model mid-session, inline in the toolbar

Requirements

  • Python ≥ 3.11
  • A running LiteMindUI backend at http://localhost:8000 (quick-start here)
  • uv (recommended) or pip

Quick start

1. Start the LiteMindUI backend

The CLI is a frontend — it needs the backend running first.

# Option A — Docker (easiest)
curl -fsSL https://raw.githubusercontent.com/debabratamishra/litemind-ui/main/install.sh | bash

# Option B — from source
git clone https://github.com/debabratamishra/litemind-ui.git
cd litemind-ui
make up

Backend will be available at http://localhost:8000.

2. Install and run litemind-cli

git clone https://github.com/debabratamishra/litemind-cli.git
cd litemind-cli

# Install dependencies
uv sync

# (Optional) configure environment
cp .env.example .env
# edit .env if your backend runs somewhere other than localhost:8000

# Launch the TUI
uv run litemind-cli

Or install globally as a tool:

uv tool install .
litemind-cli

Usage

Usage: litemind-cli [OPTIONS] COMMAND [ARGS]...

  LiteMind CLI — terminal interface for the LiteMindUI backend.

Options:
  -b, --backend TEXT   Backend URL  [env: FASTAPI_URL]
  -m, --model TEXT     Default model name  [env: DEFAULT_MODEL]
  --version            Show version and exit
  --help               Show this message and exit

Commands:
  chat    Open the TUI on the Chat tab
  rag     Open the TUI on the RAG tab
  login   Authenticate with the backend and save your JWT token
  status  Check backend connectivity and print available models

Examples

# Open on the Chat tab (default)
litemind-cli

# Open directly on the RAG tab
litemind-cli rag

# Use a remote backend
litemind-cli --backend http://192.168.1.10:8000

# Override model at launch
litemind-cli --model mistral:7b

# Check if the backend is reachable
litemind-cli status

# Authenticate with the backend (required for chat/rag when auth is enabled)
litemind-cli login

# Login against a specific backend
litemind-cli login --backend http://192.168.1.10:8000

Authentication

The LiteMindUI backend uses GoTrue (Supabase) for authentication. When the backend has auth enabled, the CLI needs a JWT token to access chat and RAG endpoints.

To get a token:

  1. Run litemind-cli login — you'll be prompted for your email and password. The CLI calls the backend's /api/auth/login endpoint and stores the token in memory for the session.
  2. Or set BACKEND_TOKEN in your .env file with a pre-generated JWT.

To generate a token manually (e.g., for CI or scripting):

# Using Python with PyJWT (install: pip install PyJWT)
python3 -c "
import jwt, time
secret = '<GOTRUE_JWT_SECRET from the backend .env>'
now = int(time.time())
payload = {
    'sub': 'cli-user',
    'email': 'you@example.com',
    'user_metadata': {'name': 'CLI User'},
    'iat': now,
    'exp': now + 86400 * 30,   # 30 days
}
print(jwt.encode(payload, secret, algorithm='HS256'))
"

The GOTRUE_JWT_SECRET is found in the backend's .env file. The token must be a valid HS256 JWT with a sub claim.


Inside the TUI

Switching providers

The toolbar at the top of both Chat and RAG tabs has an inline provider selector:

Selection What appears
🦙 Ollama Model dropdown — auto-populated with your local + cloud Ollama models
🌐 OpenRouter Model text field + API key + API base URL
⚡ NIM Model text field + API key + API base URL (pre-filled)

API base URLs are pre-filled automatically when you switch provider. You only need to enter your API key.

OpenRouter model format: provider/model-name
e.g. openai/gpt-4o, anthropic/claude-3.5-sonnet, meta-llama/llama-3.3-70b-instruct

NIM model format: org/model-name
e.g. meta/llama-3.3-70b-instruct, nvidia/llama-3.1-nemotron-70b-instruct

RAG — uploading documents

In the RAG tab, enter one or more file paths (space-separated) in the upload field and click Upload:

/Users/me/docs/report.pdf /Users/me/notes/meeting.md

Supported formats: PDF, DOCX, TXT, MD, CSV, XLSX, PPTX, HTML, ODT, RTF, YAML, JSON

Keyboard shortcuts

Key Action
1 Switch to Chat tab
2 Switch to RAG tab
3 Switch to Settings tab
Enter Send message
Ctrl+L Clear current conversation
Ctrl+N Start a new chat session
Ctrl+R Refresh RAG file list (RAG tab only)
Ctrl+S Save settings (Settings tab only)
Cmd+C Copy last assistant message to clipboard
Cmd+V Paste clipboard into message input
Q Quit

Configuration

All options can be set in a .env file (copy from .env.example) or as environment variables. CLI flags always take precedence.

Variable Default Description
FASTAPI_URL http://localhost:8000 LiteMindUI backend URL
DEFAULT_BACKEND ollama Provider: ollama · openrouter · nim
DEFAULT_MODEL llama3.2 Default model name
API_BASE (empty) Override provider API base URL
API_KEY (empty) Provider API key (for openrouter / nim)
BACKEND_TOKEN (empty) JWT token for backend auth — set via litemind-cli login
CONNECT_TIMEOUT 5 HTTP connect timeout in seconds
READ_TIMEOUT 600 HTTP read/stream timeout in seconds
LOG_LEVEL INFO DEBUG · INFO · WARNING · ERROR

Example .env for OpenRouter with backend auth:

FASTAPI_URL=http://localhost:8000
DEFAULT_BACKEND=openrouter
DEFAULT_MODEL=openai/gpt-4o-mini
API_KEY=sk-or-your-key-here
BACKEND_TOKEN=eyJhbGciOiJIUzI1NiIs...

Project layout

litemind_cli/
  config.py              env / config loading (singleton)
  app.py                 Textual App — MainScreen + SplashScreen
  main.py                Typer CLI entrypoint
  services/
    backend_service.py   health check, model listing
    chat_service.py      streaming chat (SSE parser included)
    rag_service.py       file upload, RAG query streaming
  screens/
    splash_screen.py     ASCII art intro (auto-dismisses after 3 s)
    chat_screen.py       Chat panel (Widget)
    rag_screen.py        RAG panel (Widget)
    settings_screen.py   Settings panel (Widget)
  widgets/
    message_list.py      scrollable chat bubble widget

Dependencies

Package Purpose
textual TUI framework
typer CLI interface
httpx Async HTTP client
python-dotenv .env loading
rich Terminal formatting

  • litemind-ui — FastAPI backend + Streamlit web frontend
  • API contract — HTTP API reference for frontend developers

Metadata

Release files for litemind-cli 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for litemind-cli 0.0.3
File Size Uploaded Provenance
litemind_cli-0.0.3.tar.gz 276.2 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for litemind-cli 0.0.3
File Interpreter ABI Platform
litemind_cli-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 307.8 kB

Release files / litemind_cli-0.0.3.tar.gz

Download URL litemind_cli-0.0.3.tar.gz
Size 276.2 kB
Tags Source
SHA-256 checksum
How to use checksums
897d6129a427feace0d0ec6b12229c2be041f515968d2a168fa0eebdea3128e7
BLAKE2b-256 checksum
How to use checksums
b5de18572c61acae838c4b6b0e62e5b1eab332768921b24bd2b232a23d402882
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.

Transparency log

Release files / litemind_cli-0.0.3-py3-none-any.whl

Download URL litemind_cli-0.0.3-py3-none-any.whl
Size 31.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1dc76fde841f45d7e269240d60e3ef1fd3c9e3575f8f35dd20ebb3b2babb005d
BLAKE2b-256 checksum
How to use checksums
e2b4f2c4a8d2d5577254f55f3fa07466a2b3ec325314f166c01ca015c6eafcdd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.

Transparency log

Security for litemind-cli 0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for litemind_cli-0.0.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page