How opencoredev/grok-build2 works
Grok Build is a terminal-based AI coding agent: users start it interactively, run it headlessly, or connect through ACP; the agent can inspect a codebase, edit files, run commands, search the web, and manage longer-running work. The graph preserves these product stages and major runtime capabilities, plus memory, voice, and workflow support. Several implementation links are based only on README descriptions or directory names, so uncertain wiring is omitted rather than inferred; the sampled excerpts do not show the top-level runtime orchestration.
Main entry points: xai-grok-agent/src Agent runtime · main.rs Grok CLI and TUI · xai-grok-shell/src Shell and session · engine.rs Long-running workflows
Components 16
User entry
- Grok CLI and TUI
crates/codegen/xai-grok-pager-bin/src/main.rs
Agent runtime
- Agent runtime
crates/codegen/xai-grok-agent/src - Shell and session
crates/codegen/xai-grok-shell/src - Long-running workflows
crates/codegen/xai-workflow/src/engine.rs
Coding capabilities
- Codebase indexing
crates/codegen/xai-codebase-graph/src/index_manager.rs - Agent tools
- Web search
crates/common/xai-tool-types/src/web_search.rs - Worktree operations
crates/codegen/xai-fast-worktree/src/copy/engine.rs - Voice input
crates/codegen/xai-grok-voice/src/pipeline.rs
Session state
- Conversation state
crates/codegen/xai-chat-state/src - Agent memory
crates/codegen/xai-grok-memory/src/storage.rs
External interfaces
- ACP integration
crates/codegen/xai-acp-lib/src - Authentication
crates/codegen/xai-grok-login/src/storage.rs - OpenAI-compatible endpoint
- Shell environment
Other components
- User or script
Connections 15
- User or script → Grok CLI and TUI: starts session
README.md - User or script → ACP integration: connects editor
README.md - Grok CLI and TUI → Agent runtime: runs agent
- Agent runtime → Codebase indexing: understands codebase
README.md - Agent runtime → Agent tools: uses tools
- Agent runtime → Web search: searches web
README.md - Agent runtime → Shell and session: manages sessions
- Agent runtime → Conversation state: maintains conversation
- Agent runtime → Long-running workflows: manages tasks
README.md - Agent tools → Shell environment: runs commands
README.md - Agent tools → Worktree operations: edits files
- Agent runtime → Agent memory: uses memory
- User or script → Voice input: speaks input
- Agent runtime → OpenAI-compatible endpoint: requests inference
README.md - Agent runtime → Authentication: authenticates