Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
L

llama-terminal-completion

> AI 编程
Open source

AI terminal assistant for any OpenAI-compatible API. Features interactive chat TUI, command generation, code explanation, and streaming responses. Works with Ol

194 stars0 likes0 views
WebsiteGitHub

About

AI terminal assistant for any OpenAI-compatible API. Features interactive chat TUI, command generation, code explanation, and streaming responses. Works with Ol

LlamaTerm

AI assistant in your terminal — works with any OpenAI-compatible API.

bash
lt ask "How do I find large files in Linux?"
lt cmd "compress all images in this folder"

Features

  • Fast — Single Go binary, /usr/local/etc/bash_completion.d/lt

Zsh (add to ~/.zshrc)

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?"

Configuration

LlamaTerm works out of the box with Ollama running on localhost.

For other providers, configure via:

  1. Config file (~/.config/lt/config.yaml):
yaml
base_url: https://api.openai.com/v1
model: gpt-4o-mini
api_key: sk-...
  1. Environment variables:
bash
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-...
  1. CLI flags:
bash
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 conversation

Roles

Roles are named system-prompt presets, selectable on any command with the global -r/--role flag:

bash
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 tools

Sessions

Sessions keep context across separate invocations — pass --session to ask or agent:

bash
lt ask --session debug "what does errno 13 mean?"
lt ask --session debug "and how do I fix it?"   # remembers the above
lt session list

Shell completion widget

Bind a key (Ctrl-G) that rewrites your current command line into a shell command via AI:

bash
# zsh (~/.zshrc)
source 
$ find . -name "*.pdf" -mtime -7

Inline context with @

Reference files and URLs directly in a prompt; they're fetched and inlined:

bash
lt ask "summarize @README.md and compare to @https://example.com/spec"

Use \@ to write a literal @.

Retrieval (RAG)

Index local files, directories, or URLs and use them as context:

bash
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 tool

Embeddings use the model set by embedding_model (default nomic-embed-text). The store is a pure-Go, CGO-free flat file.

Structured output

Force JSON output matching a schema (with an automatic prompt-based fallback for models lacking native support):

bash
lt ask --schema person.json "Jane Doe is 31 and lives in Berlin"

Vision

Attach images to a prompt for vision-capable models:

bash
lt ask --image diagram.png "explain this architecture"
lt ask --image https://example.com/chart.png "what trend does this show?"

MCP servers

Connect to Model Context Protocol servers and expose their tools to the agent. Configure them in ~/.config/lt/mcp.yaml:

yaml
servers:
  filesystem:
    command: npx
    args: ["-y", "@modelcontextprotocol/server-filesystem", "/path"]
bash
lt mcp list
lt mcp tools filesystem
lt agent --mcp filesystem "organize my notes directory"

More Examples

bash
# 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

Development

bash
# Download dependencies
make deps

# Build
make build

# Run tests
make test

# Run
./bin/lt ask "Hello"

License

MIT License

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Goaiinferencellmpython

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
CategoryAI 编程
PricingOpen source

> Related tools

G
GitHub Copilot
GitHub 官方 AI 编程助手,覆盖补全、Chat 与 Agent 模式。
C
Cursor
AI 原生代码编辑器,对话改代码、多文件 Agent 与规则体系是其核心。
S
skills
Skills for Real Engineers. Straight from my .agents directory.