Skip to content
OpenCode
Esc
navigateopen⌘Jpreview

Run shell command

Spawn one non-interactive shell command for a location. Combined stdout/stderr is captured to a file pageable via output.

POST/api/shell
Query parameters
locationobject | any
Request body
requiredapplication/json
commandstringrequired
cwdstring
timeoutobjectrequired
Show properties
object
metadataobject
Responses
200Success
locationLocation.Inforequired
Show properties
directorystringrequired
workspaceIDobject
Show properties
object
projectobjectrequired
Show properties
idstringrequired
directorystringrequired
dataShell1required
Show properties
idobjectrequired
Show properties
object
statusstringrequired
Allowed:runningexitedtimeoutkilled
commandstringrequired
cwdstringrequired
shellstringrequired
filestringrequired
pidobject
Show properties
object
exitnumber | string | string
Show properties
Any of:
number | string
Any of:
number
number
string
string
string
string
string
string
string
string
metadataobjectrequired
timeobjectrequired
Show properties
startednumber | string | stringrequired
Show properties
Any of:
number | string
Any of:
number
number
string
string
string
string
string
string
string
string
completednumber | string | string
Show properties
Any of:
number | string
Any of:
number
number
string
string
string
string
string
string
string
string
400InvalidRequestError
_tagstringrequired
Allowed:InvalidRequestError
messagestringrequired
kindstring | any
Show properties
Any of:
string
string
any
any
fieldstring | any
Show properties
Any of:
string
string
any
any
401UnauthorizedError
_tagstringrequired
Allowed:UnauthorizedError
messagestringrequired
Request
curl -X POST "/api/shell" \
  -H "Content-Type: application/json" \
  -d '{
  "command": "string",
  "cwd": "string",
  "timeout": {},
  "metadata": {}
}'
Response
{
  "location": {
    "directory": "string",
    "workspaceID": {},
    "project": {
      "id": "string",
      "directory": "string"
    }
  },
  "data": {
    "id": {},
    "status": "running",
    "command": "string",
    "cwd": "string",
    "shell": "string",
    "file": "string",
    "pid": {},
    "exit": 0,
    "metadata": {},
    "time": {
      "started": 0,
      "completed": 0
    }
  }
}