Skip to content

Architecture Overview

Glue is a Dart monorepo. The user-facing binary lives in cli/; the rest of the codebase is split into reusable packages under packages/.

Packages

PackagePathDescription
glue_corepackages/glue_core/Pure data types and contracts: SessionEvent, ContentPart, WorkspaceMapping, RunningCommandHandle
glue_strategiespackages/glue_strategies/Strategy interfaces + built-in impls: CommandExecutor (host/docker), Workspace, RuntimeFactory, web providers
glue_runtimespackages/glue_runtimes/Cloud runtime adapters (daytona/, sprites/, modal/); shared bootstrap + FS transport
glue_harnesspackages/glue_harness/Agent loop, LLM clients, providers, tools, MCP client, config, sessions, doctor
glue_serverpackages/glue_server/ACP server + SessionEvent → ACP update mapping
clicli/Binary entry (bin/glue.dart), App controller, terminal/rendering/UI, slash commands

Modules

ModuleLocationDescription
Appcli/lib/src/app.dart + lib/src/app/Top-level event loop, state, render coordination
Agentglue_harness/lib/src/agent/Core agent loop, tool dispatch, prompt assembly, subagent manager
Catalogglue_harness/lib/src/catalog/Bundled + remote + local model/provider catalog, ModelRef parsing
Commandscli/lib/src/commands/Slash command registry and built-in commands (/model, /runtime, /mcp, …)
Configglue_harness/lib/src/config/~/.glue/config.yaml loading, env-var resolution, permission modes
Coreglue_harness/lib/src/core/Service locator, environment helpers
Credentialsglue_strategies/lib/src/credentials/Credential store (env vars + credentials.json)
Doctorcli/lib/src/doctor/glue doctor health checks; per-runtime sections for host/docker/cloud
Inputcli/lib/src/input/Line editor, file expansion, autocomplete
LLMglue_strategies/lib/src/llm/Wire-protocol clients: Anthropic native, OpenAI HTTP, Ollama NDJSON; LlmFactory
MCPglue_strategies/lib/src/mcp_client/MCP client pool, stdio/HTTP/WebSocket transports, OAuth
Observabilityglue_harness/lib/src/observability/Local JSONL spans + debug controller
Orchestratorglue_harness/lib/src/orchestrator/Permission gate, tool-permission policies
Providersglue_strategies/lib/src/providers/Adapters that map catalog providers to LLM clients
Renderingcli/lib/src/rendering/Markdown rendering, ANSI utilities
Runtimesglue_strategies/ + glue_runtimes/CommandExecutor + Workspace + RuntimeSession; built-in host/docker; cloud adapters daytona/sprites/modal
Sessionglue_harness/lib/src/session/Session manager (lifecycle on top of storage)
Skillsglue_harness/lib/src/skills/Skill discovery (project + global + custom paths), SKILL.md parser
Storageglue_harness/lib/src/storage/Session persistence (meta.json, conversation.jsonl, state.json)
Terminalcli/lib/src/terminal/Raw terminal I/O, key parsing
Toolsglue_harness/lib/src/agent/tools.dart + tools/Built-in tool implementations (bash, files, web, subagents, skills)
UIcli/lib/src/ui/TUI panels, modals, status line
Webglue_strategies/lib/src/web/Web fetch, search, browser automation backends

Entry Point

The entry point is cli/bin/glue.dart. It registers cloud runtime adapters (registerDaytonaRuntime(), registerSpritesRuntime(), registerModalRuntime()) with RuntimeFactory, then delegates to cli/lib/src/app.dart for the interactive TUI or to a CLI subcommand handler.

INFO

For detailed API documentation of each module, see the API Reference.

Released under the MIT License.