AI terminal assistant for any OpenAI-compatible API. Features interactive chat TUI, command generation, code explanation, and streaming responses. Works with Ol
AI terminal assistant for any OpenAI-compatible API. Features interactive chat TUI, command generation, code explanation, and streaming responses. Works with Ol
AI assistant in your terminal — works with any OpenAI-compatible API.
lt ask "How do I find large files in Linux?"
lt cmd "compress all images in this folder"source ~/.config/fish/completions/lt.fish
### Usage
```bash
# Ask questions
lt ask "What is the difference between TCP and UDP?"
# Generate shell commands
lt cmd "find all .go files modified in the last week"
# Pipe content
cat error.log | lt ask "What's wrong here?"LlamaTerm works out of the box with Ollama running on localhost.
For other providers, configure via:
~/.config/lt/config.yaml):base_url: https://api.openai.com/v1
model: gpt-4o-mini
api_key: sk-...export LT_BASE_URL=https://api.openai.com/v1
export LT_MODEL=gpt-4o-mini
export LT_API_KEY=sk-...
# or
export OPENAI_API_KEY=sk-...lt --base-url https://api.openai.com/v1 --model gpt-4o ask "Hello"
…
Global:
--base-url API base URL
--api-key API key
-m, --model Model to use
-r, --role Use a named role (system-prompt preset)
--no-stream Disable streaming output
--max-tokens Maximum tokens to generate
--temperature Temperature for generation
lt cmd:
--dry-run Show command without running
-y, --yes Run without confirmation
lt ask:
--image Attach image file(s) or URL(s) for vision models
--schema Path to a JSON Schema; returns structured JSON output
--rag Augment the prompt with context from a RAG index
--session Reuse and extend a named session for context
lt agent:
-y, --yes Skip confirmation prompts for write/exec tools
--max-iterations Maximum model round-trips (default 12)
--allow-outside Allow file access outside the working directory
--tools Restrict to a comma-separated subset of tools
--mcp Mount tools from configured MCP servers
--rag Expose a rag_search tool backed by an index
--session Reuse and extend a named session for context
lt chat:
--agent Enable tools in chat (agentic REPL)
-R, --resume Resume a previous conversationRoles are named system-prompt presets, selectable on any command with the global -r/--role flag:
lt -r code-reviewer ask "review this diff" **Tool calling requires a function-calling-capable endpoint** (e.g. local Ollama models like `qwen3.5`/`gpt-oss`, or OpenAI). If the endpoint ignores the `tools` parameter, `lt` warns that no tools were called rather than letting the model pretend to act.
### Tools in chat
`lt chat --agent` is an interactive REPL where each turn can use tools, with context preserved across turns:
```bash
lt chat --agent # read/write files, run commands, fetch URLs
lt chat --agent --yes # skip confirmations
lt chat --agent --mcp fs # also mount an MCP server's toolsSessions keep context across separate invocations — pass --session to ask or agent:
lt ask --session debug "what does errno 13 mean?"
lt ask --session debug "and how do I fix it?" # remembers the above
lt session listBind a key (Ctrl-G) that rewrites your current command line into a shell command via AI:
# zsh (~/.zshrc)
source
$ find . -name "*.pdf" -mtime -7@Reference files and URLs directly in a prompt; they're fetched and inlined:
lt ask "summarize @README.md and compare to @https://example.com/spec"Use \@ to write a literal @.
Index local files, directories, or URLs and use them as context:
lt rag add ./docs --index handbook
lt rag search "how do I configure the proxy" --index handbook
lt ask --rag handbook "what's the retry policy?" # inlines top matches
lt agent --rag handbook "update the proxy docs" # exposes a rag_search toolEmbeddings use the model set by embedding_model (default nomic-embed-text). The store is a pure-Go, CGO-free flat file.
Force JSON output matching a schema (with an automatic prompt-based fallback for models lacking native support):
lt ask --schema person.json "Jane Doe is 31 and lives in Berlin"Attach images to a prompt for vision-capable models:
lt ask --image diagram.png "explain this architecture"
lt ask --image https://example.com/chart.png "what trend does this show?"Connect to Model Context Protocol servers and expose their tools to the agent. Configure them in ~/.config/lt/mcp.yaml:
servers:
filesystem:
command: npx
args: ["-y", "@modelcontextprotocol/server-filesystem", "/path"]lt mcp list
lt mcp tools filesystem
lt agent --mcp filesystem "organize my notes directory"# Interactive chat with memory
lt chat
# Analyze a file
lt explain main.go
lt explain config.yaml "What does this configure?"
# Debug errors
lt fix "Error: module not found"
npm run build 2>&1 | lt fix# Download dependencies
make deps
# Build
make build
# Run tests
make test
# Run
./bin/lt ask "Hello"MIT License
No open issues yet, or sync has not completed.