How riyaax07/cmdbuddy works
CmdBuddy is a PowerShell-first assistant that turns developer intent into proposed commands, checks their safety, and runs them only according to approval rules. Its second major workflow captures a terminal error, gathers project context, and proposes an evidence-grounded fix. It also exposes project facts and stores history, snippets, and session state locally. The README documents these capabilities; some internal wiring is supported only by its architecture description or source-index references, so unsampled details are not expanded.
Main entry points: cli.py CLI entry · executor.py Approval and execution · ai_client.py Generation and diagnosis · storage.py Persistence manager
Components 15
User Workflows
- CLI entry
cmdbuddy/cli.py - Error capture
cmdbuddy/error_capture.py
Context and Diagnosis
- Project context
cmdbuddy/context_engine.py - Generation and diagnosis
cmdbuddy/ai_client.py - Response schemas
cmdbuddy/schemas.py
Command Execution
- Safety classifier
cmdbuddy/safety.py - Approval and execution
cmdbuddy/executor.py - Terminal UI
cmdbuddy/ui.py
Local Persistence
- Persistence manager
cmdbuddy/storage.py - Local SQLite
Other components
- PowerShell user
- Gemini API
- PowerShell runtime
- Demo app mount
demo-react-vite-project/src/main.tsx - Demo React app
demo-react-vite-project/src/App.tsx
Connections 19
- PowerShell user → CLI entry: invokes
README.md - CLI entry → Project context: scans project
README.md - CLI entry → Generation and diagnosis: requests generation
cmdbuddy/cli.py - CLI entry → Error capture: captures errors
README.md - CLI entry → Generation and diagnosis: requests diagnosis
cmdbuddy/cli.py - Generation and diagnosis → Project context: uses project facts
cmdbuddy/ai_client.py - Generation and diagnosis → Gemini API: sends API request
cmdbuddy/ai_client.py - Generation and diagnosis → Response schemas: validates responses
cmdbuddy/ai_client.py - CLI entry → Safety classifier: classifies snippets
cmdbuddy/cli.py - CLI entry → Approval and execution: submits commands
README.md - Approval and execution → Safety classifier: classifies command
cmdbuddy/executor.py - Approval and execution → PowerShell runtime: runs command
cmdbuddy/executor.py - Approval and execution → Terminal UI: renders prompts
cmdbuddy/executor.py - Approval and execution → Persistence manager: records execution
cmdbuddy/executor.py - Error capture → Persistence manager: reads session state
cmdbuddy/error_capture.py - Error capture → Terminal UI: prompts user
cmdbuddy/error_capture.py - CLI entry → Persistence manager: manages snippets
cmdbuddy/cli.py - Persistence manager → Local SQLite: reads and writes
README.md - Demo app mount → Demo React app: renders
demo-react-vite-project/src/main.tsx