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.
Send these requests to your own running server. Values stay in this browser.
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
tui.appendPrompt | Name | In | Type | Required |
|---|---|---|---|
| directory | query | string | optional |
| workspace | query | string | optional |
{ text: string }
boolean { 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
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"
const client = createNikcliClient()
await client.tui.appendPrompt({
...
}) Try it
Open Help
tui.openHelp | Name | In | Type | Required |
|---|---|---|---|
| directory | query | string | optional |
| workspace | query | string | optional |
boolean Example response from schema
false
Generated from the response schema — field values are placeholders, the shape is real.
SDK example
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"
const client = createNikcliClient()
await client.tui.openHelp({
...
}) Try it
Open Sessions
tui.openSessions | Name | In | Type | Required |
|---|---|---|---|
| directory | query | string | optional |
| workspace | query | string | optional |
boolean Example response from schema
false
Generated from the response schema — field values are placeholders, the shape is real.
SDK example
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"
const client = createNikcliClient()
await client.tui.openSessions({
...
}) Try it
Open Themes
tui.openThemes | Name | In | Type | Required |
|---|---|---|---|
| directory | query | string | optional |
| workspace | query | string | optional |
boolean Example response from schema
false
Generated from the response schema — field values are placeholders, the shape is real.
SDK example
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"
const client = createNikcliClient()
await client.tui.openThemes({
...
}) Try it
Open Models
tui.openModels | Name | In | Type | Required |
|---|---|---|---|
| directory | query | string | optional |
| workspace | query | string | optional |
boolean Example response from schema
false
Generated from the response schema — field values are placeholders, the shape is real.
SDK example
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"
const client = createNikcliClient()
await client.tui.openModels({
...
}) Try it
Submit Prompt
tui.submitPrompt | Name | In | Type | Required |
|---|---|---|---|
| directory | query | string | optional |
| workspace | query | string | optional |
boolean Example response from schema
false
Generated from the response schema — field values are placeholders, the shape is real.
SDK example
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"
const client = createNikcliClient()
await client.tui.submitPrompt({
...
}) Try it
Clear Prompt
tui.clearPrompt | Name | In | Type | Required |
|---|---|---|---|
| directory | query | string | optional |
| workspace | query | string | optional |
boolean Example response from schema
false
Generated from the response schema — field values are placeholders, the shape is real.
SDK example
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"
const client = createNikcliClient()
await client.tui.clearPrompt({
...
}) Try it
Execute Command
tui.executeCommand | Name | In | Type | Required |
|---|---|---|---|
| directory | query | string | optional |
| workspace | query | string | optional |
{ command: string }
boolean { 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
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"
const client = createNikcliClient()
await client.tui.executeCommand({
...
}) Try it
Show Toast
tui.showToast | Name | In | Type | Required |
|---|---|---|---|
| directory | query | string | optional |
| workspace | query | string | optional |
{ title?: string message: string variant: | "info" | "success" | "warning" | "error" duration: | number | "Infinity" | "-Infinity" | "NaN" }
boolean { 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
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"
const client = createNikcliClient()
await client.tui.showToast({
...
}) Try it
Publish
tui.publish | Name | In | Type | Required |
|---|---|---|---|
| directory | query | string | optional |
| workspace | query | string | optional |
{ type: string properties: unknown }
boolean { 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
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"
const client = createNikcliClient()
await client.tui.publish({
...
}) Try it
Select Session
tui.selectSession | Name | In | Type | Required |
|---|---|---|---|
| directory | query | string | optional |
| workspace | query | string | optional |
{ sessionID: string }
boolean { data: unknown error: unknown success: false }
{ 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
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"
const client = createNikcliClient()
await client.tui.selectSession({
...
}) Try it
Config
tui.config | Name | In | Type | Required |
|---|---|---|---|
| directory | query | string | optional |
| workspace | query | string | optional |
{ [key: string]: unknown }
Example response from schema
{} Generated from the response schema — field values are placeholders, the shape is real.
SDK example
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"
const client = createNikcliClient()
await client.tui.config({
...
}) Try it
Control
tui.control.next | Name | In | Type | Required |
|---|---|---|---|
| directory | query | string | optional |
| workspace | query | string | optional |
{ 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
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"
const client = createNikcliClient()
await client.tui.control.next({
...
}) Try it
tui.control.response | Name | In | Type | Required |
|---|---|---|---|
| directory | query | string | optional |
| workspace | query | string | optional |
{ path: string body: unknown }
boolean Example response from schema
false
Generated from the response schema — field values are placeholders, the shape is real.
SDK example
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.
{ [key: string]: unknown }
string | unknown[]
{ text: string }
boolean { [key: string]: unknown }
{ path: string body: unknown }
{ path: string body: unknown }
{ command: string }
{ name: "NotFoundError" data: { [key: string]: unknown } }
{ type: string properties: unknown }
{ sessionID: string }
{ title?: string message: string variant: | "info" | "success" | "warning" | "error" duration: | number | "Infinity" | "-Infinity" | "NaN" }
{ data: unknown error: unknown success: false }