A simple CLI utility to chat with LLMs.
Find a file
2026-05-05 04:08:00 -04:00
src feat: show reasoning duration after thinking phase 2026-05-05 04:08:00 -04:00
tts fix: pin exact dependency versions in tts/pyproject.toml 2026-04-29 01:00:57 -04:00
.gitignore style: markdown render improvements 2026-04-20 20:21:36 -04:00
.npmrc refactor: replace cli-table3 with @cliffy/table 2026-05-03 22:15:08 -04:00
AGENTS.md refactor: rename project from aicl to lmc 2026-04-28 17:17:21 -04:00
biome.json chore: add biome and fix to pass 2026-04-15 15:20:18 -04:00
bun.lock refactor: replace cli-table3 with @cliffy/table 2026-05-03 22:15:08 -04:00
index.ts fix: improve config loading flow and table column width 2026-05-04 22:02:19 -04:00
package.json refactor: replace cli-table3 with @cliffy/table 2026-05-03 22:15:08 -04:00
README.md docs: README with usage, architecture, and dependency info 2026-04-30 16:20:38 -04:00
testRender.ts style: improve codespan styling and checkbox markers 2026-05-01 21:23:21 -04:00
tsconfig.json init: git and bun 2026-04-15 00:17:57 -04:00
tts.ts feat: wrap TTS output text to terminal width 2026-05-04 00:05:51 -04:00

lmc

A Bun-based CLI tool for LLM chats with terminal native streaming.

Features

  • Streaming markdown rendering — incremental rendering with syntax highlighting
  • Conversation persistence — chat history saved to JSON
  • Model configuration — persist model preferences to JSON
  • Reasoning display — thinking tokens rendered in style on stderr
  • Usage stats — input/output tokens and elapsed time after each response
  • TTY-aware — automatically disables markdown rendering when output is piped
  • Text-to-speechttsc sub-command for streaming TTS via Kokoro model

Requirements

  • Bun v1.3+
  • uv — only for ttsc (text-to-speech)

Installation

bun install
bun build:js
bun link

# For ttsc only
cp -r tts ~/.ttsc

Package to come later

Usage

Chat (lmc)

lmc [options] <prompt...>
Flag Short Type Description
--new -n boolean Start a new conversation (clear history)
--model -m string Set model name for this session
--save -s boolean Save the specified model (--model) as the default
--plain boolean Disable markdown rendering (plain text output)
--plainOut boolean Disable markdown rendering for stdout only
--plainErr boolean Disable markdown rendering for stderr only

Examples:

lmc --new "Introduce yourself."              # New conversation
lmc "What is TypeScript?"                    # Continue most recent chat
lmc -m llama3 "Explain quantum computing"    # Chat with specific model
lmc --model llama3 --save                    # Set default model
lmc --plain "Plain text output"              # No markdown rendering

Text-to-Speech (ttsc)

echo "text" | ttsc [options]
Flag Short Type Description
--wait -w boolean Wait for all processing before exiting (don't auto-play)

Examples:

echo "Hello, world!" | ttsc
echo "Read this aloud" | ttsc --wait

Requires: uv

Wants:

  • mpv for playback
  • sox for wav merging with --wait

Development

bun run dev      # dev run
bun run prod     # run bundled output
bun run check    # biome lint + format + organize imports

Architecture

index.ts                — LMC entry point, orchestration
tts.ts                  — TTSC entry point, orchestration
src/render/index.ts     — Renderer class: streams LLM response, buffers markdown
src/render/markdown.ts  — renderMarkdown(): syntax-highlighted markdown via Bun.markdown + Shiki
src/conversation/       — Conversation persistence
src/config/             — App config persistence
tts/                    — TTS python stub (Kokoro pipeline)
out/                    — Bundled output (index.js, tts.js)

Configuration

  • Conversation history: ~/.lmc_convo.json
  • Model config: ~/.lmc_config.json
  • TTS files: ~/.ttsc/

Dependencies

Package Purpose
ai (Vercel AI SDK) Streaming text/usage
@ai-sdk/openai-compatible OpenAI-compatible API client
shiki Syntax highlighting (kanagawa-wave theme)
cli-table3 ASCII table rendering
chalk Terminal string styling
terminal-link Clickable terminal hyperlinks