Skip to content
nikcli
Docs
Documentation

TUI Control

The control channel a running terminal UI exposes: append or submit a prompt, open a dialog, execute a command, show a toast, and the request/response pair behind remote control.

Playground

Send these requests to your own running server. Values stay in this browser.

Not connected
How this works

Start a server with nikcli serve --hostname 127.0.0.1 --port 4096. Requests go straight from this page to that address — the browser allows it because loopback counts as a secure origin, and the server allows it because nikcli-ai.dev is in its CORS allowlist.

To try things without touching your real sessions or config, start the server with NIKCLI_TEST_HOME pointed at a throwaway directory — see the guided tour.

Operations

14 endpoints, generated from the server's own OpenAPI document. Every path also accepts the directory and workspace query parameters that select which instance handles the request.

post /tui/append-prompt tui.appendPrompt
post /tui/open-help tui.openHelp
post /tui/open-sessions tui.openSessions
post /tui/open-themes tui.openThemes
post /tui/open-models tui.openModels
post /tui/submit-prompt tui.submitPrompt
post /tui/clear-prompt tui.clearPrompt
post /tui/execute-command tui.executeCommand
post /tui/show-toast tui.showToast
post /tui/publish tui.publish
post /tui/select-session tui.selectSession
get /tui/config tui.config
get /tui/control/next tui.control.next
post /tui/control/response tui.control.response

Append Prompt

post /tui/append-prompt # tui.appendPrompt
Parameters
Name In Type Required
directory query string optional
workspace query string optional
Request body · required · application/json
{
  text: string
}
Responses
200 TuiBooleanResult application/json
boolean
400 TuiValidationError application/json
{
  data: unknown
  error: unknown
  success: false
}
Example response from schema
false

Generated from the response schema — field values are placeholders, the shape is real.

SDK example
tui.appendPrompt
ts
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"

const client = createNikcliClient()
await client.tui.appendPrompt({
  ...
})
Try it

Open Help

post /tui/open-help # tui.openHelp
Parameters
Name In Type Required
directory query string optional
workspace query string optional
Responses
200 TuiBooleanResult application/json
boolean
Example response from schema
false

Generated from the response schema — field values are placeholders, the shape is real.

SDK example
tui.openHelp
ts
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"

const client = createNikcliClient()
await client.tui.openHelp({
  ...
})
Try it

Open Sessions

post /tui/open-sessions # tui.openSessions
Parameters
Name In Type Required
directory query string optional
workspace query string optional
Responses
200 TuiBooleanResult application/json
boolean
Example response from schema
false

Generated from the response schema — field values are placeholders, the shape is real.

SDK example
tui.openSessions
ts
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"

const client = createNikcliClient()
await client.tui.openSessions({
  ...
})
Try it

Open Themes

post /tui/open-themes # tui.openThemes
Parameters
Name In Type Required
directory query string optional
workspace query string optional
Responses
200 TuiBooleanResult application/json
boolean
Example response from schema
false

Generated from the response schema — field values are placeholders, the shape is real.

SDK example
tui.openThemes
ts
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"

const client = createNikcliClient()
await client.tui.openThemes({
  ...
})
Try it

Open Models

post /tui/open-models # tui.openModels
Parameters
Name In Type Required
directory query string optional
workspace query string optional
Responses
200 TuiBooleanResult application/json
boolean
Example response from schema
false

Generated from the response schema — field values are placeholders, the shape is real.

SDK example
tui.openModels
ts
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"

const client = createNikcliClient()
await client.tui.openModels({
  ...
})
Try it

Submit Prompt

post /tui/submit-prompt # tui.submitPrompt
Parameters
Name In Type Required
directory query string optional
workspace query string optional
Responses
200 TuiBooleanResult application/json
boolean
Example response from schema
false

Generated from the response schema — field values are placeholders, the shape is real.

SDK example
tui.submitPrompt
ts
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"

const client = createNikcliClient()
await client.tui.submitPrompt({
  ...
})
Try it

Clear Prompt

post /tui/clear-prompt # tui.clearPrompt
Parameters
Name In Type Required
directory query string optional
workspace query string optional
Responses
200 TuiBooleanResult application/json
boolean
Example response from schema
false

Generated from the response schema — field values are placeholders, the shape is real.

SDK example
tui.clearPrompt
ts
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"

const client = createNikcliClient()
await client.tui.clearPrompt({
  ...
})
Try it

Execute Command

post /tui/execute-command # tui.executeCommand
Parameters
Name In Type Required
directory query string optional
workspace query string optional
Request body · required · application/json
{
  command: string
}
Responses
200 TuiBooleanResult application/json
boolean
400 TuiValidationError application/json
{
  data: unknown
  error: unknown
  success: false
}
Example response from schema
false

