mlow/lmcli: General purpose LLM CLI & TUI - Codeberg.org
This website requires JavaScript.
mlow/lmcli
Watch
Star
12
Fork
You've already forked lmcli
Code
Issues
Activity
General purpose LLM CLI & TUI
605 commits
2 branches
12 tags
3.1 MiB
Go
100%
main
Find a file
HTTPS
Download ZIP<br>Download TAR.GZ<br>Download BUNDLE
Open with VS Code
Open with VSCodium
Open with Intellij IDEA
Matt Low
ea7e5fb28b
Release v0.7.0
2026-06-13 06:12:16 +00:00
pkg
fix: Persist *before* requesting completion
2026-06-13 05:51:43 +00:00
screenshots
Update README.md
2026-06-13 03:39:41 +00:00
.gitignore
Update .gitignore
2026-03-28 06:28:57 +00:00
CHANGELOG.md
Release v0.7.0
2026-06-13 06:12:16 +00:00
config.sample.yaml
Changed how title generation is configured
2026-06-13 05:51:43 +00:00
go.mod
Fix go.mod
2026-05-23 16:19:35 +00:00
go.sum
Switched to github.com/ncruces/go-sqlite3
2026-05-10 21:00:30 +00:00
LICENSE
Add MIT LICENSE
2026-04-19 20:00:12 +00:00
main.go
Release v0.7.0
2026-06-13 06:12:16 +00:00
README.md
Changed how title generation is configured
2026-06-13 05:51:43 +00:00
README.md
lmcli - Large Model CLI
lmcli is a general-purpose LLM harness. Use it to code, chat, or build custom<br>agentic workflows!
We have screenshots.
Features
Buttery smooth at 1M+ tokens (sliding-window rendering)
Composable, nesting Agents
Custom tools (exec-only, MCP coming soon)
Sandbox tool execution
OpenAI-compatible and Anthropic-compatible API clients (talk to any local or<br>remote API)
Branching, persisted conversations (thanks, SQLite vi-like keybindings
Export conversations to JSON or HTML
Image support
Installation
go install codeberg.org/mlow/lmcli@latest<br>Dependencies
lmcli works best when the following tools are available:
ripgrep - Grep tool
libchafa - image rendering
uv - Python tool --with dependencies
bubblewrap - Sandbox tools with bwrap
Configuration
See config.sample.yaml for the full example configuration.
Defaults
Defaults which apply to new lmcli chat and lmcli new sessions.
# ~/.config/lmcli/config.yaml<br>defaults:<br>model: deepseek-v4-flash<br>agent: default # default `lmcli chat` agent<br>codeAgent: coder # default `lmcli code` agent - just an alias<br>temperature: 1.0<br>maxTokens: 64000<br>effort: xhigh<br>Agents
An Agent is a system prompt and a set of available tools.
Each lmcli session starts with a root agent, which the user interacts with<br>directly. This agent may then delegate tasks using the SubAgent tool<br>(provided it has been given access), and those sub-agents may delegate<br>further.
Only synchronous sub-agents are supported at the moment; background/persisted<br>sub-agents are planned for a future release.
The contents of AGENT.md, AGENTS.md, and CLAUDE.md will automatically be<br>injected into the system prompt if any of them exist, and the agent has the<br>Read tool.
# ~/.config/lmcli/config.yaml<br>agents:<br>- name: default<br>systemPrompt: You are a helpful assistant.
- name: coding<br>tools:<br>- Bash<br>- Glob<br>- Grep<br>- Read<br>- Write<br>- Edit<br>- Python<br>systemPrompt: |-<br>You are an expert software engineer...<br>(see config.sample.yaml for an effective prompt)
- name: web_summarizer<br>tools:<br>- WebReader<br>systemPrompt:<br>Your task is to summarize the web page.<br>Tools
The following tools are built-in:
Glob - List files based on glob patterns
Grep - ripgrep-powered code search
Read - Read contents of a file
Write - Write contents of a file
Edit - Search and replace contents of a file
Bash - Execute shell commands
Python - uv run --with=-powered python execution
SubAgent - Spawn a sub-agent - see Agents
WebReader - Fetch web content using a Firecrawl endpoint.
Most tools execute out-of-process via the lmcli tool sub-command, which may<br>be wrapped in the Sandbox.
Tools usage is gated a very simple 'read-write-execute' permissions model.<br>Press ctrl-p in the TUI to cycle through read-only, read-write, and read-write-execute<br>unattended permissions, or use lmcli chat|reply|new -p [rwx].
Custom tools exec-based tools are supported.
For example, given the GetWeather example below, the model's call to<br>GetWeather(location="Tokyo, Japan", units="celsius") would be piped the tool<br>as:
{"location": "Tokyo, Japan", "units": "celsius"}<br>The executable's stdout is used as the tool result, which is returned to the<br>model as-is.
Environment variables defined on custom tools get passed set on the environment<br>during execution, hidden from the model.
MCP support is planned.
# ~/.config/lmcli/config.yaml<br>tools:<br># Override a built-in tool<br>- name: WebReader<br>config:<br>backend: https://firecrawl.example.com/v1<br>apiKey: fc-...
# Custom external tool<br>- name: GetWeather<br>description: Get the current weather.<br>path: fetch-weather.sh<br>permission: read<br>parameters:<br>- name: location<br>type: string<br>required: true
- name: Read<br>- name: Write<br>- name: Edit<br>- name: Glob<br>- name: Grep<br>Providers
lmcli supports local and remote OpenAI-compatible and Anthropic-compatible providers.
# ~/.config/lmcli/config.yaml<br>providers:<br>-...