How marreouu/glm-c0deur works
GLM Code is an interactive terminal coding assistant. Its main workflow runs from CLI startup and configuration through the Agent’s brain-model conversation, tool execution or optional coder delegation, then presents results in the terminal and persists conversation history. The repository also includes skills, file watching, and code-analysis capabilities (planning, refactoring, Git intelligence, semantic search, and a knowledge graph), plus update checks. Edges below are limited to calls shown in excerpts, indexed references, or README statements; unsampled subsystem connections are omitted.
Main entry points: cli.py CLI and commands · agent.py Agent orchestration · tui.py Terminal UI · updater.py Updater
Components 24
Interaction
- CLI and commands
glmcode/cli.py - Terminal UI
glmcode/tui.py - Terminal output
glmcode/ui.py
Agent workflow
- Agent orchestration
glmcode/agent.py - Brain model client
glmcode/client.py - Code generation
glmcode/coder.py - File and shell tools
glmcode/tools.py - Custom skills
glmcode/skills.py
Code analysis
- Planning
glmcode/planner.py - Refactoring
glmcode/refactor_engine.py - Git intelligence
glmcode/git_intelligence.py - Semantic search
glmcode/semantic_search.py - Code knowledge graph
glmcode/knowledge_graph.py - Context management
glmcode/context_manager.py
Session and support
- Configuration
glmcode/config.py - Session history
glmcode/session.py - Processes and watches
glmcode/runtime.py - Performance monitor
glmcode/performance_monitor.py - Updater
glmcode/updater.py - Remote release checks
glmcode/remote.py - Version handling
glmcode/version.py
Other components
- User
- Z.ai API
- OpenRouter API
Connections 21
- User → CLI and commands: starts assistant
README.md - CLI and commands → Configuration: loads settings
glmcode/cli.py - CLI and commands → Agent orchestration: creates agent
glmcode/cli.py - CLI and commands → Terminal UI: starts interface
glmcode/cli.py - CLI and commands → Custom skills: loads skills
glmcode/cli.py - Terminal UI → Agent orchestration: submits input
README.md - Terminal UI → Processes and watches: starts file watch
glmcode/tui.py - Agent orchestration → Brain model client: requests response
glmcode/agent.py - Brain model client → Z.ai API: sends model request
README.md - Agent orchestration → File and shell tools: executes tool calls
glmcode/agent.py - Agent orchestration → Code generation: delegates code
glmcode/agent.py - Code generation → OpenRouter API: requests code
README.md - Agent orchestration → Session history: saves history
glmcode/agent.py - Agent orchestration → Terminal output: prints results
glmcode/agent.py - CLI and commands → Session history: loads resumed session
glmcode/cli.py - Planning → File and shell tools: uses tools
glmcode/planner.py - Refactoring → Code knowledge graph: uses graph
glmcode/refactor_engine.py - Semantic search → Code knowledge graph: uses graph
glmcode/semantic_search.py - Updater → Remote release checks: checks releases
glmcode/updater.py - Updater → Version handling: compares versions
glmcode/updater.py - CLI and commands → Updater: handles update commands
glmcode/cli.py