JavaScript
import { createCognitioClient } from "@cognitio/sdk
const client = createCognitioClient()
await client.session.shell({
...
}){
"info": {
"id": "<string>",
"sessionID": "<string>",
"role": "user",
"time": {
"created": 123
},
"agent": "<string>",
"model": {
"providerID": "<string>",
"modelID": "<string>",
"variant": "<string>"
},
"parentMessageID": "<string>",
"format": {
"type": "text"
},
"summary": {
"diffs": [
{
"file": "<string>",
"patch": "<string>",
"additions": 123,
"deletions": 123,
"status": "added"
}
],
"title": "<string>",
"body": "<string>"
},
"system": "<string>",
"tools": {}
},
"parts": [
{
"id": "<string>",
"sessionID": "<string>",
"messageID": "<string>",
"type": "text",
"text": "<string>",
"synthetic": true,
"ignored": true,
"time": {
"start": 123,
"end": 123
},
"metadata": {}
}
]
}{
"data": "<unknown>",
"errors": [
{}
],
"success": false
}{
"name": "NotFoundError",
"data": {
"message": "<string>"
}
}API Reference
Run shell command
Execute a shell command within the session context and return the AI’s response.
POST
/
session
/
{sessionID}
/
shell
JavaScript
import { createCognitioClient } from "@cognitio/sdk
const client = createCognitioClient()
await client.session.shell({
...
}){
"info": {
"id": "<string>",
"sessionID": "<string>",
"role": "user",
"time": {
"created": 123
},
"agent": "<string>",
"model": {
"providerID": "<string>",
"modelID": "<string>",
"variant": "<string>"
},
"parentMessageID": "<string>",
"format": {
"type": "text"
},
"summary": {
"diffs": [
{
"file": "<string>",
"patch": "<string>",
"additions": 123,
"deletions": 123,
"status": "added"
}
],
"title": "<string>",
"body": "<string>"
},
"system": "<string>",
"tools": {}
},
"parts": [
{
"id": "<string>",
"sessionID": "<string>",
"messageID": "<string>",
"type": "text",
"text": "<string>",
"synthetic": true,
"ignored": true,
"time": {
"start": 123,
"end": 123
},
"metadata": {}
}
]
}{
"data": "<unknown>",
"errors": [
{}
],
"success": false
}{
"name": "NotFoundError",
"data": {
"message": "<string>"
}
}Path Parameters
Pattern:
^ses.*Body
application/json