How singhsanket143/windows-powershell-cli-agent---gpt---langgraph works
WinCliAgent turns a user's natural-language request into a Windows CLI command, screens it, optionally pauses for confirmation, and—if allowed—runs it and displays the result. The CLI owns interaction and resume behavior; the LangGraph definition owns stage dispatch, while node functions call the LLM, safety screen, and executor. Shared state carries the prompt, command, safety decision, and execution output. The README documents PowerShell compatibility across Windows and Docker; execution details are shown in the executor excerpt.
Main entry points: nodes.py Workflow nodes · main.py CLI entry · graph.py Graph orchestration · state.py Shared state
Components 10
CLI interaction
- CLI entry
main.py
Agent workflow
- Graph orchestration
agent/graph.py - Shared state
agent/state.py - Workflow nodes
agent/nodes.py
Command services
- Command generation
agent/llm.py - Safety screen
agent/safety.py - Command executor
agent/executor.py
Other components
- User
- OpenAI API
- PowerShell or native shell
Connections 12
- User → CLI entry: submits request
README.md - CLI entry → Graph orchestration: invokes and resumes
main.py - CLI entry → Shared state: reads results
main.py - CLI entry → User: shows command and output
main.py - Graph orchestration → Workflow nodes: registers and dispatches
agent/graph.py - Graph orchestration → Shared state: configures graph state
agent/graph.py - Workflow nodes → Shared state: reads and updates
agent/nodes.py - Workflow nodes → Command generation: generates command
agent/nodes.py - Command generation → OpenAI API: requests completion
agent/llm.py - Workflow nodes → Safety screen: screens command
agent/nodes.py - Workflow nodes → Command executor: runs approved command
agent/nodes.py - Command executor → PowerShell or native shell: executes command
agent/executor.py