How zaheerjklabs/sagecli works
SageCLI is a terminal-based autonomous AI engineering agent for ML/DL workspaces. A developer starts an interactive session or supplies a task; the agent gathers repository and dataset context, plans and generates changes with an LLM, then uses workspace tools to execute, test, debug, evaluate, and manage Git checkpoints. Configuration and setup select the provider and execution mode, while project state tracks memory and metrics. The README documents deployment and several slash-command capabilities beyond the sampled source; those are represented at their documented subsystem paths, without implying unverified internal wiring.
Main entry points: agent.py Agent Execution Loop · registry.py Tool Registry · cli.py CLI and REPL · factory.py Provider Factory
Components 23
CLI and Setup
- CLI and REPL
src/sagecli/cli.py - Setup Wizard
src/sagecli/wizard.py - Provider Configuration
src/sagecli/config.py
Agent Workflow
- Agent Execution Loop
src/sagecli/core/agent.py - Workspace Context
src/sagecli/core/context.py - ML Pipeline Planning
src/sagecli/core/orchestrator.py
LLM Providers
- Provider Factory
src/sagecli/llm/factory.py - Gemini Adapter
src/sagecli/llm/gemini_provider.py - OpenAI-Compatible Adapter
src/sagecli/llm/openai_provider.py - Anthropic Adapter
src/sagecli/llm/anthropic_provider.py
Workspace Tools
- Tool Registry
src/sagecli/tools/registry.py - Dataset Inspection
src/sagecli/tools/dataset_ops.py - File Operations
src/sagecli/tools/file_ops.py - Command Execution
src/sagecli/tools/shell_ops.py - Test and Evaluation
src/sagecli/tools/test_eval_ops.py - Git Checkpoints
src/sagecli/tools/git_ops.py
Project Support
- Memory and Metrics
src/sagecli/core/state.py - Usage Tracking
src/sagecli/core/tracker.py - Environment Diagnostics
src/sagecli/core/doctor.py - Safety Checks
src/sagecli/security.py
Other components
- Developer
- Project Workspace
- LLM Services
Connections 32
- Developer → CLI and REPL: starts tasks
- CLI and REPL → Setup Wizard: configures setup
- Setup Wizard → Provider Factory: validates credentials
- Setup Wizard → Provider Configuration: saves settings
- CLI and REPL → Provider Configuration: loads settings
- CLI and REPL → Agent Execution Loop: dispatches task
- Agent Execution Loop → Workspace Context: gathers context
- Agent Execution Loop → ML Pipeline Planning: builds instructions
- Agent Execution Loop → Provider Factory: requests model
- Provider Factory → Gemini Adapter: creates adapter
- Provider Factory → OpenAI-Compatible Adapter: creates adapter
- Provider Factory → Anthropic Adapter: creates adapter
- Gemini Adapter → LLM Services: sends requests
- OpenAI-Compatible Adapter → LLM Services: sends requests
- Anthropic Adapter → LLM Services: sends requests
- Agent Execution Loop → Tool Registry: dispatches tools
- Tool Registry → Dataset Inspection: runs inspection
- Tool Registry → File Operations: runs file actions
- Tool Registry → Command Execution: runs commands
- Tool Registry → Test and Evaluation: runs tests
- Tool Registry → Git Checkpoints: runs Git actions
- Dataset Inspection → Project Workspace: reads datasets
- Workspace Context → Project Workspace: scans workspace
- File Operations → Project Workspace: reads and writes
- Command Execution → Project Workspace: executes in
- Test and Evaluation → Project Workspace: tests project
- Git Checkpoints → Project Workspace: manages changes
- Tool Registry → Safety Checks: checks permissions
- Agent Execution Loop → Memory and Metrics: persists task memory
- Agent Execution Loop → Usage Tracking: tracks usage
- CLI and REPL → Environment Diagnostics: runs diagnostics
- Agent Execution Loop → Project Workspace: delivers changes