Generated from the response schema — field values are placeholders, the shape is real.

SDK example
tui.executeCommand
ts
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"

const client = createNikcliClient()
await client.tui.executeCommand({
  ...
})
Try it

Show Toast

post /tui/show-toast # tui.showToast
Parameters
Name In Type Required
directory query string optional
workspace query string optional
Request body · required · application/json
{
  title?: string
  message: string
  variant: 
    | "info"
    | "success"
    | "warning"
    | "error"
  duration: 
    | number
    | "Infinity" | "-Infinity" | "NaN"
}
Responses
200 TuiBooleanResult application/json
boolean
400 TuiValidationError application/json
{
  data: unknown
  error: unknown
  success: false
}
Example response from schema
false

Generated from the response schema — field values are placeholders, the shape is real.

SDK example
tui.showToast
ts
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"

const client = createNikcliClient()
await client.tui.showToast({
  ...
})
Try it

Publish

post /tui/publish # tui.publish
Parameters
Name In Type Required
directory query string optional
workspace query string optional
Request body · required · application/json
{
  type: string
  properties: unknown
}
Responses
200 TuiBooleanResult application/json
boolean
400 TuiValidationError application/json
{
  data: unknown
  error: unknown
  success: false
}
Example response from schema
false

Generated from the response schema — field values are placeholders, the shape is real.

SDK example
tui.publish
ts
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"

const client = createNikcliClient()
await client.tui.publish({
  ...
})
Try it

Select Session

post /tui/select-session # tui.selectSession
Parameters
Name In Type Required
directory query string optional
workspace query string optional
Request body · required · application/json
{
  sessionID: string
}
Responses
200 TuiBooleanResult application/json
boolean
400 TuiValidationError application/json
{
  data: unknown
  error: unknown
  success: false
}
404 TuiNotFoundError application/json
{
  name: "NotFoundError"
  data: { [key: string]: unknown }
}
Example response from schema
false

Generated from the response schema — field values are placeholders, the shape is real.

SDK example
tui.selectSession
ts
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"

const client = createNikcliClient()
await client.tui.selectSession({
  ...
})
Try it

Config

get /tui/config # tui.config
Parameters
Name In Type Required
directory query string optional
workspace query string optional
Responses
200 TuiConfig application/json
{
  [key: string]: unknown
}
Example response from schema
{}

Generated from the response schema — field values are placeholders, the shape is real.

SDK example
tui.config
ts
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"

const client = createNikcliClient()
await client.tui.config({
  ...
})
Try it

Control

get /tui/control/next # tui.control.next
Parameters
Name In Type Required
directory query string optional
workspace query string optional
Responses
200 TuiControlRequest application/json
{
  path: string
  body: unknown
}
Example response from schema
{
  "path": "",
  "body": null
}

Generated from the response schema — field values are placeholders, the shape is real.

SDK example
tui.control.next
ts
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"

const client = createNikcliClient()
await client.tui.control.next({
  ...
})
Try it
post /tui/control/response # tui.control.response
Parameters
Name In Type Required
directory query string optional
workspace query string optional
Request body · required · application/json
{
  path: string
  body: unknown
}
Responses
200 TuiBooleanResult application/json
boolean
Example response from schema
false

Generated from the response schema — field values are placeholders, the shape is real.

SDK example
tui.control.response
ts
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"

const client = createNikcliClient()
await client.tui.control.response({
  ...
})
Try it

Schemas

The 13 schemas reachable from these endpoints. Each is shown one level deep; nested types link to their own entry below. Names ending in _2, _3 and so on are the OpenAPI emitter disambiguating same-named schemas declared by different HttpApi groups — they are distinct shapes, not duplicates.

PluginOptionsConfig
{ [key: string]: unknown }
PluginSpecConfig
string | unknown[]
TuiAppendPromptInput
{
  text: string
}
TuiBooleanResult
boolean
TuiConfig
{
  [key: string]: unknown
}
TuiControlRequest
{
  path: string
  body: unknown
}
TuiControlResponseInput
{
  path: string
  body: unknown
}
TuiExecuteCommandInput
{
  command: string
}
TuiNotFoundError
{
  name: "NotFoundError"
  data: { [key: string]: unknown }
}
TuiPublishInput
{
  type: string
  properties: unknown
}
TuiSelectSessionInput
{
  sessionID: string
}
TuiShowToastInput
{
  title?: string
  message: string
  variant: 
    | "info"
    | "success"
    | "warning"
    | "error"
  duration: 
    | number
    | "Infinity" | "-Infinity" | "NaN"
}
TuiValidationError
{
  data: unknown
  error: unknown
  success: false
}