Skip to content

feat: POST /s/:id/execute — headless CLI invocation endpoint#31

Open
jesse23 wants to merge 2 commits into
mainfrom
feat/server-execute-endpoint
Open

feat: POST /s/:id/execute — headless CLI invocation endpoint#31
jesse23 wants to merge 2 commits into
mainfrom
feat/server-execute-endpoint

Conversation

@jesse23

@jesse23 jesse23 commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds POST /s/:id/execute to run a CLI command non-interactively alongside a running session
  • Streams stdout/stderr as ndjson lines ({"stream":"stdout","data":"…"}), closes with {"exit":N}
  • Requires an active PTY (409 if not running), consistent with the publish channel
  • Spawns via child_process.spawn (no PTY) so tools like claude -p stay in pipe mode

Test plan

  • 404 — unknown session
  • 400 — wrong Content-Type
  • 409 — session exists but no PTY
  • 400 — invalid body (cmd not a string)
  • Happy path — verifies 200, Content-Type: application/x-ndjson, stdout line, and exit line

Spec: docs/specs/server.pipe.md · ADR: docs/adrs/026.server.pipe.md

🤖 Generated with Claude Code

jesse23 and others added 2 commits June 11, 2026 15:07
Spawns a command non-interactively alongside a running session and
streams stdout/stderr as ndjson, closing with an exit-code line.
Requires an active PTY (409 otherwise), consistent with publish.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant