lmcomplete / lmc
lmcomplete is a context-aware shell command helper for turning natural-language requests into shell commands and short explanations. The lmc binary uses your shell, current directory, git state, and recent command history to produce tighter results than a plain prompt.
It is intentionally small and opinionated in v1:
lmc "..."is shorthand forlmc expand "..."expandreturns a shell command onlyexplainreturns a concise plain-text explanationauditprints the prompt bundle without calling the providerinit zshprints the zsh widget scriptstatsshows stored usage stats
Supported Scope
Launch support is intentionally narrow:
- macOS-first
- zsh-first
- OpenRouter-only
- no auto-execution
lmc prints commands. It does not run them for you.
Install
From crates.io after release:
From a local checkout:
Build from source during development:
Quickstart
- Set your OpenRouter API key:
-
Build or install
lmc. -
Add the zsh widget to your shell startup:
- Ask for a command:
- Use the explicit commands when you want to be precise:
Config And Auth
lmc reads an optional TOML config file from the XDG config location. By default that is:
~/.config/lmcomplete/config.toml
If XDG_CONFIG_HOME is set, lmc uses $XDG_CONFIG_HOME/lmcomplete/config.toml instead.
You can also point at a specific file:
The canonical documented example lives in docs/config.example.toml.
Set the API key in the environment or in config:
If you store the key in the config file, keep it private. On Unix, lmc expects the file mode to be 0600.
Examples
Return a command:
Explain a command:
Inspect the prompt bundle without calling the provider:
Show current usage stats:
Initialize the zsh widget:
Safety And Privacy
lmc sends the minimum context needed for a better completion: shell, operating system, cwd-derived project info, git state, and recent shell history when available.
Secret-like values are redacted before prompts are sent. The audit command lets you inspect the final prompt bundle locally without making a provider request.
The tool also keeps a hard line on execution: it suggests commands, it does not run them.
Troubleshooting
If you see missing provider API key, export OPENROUTER_API_KEY or add api_key under [provider] in your config file.
If you see config file ... must have mode 0600, tighten the file permissions on Unix:
If init zsh does nothing after you run it, add eval "$(lmc init zsh)" to ~/.zshrc, then restart zsh or source the file.
If expand or explain returns an error about the provider, check network access, the OpenRouter API key, and the model configuration in your config file.
Changelog
See CHANGELOG.md for release notes. See docs/launch/terminal-demo-plan.md for the launch demo script.