A simple CLI utility to chat with LLMs.
Find a file
mitchell f668037582 chore(config): pin @types/bun, tighten TypeScript strictness, and refactor config logic
- Pin `@types/bun` to `^1.3.14` for reproducible builds instead of using `latest`
- Update `tsconfig.json` with stricter type-checking flags and reorganize compiler options
- Refactor `initConfig` to DRY up the model default logic and add a null guard before process exit
2026-06-04 02:24:53 -04:00
src chore(config): pin @types/bun, tighten TypeScript strictness, and refactor config logic 2026-06-04 02:24:53 -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
index.ts build: migrate to commonjs and add node single executable app support 2026-06-04 02:24:53 -04:00
package.json chore(config): pin @types/bun, tighten TypeScript strictness, and refactor config logic 2026-06-04 02:24:53 -04:00
pnpm-lock.yaml chore(config): pin @types/bun, tighten TypeScript strictness, and refactor config logic 2026-06-04 02:24:53 -04:00
pnpm-workspace.yaml build: replace bun install/build with pnpm/esbuild 2026-06-04 02:24:32 -04:00
README.md docs: update README with new flags, examples, and dependencies 2026-05-14 03:08:01 -04:00
sea-config.json build: migrate to commonjs and add node single executable app support 2026-06-04 02:24:53 -04:00
testRender.ts chore(config): pin @types/bun, tighten TypeScript strictness, and refactor config logic 2026-06-04 02:24:53 -04:00
tsconfig.json chore(config): pin @types/bun, tighten TypeScript strictness, and refactor config logic 2026-06-04 02:24:53 -04:00
tts.ts fix: change URL flag from boolean to string type for proper URL passing 2026-05-14 04:34:01 -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 tokens/sec rate 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
--config -c boolean Initialize a new config file (~/.lmc_config.json)
--plain boolean Disable markdown rendering for both stdout and stderr
--plainOut boolean Disable markdown rendering for stdout only
--plainErr boolean Disable markdown rendering for stderr only

Examples:

lmc --config                                 # Initialize/edit config
lmc --new "Introduce yourself."              # New conversation
lmc "What is TypeScript?"                    # Continue most recent chat
lmc -m llama3 "Explain quantum computing"    # Chat with specific model on-the-fly
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)
--url -u boolean Fetch text from a URL instead of stdin

Examples:

echo "Hello, world!" | ttsc
echo "Read this aloud" | ttsc --wait
echo "https://example.com" | ttsc --url

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
@clack/prompts Interactive prompts and spinner
@cliffy/table ASCII table rendering
@mozilla/readability HTML-to-text extraction (ttsc)
chalk Terminal string styling
happy-dom DOM parsing for URLs (ttsc)
shiki Syntax highlighting (kanagawa-wave theme)
terminal-link Clickable terminal hyperlinks