Module 18: Terminal Operations
Execute shell commands on the client through the terminal API.What Youβll Learn
- The four-step terminal lifecycle: create, wait, output, release
- Implementing terminal handlers on the client
- Using the terminal API from the agent side
The Code
Client: Implement terminal handlers
Agent: Use terminal API
Terminal Lifecycle
The agent requests command execution, but the client controls what actually runs. This keeps command execution under the userβs control β the client decides whether to allow, sandbox, or deny terminal requests.
The SDK also provides
context.execute() as a convenience method that combines all four steps.