27 lines
912 B
Markdown
27 lines
912 B
Markdown
|
|
# Task ID: 145
|
||
|
|
|
||
|
|
**Title:** CLI exec command
|
||
|
|
|
||
|
|
**Status:** pending
|
||
|
|
|
||
|
|
**Dependencies:** 144
|
||
|
|
|
||
|
|
**Priority:** medium
|
||
|
|
|
||
|
|
**Description:** Add mcpctl exec --project NAME AGENT -- command for interactive session access
|
||
|
|
|
||
|
|
**Details:**
|
||
|
|
|
||
|
|
In src/cli/src/commands/ add exec.ts or extend existing:
|
||
|
|
1. Parse: mcpctl exec --project NAME AGENT -- command args
|
||
|
|
2. Find or create AgentSession for agent in project
|
||
|
|
3. If command provided: call POST /sessions/:id/exec, print output
|
||
|
|
4. If no command (or -- bash): attach via WebSocket to /sessions/:id/attach
|
||
|
|
5. Handle terminal resize (SIGWINCH), pass to WebSocket
|
||
|
|
6. Propagate exit code from session
|
||
|
|
7. Per design doc: exec drops human into working environment (cloned repos), NOT the agent's reasoning loop
|
||
|
|
|
||
|
|
**Test Strategy:**
|
||
|
|
|
||
|
|
Manual testing: mcpctl exec --project test myagent -- ls should list repo contents. mcpctl exec --project test myagent -- bash should give interactive shell.
|