caglue - Coding Agent Glue
AI coding agent that works with any OpenAI-compatible API
What is caglue?
caglue (Coding Agent Glue) is a terminal-based AI assistant that lives in your command line. You type a task in plain English (or Korean), and it uses AI models — running locally on your machine or in the cloud — to carry it out by reading, writing, and searching your files, running shell commands, browsing the web, managing git repositories, and more.
Think of it as an AI pair programmer that you control through your terminal. It works with any OpenAI-compatible backend, so you are never locked into a single provider.
Why caglue?
- Any API, no lock-in — Works with OpenAI, Ollama, vLLM, LiteLLM, and all OpenAI-compatible backends
- Single static binary — Pure C11, no Python or Node.js runtime needed
- 100+ built-in tools — File editing, bash, web search, git, SVN, MCP, LSP, memory, and more in one CLI
- Privacy-first — Use local LLMs via
--no-tls --api-base http://localhost:11434/v1
✅ Linux x86_64 — ready
✅ Linux aarch64 — ready
🚧 macOS (Apple Silicon / Intel) — experimental (no official binary release)
✅ No Python or Node.js required.
Download
curl \
https://www.minzkn.com/public/release/caglue/caglue-latest-linux-x86_64 \
-o caglue
curl \
https://www.minzkn.com/public/release/caglue/caglue-latest-linux-aarch64 \
-o caglue
chmod +x caglue
Setup
caglue setup
Quick example
Here is what a real caglue session looks like. The user just types what they want in plain English, and caglue takes care of the rest:
$ caglue
You: explain src/parser.c in 3 sentences
You: add a null-check before the memcpy call
You: run the tests to make sure nothing broke
make check and reports pass/failHow it works
- You describe the task — say "explain this function" or "fix the bug in main.c"
- caglue thinks and acts — it reads your code, runs commands, searches the web, edits files, all on its own
- You review the result — every change is shown as a diff; you approve or reject before anything is written
Usage
1. Check your installation
caglue --help
caglue --version
2. Start the interactive REPL
Run caglue with no arguments to start an interactive session.
You are talking to an AI — just describe what you need in plain language.
caglue
Inside the REPL, these slash commands help you control the session:
/help
/compact
/instructions ...
caglue also loads ./.caglue/instructions/*.md automatically
when the directory exists — commit these to your repository so every
contributor (and AI) follows the same conventions. A user-global scope
at ~/.config/caglue/instructions/*.md applies across all
projects as well. Run caglue init to scaffold the
project-local directory.
3. One-shot mode (no REPL)
Pass a task and file directly — caglue runs once and exits. Great for scripting or quick questions.
caglue "explain this function" -f parser.c
caglue "find potential bugs" -f src/
caglue "add error handling to main" -f main.c
4. Use a local LLM
Point caglue at Ollama, vLLM, or any OpenAI-compatible server running on your machine. No data leaves your computer.
caglue --no-tls --api-base http://localhost:11434/v1 \
--model llama3
5. Set environment variables
Skip typing --api-base and --api-key every time
by exporting these in your shell profile:
export OPENAI_API_KEY="sk-..."
export OPENAI_API_BASE="https://api.openai.com/v1"
export OPENAI_MODEL="gpt-4o"
6. Non-interactive / auto-approve
When you trust caglue and want to skip confirmation prompts (e.g. in CI),
pass --yes to auto-approve every action.
caglue --yes "fix all lint warnings" -f src/
Skills & Automation
caglue ships with built-in skills — ready-to-use workflows
that combine instructions and tool access patterns for common tasks.
Use them from the REPL (/skill review) or the CLI:
- init — Scaffold
./.caglue/instructions/for a new project (caglue init) - review — Thorough review of uncommitted or staged changes, ordered by severity
- security-review — Security-focused review of pending changes before committing
- commit — Draft and run a git commit with a well-formed message based on staged changes
Subagents (Multi-Agent Workflows)
Delegate focused subtasks to isolated conversation contexts. Each subagent runs with its own tool whitelist, model override, and depth limit — perfect for parallel security reviews, code analysis, or test generation.
/agent-run review "Check for SQL injection vulnerabilities"
caglue agent list
Agent files live in ~/.config/caglue/agents/*.md and
./.caglue/agents/*.md — define tools_whitelist, model_override,
max_rounds, and custom system prompts per agent.
caglue skill run review
/skill review inside the REPL)What can you do with caglue?
- Understand unfamiliar code — paste a file and ask "explain what this does", or generate a full repository map
- Fix bugs and refactor — describe the problem and let caglue find and edit the right files; review every change before it is applied
- Search and browse — search your codebase with regex, fetch web pages, or ask it to research a topic online
- Manage git workflows — diff, commit, push, merge, stash, blame — all through natural language
- Run tests and builds — type "build and run tests" and see the results without switching contexts
- Work with local LLMs — connect to Ollama / vLLM / llama.cpp on your own machine, no data ever leaves
Tools at a glance
caglue ships with 65+ built-in tools organized by category.
Every tool has an --api-base-agnostic JSON schema, so the AI
knows exactly what parameters each one expects.
📁 File I/O — read_file, write_file, edit_file, multi_edit, apply_context_patch, apply_unified_diff, delete_file, move_file, copy_file, mkdir, chmod, symlink
📂 File Discovery — glob, list_dir, tree, search_files, file_stat, file_hash, resolve_path, file_meta, repository_map
📦 Archive — archive_extract, archive_create, archive_list (zip/tar/tgz/tbz2/txz)
🔍 Diff — diff_files, diff_dirs
🌐 Web — web_fetch, web_save, web_search
⚡ Process — bash, process_list, process_output, process_kill, process_input, process_wait, process_status
🧩 JSON & YAML — json_extract, json_patch, json_validate, yaml_to_json, yaml_validate
✏️ Text & Crypto — text_transform, regex_test, string_hash, random_bytes, uuid_v4
🔨 Build & Test — build, run_tests
🧠 Agent Meta — ask_user_question, notify_user, todo_write, memory_read, memory_write, memory_delete, memory_search, env_read, tools_list, tool_info, session_status, repository_map, attach_file
🗃️ Git — git_diff, git_status, git_log, git_show, git_add, git_commit, git_checkout, git_branch, git_push, git_merge, git_reset, git_stash, git_fetch, git_blame, git_tag, git_remote
🗃️ SVN — svn_diff, svn_status, svn_log, svn_info, svn_add, svn_revert, svn_delete, svn_commit, svn_update, svn_move, svn_cleanup, svn_copy
🔌 MCP — Model Context Protocol server integration (risk-classified tools)
🔍 LSP — clangd-powered code intelligence (lsp_*, auto-registered when clangd is available)
Full tool list: run caglue tools or call the tools_list tool from the REPL.
Update
caglue update
Provider Management
Switch between multiple AI providers (OpenAI, Ollama, Groq, OpenRouter, etc.) with a single command. Each provider has its own API endpoint, credentials, and default model — caglue resolves the active one at request time.
caglue provider list
caglue provider add
caglue provider use ollama
caglue provider test openai --with-chat
Configuration
caglue reads settings from ~/.config/caglue/config (INI-style).
Run caglue setup to create one interactively, or edit the file
directly for fine-grained control.
- api_key — Your API key (also via
OPENAI_API_KEY) - api_base — API endpoint URL
- model — Default model name
- max_tool_rounds — Maximum AI action steps per turn (default 100)
- auto_approve — Skip all permission prompts (use with care)
- permission.<tool> — Fine-grained allow/deny rules per tool or group
- verify_command — Auto-run after every tool round (e.g.
make check) - usage — Token usage tracking from
~/.local/share/caglue/rollout/*.jsonl
Advanced
Permission modes
caglue has three permission modes that control what the AI can do. Switch between them with Shift+Tab inside the REPL:
- PLAN — Read-only. The AI can inspect files and search but never modify anything. Safe for exploration.
- ASK — Every write or destructive action waits for your approval (y/s/a/n). Default.
- BYPASS — Full trust. All actions proceed without confirmation. Use only when you fully trust the model.
Model Context Protocol (MCP)
Extend caglue with external tool servers using the MCP standard. Connect to databases, cloud services, or custom toolchains — caglue automatically classifies each MCP tool by risk level.
caglue --mcp-server "npx @modelcontextprotocol/server-filesystem /tmp"
Browser mirror (webmirror)
Mirror your REPL session to a browser in real time — useful for demos, pairing, or monitoring from another device on the same LAN. The browser shows a full terminal emulator with ANSI color, CJK support, keyboard input, and a scrollback buffer.
⚠️ The browser view is session-equivalent — it can
run commands, edit files, and answer permission gates. HTTP Basic Auth
is the only protection. Set credentials via environment variables
(CAGLUE_WEB_USER, CAGLUE_WEB_PASS,
CAGLUE_WEB_PASS_ENV) or
type them at the interactive prompt.
/start-web
/start-web 8080
/stop-web
/clear-web
While active, the footer shows a web chip with
the current viewer count (real-time across LAN). Use /stop-web to shut it down
when no longer needed.
Static web server (caglue serve)
Run a standalone HTTP/1.1 static-file server with FastCGI proxy support. Useful for local development, demos, or serving documentation.
caglue serve ./public --port 8080 --threads 8
caglue serve --fcgi /=./public@127.0.0.1:9000
caglue serve --cert cert.pem --key key.pem
Token usage tracking
Track token consumption per model and per day from local rollout logs.
No API connection required — caglue reads ~/.local/share/caglue/rollout/*.jsonl.
caglue usage
caglue usage 7
caglue usage 0
Set CAGLUE_PRICE_<MODEL>_IN/_OUT/_CACHED (per-1M tokens) to add a USD column.
Debug mode
When something does not work as expected, run with --verbose (or -v) to see
detailed logs of every HTTP request, tool dispatch, and AI response.
Repeat for more verbosity (-vv).
caglue -v "explain this function" -f parser.c
댓글