Terminal API

Terminal command presets management. The actual terminal runs over WebSocket at /ws/terminal.

All endpoints are prefixed with /api/terminal. Auth required.


Endpoints

MethodPathDescription
GET/terminal/presetsList all presets
POST/terminal/presetsCreate preset
PUT/terminal/presets/:idUpdate preset
DELETE/terminal/presets/:idDelete preset

Request/Response

POST /terminal/presets

{
  "label": "Docker PS",
  "command": "docker ps --format 'table {{.ID}}\t{{.Names}}\t{{.Status}}'",
  "category": "Docker"
}

Response

{
  "id": "preset_1690000000000",
  "label": "Docker PS",
  "command": "docker ps ...",
  "category": "Docker"
}

Categories

System, Docker, Files, Network, Database, Custom


WebSocket Terminal

The terminal itself runs over WebSocket at /ws/terminal. See WebSocket Terminal Protocol for the full message format documentation.

Connection

ws://host/ws/terminal  (with JWT cookie)

Message Types (Client to Server)

TypeDescription
createCreate new pane
create-paneCreate pane with auto-ID
inputSend user input (base64)
resizeResize terminal
close-paneClose pane gracefully
killKill pane

Message Types (Server to Client)

TypeDescription
readyConnection ready
createdPane created
pane-createdPane created (auto-ID)
dataTerminal output (base64)
pane-closedPane closed
exitPTY process exited

Part of NexusPanel API Reference

← Back to Documentation