Open Termkit exposes a RESTful JSON API and a real-time WebSocket protocol.
Default address: http://127.0.0.1:8765
All API responses include X-Content-Type-Options: nosniff and Content-Type: application/json.
Health check endpoint.
{
"ok": true,
"app": "open-termkit",
"dbPath": "/home/user/.open-termkit/open-termkit.db",
"version": 1
}Returns runtime diagnostics, host information, database size, memory usage, and tool detection.
{
"os": "darwin",
"arch": "arm64",
"goVersion": "go1.22.4",
"numCPU": 8,
"numGoroutine": 12,
"uptimeSeconds": 340,
"memory": {
"allocMB": 18.2,
"totalAllocMB": 42.5,
"sysMB": 32.1,
"numGC": 4
},
"database": {
"exists": true,
"sizeBytes": 32768
},
"terminalProfilesCount": 3,
"sshProfilesCount": 2,
"tools": [...]
}Returns all terminal profiles.
Creates a terminal profile. Body:
{
"name": "Zsh Custom",
"shellCommand": "/bin/zsh",
"args": ["-l"],
"env": { "EDITOR": "nvim" },
"cwd": "/path/to/project",
"theme": "tokyo-night",
"fontFamily": "JetBrains Mono, monospace",
"fontSize": 14,
"isDefault": false
}Returns profile by ID.
Updates existing profile by ID.
Deletes profile by ID.
Returns all SSH profiles.
Creates an SSH profile.
Updates an SSH profile.
Deletes an SSH profile.
Tests TCP connectivity and measures round-trip latency to a host. Response:
{
"reachable": true,
"host": "example.com",
"port": 22,
"latencyMs": 18
}Generates a new Ed25519 key pair. Request:
{
"name": "id_ed25519_prod",
"comment": "user@example.com"
}Response:
{
"path": "/home/user/.ssh/open-termkit/id_ed25519_prod",
"publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5... user@example.com"
}Writes managed SSH config snippet to ~/.ssh/open-termkit/config.
Request:
{
"ensureInclude": true
}Scans and returns all tools with detection status.
Installs tool using detected package manager. Request:
{
"commandIndex": 0
}Initiates an interactive PTY session. Query parameters:
profile_id: ID of the terminal profile (defaults to default profile if omitted).cols: Terminal columns (default: 80).rows: Terminal rows (default: 24).
- Keystroke input:
{ "type": "input", "data": "string" } - Resize:
{ "type": "resize", "cols": 120, "rows": 36 } - Heartbeat ping:
{ "type": "ping", "data": "timestamp" }
- Output:
{ "type": "output", "data": "raw text or escape sequences" } - Pong:
{ "type": "pong", "data": "timestamp" } - Exit:
{ "type": "exit", "code": 0 } - Error:
{ "type": "error", "error": "message" }