Skip to content

Add POST command execution endpoint#2

Open
Jhacarreiro wants to merge 1 commit into
wonderwhy-er:mainfrom
Jhacarreiro:feat/post-command-openapi
Open

Add POST command execution endpoint#2
Jhacarreiro wants to merge 1 commit into
wonderwhy-er:mainfrom
Jhacarreiro:feat/post-command-openapi

Conversation

@Jhacarreiro

Copy link
Copy Markdown

Summary

Adds POST alternatives for command execution while keeping the existing GET endpoint unchanged for backwards compatibility.

New routes:

  • POST /api/runTerminalScript
  • POST /v1/commands/execute

Both accept a JSON body:

{ "command": "pwd" }

Why

The existing GET /api/runTerminalScript?command=... route works, but putting commands in the query string can leak command text into browser, proxy or server logs. GPT Actions and other API clients can send JSON request bodies, so POST is a safer default for new integrations.

Compatibility

  • Existing GET route is unchanged.
  • The POST /api/runTerminalScript endpoint reuses the same handler.
  • /v1/commands/execute is a versioned alias for integrations that prefer a stable v1 route.
  • OpenAPI comments and README examples are updated.
  • Authorization is allowed in CORS preflight headers for bearer-authenticated GPT Actions.

Validation

node --check api/terminal.js
node --check serverModules/apiRoutes.js

@Jhacarreiro

Copy link
Copy Markdown
Author

ClawSweeper status: review started.

I am starting a fresh review of this pull request: Add POST command execution endpoint This is item 1/2 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

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