# 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

Base URL  Directory _optional_  Bearer token _optional_ 

 

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](/docs/guides/api-tour).

## Operations

14 endpoints, generated from the server's own [OpenAPI document](/docs/api). Every path also accepts the `directory` and `workspace` query parameters that select which instance handles the request.

<table class="api-index not-prose"><tbody><tr><td class="api-index-method"><span class="api-method api-method-post">post</span></td><td><a href="#op-post-tui-append-prompt">/tui/append-prompt</a></td><td class="api-index-id">tui.appendPrompt</td></tr><tr><td class="api-index-method"><span class="api-method api-method-post">post</span></td><td><a href="#op-post-tui-open-help">/tui/open-help</a></td><td class="api-index-id">tui.openHelp</td></tr><tr><td class="api-index-method"><span class="api-method api-method-post">post</span></td><td><a href="#op-post-tui-open-sessions">/tui/open-sessions</a></td><td class="api-index-id">tui.openSessions</td></tr><tr><td class="api-index-method"><span class="api-method api-method-post">post</span></td><td><a href="#op-post-tui-open-themes">/tui/open-themes</a></td><td class="api-index-id">tui.openThemes</td></tr><tr><td class="api-index-method"><span class="api-method api-method-post">post</span></td><td><a href="#op-post-tui-open-models">/tui/open-models</a></td><td class="api-index-id">tui.openModels</td></tr><tr><td class="api-index-method"><span class="api-method api-method-post">post</span></td><td><a href="#op-post-tui-submit-prompt">/tui/submit-prompt</a></td><td class="api-index-id">tui.submitPrompt</td></tr><tr><td class="api-index-method"><span class="api-method api-method-post">post</span></td><td><a href="#op-post-tui-clear-prompt">/tui/clear-prompt</a></td><td class="api-index-id">tui.clearPrompt</td></tr><tr><td class="api-index-method"><span class="api-method api-method-post">post</span></td><td><a href="#op-post-tui-execute-command">/tui/execute-command</a></td><td class="api-index-id">tui.executeCommand</td></tr><tr><td class="api-index-method"><span class="api-method api-method-post">post</span></td><td><a href="#op-post-tui-show-toast">/tui/show-toast</a></td><td class="api-index-id">tui.showToast</td></tr><tr><td class="api-index-method"><span class="api-method api-method-post">post</span></td><td><a href="#op-post-tui-publish">/tui/publish</a></td><td class="api-index-id">tui.publish</td></tr><tr><td class="api-index-method"><span class="api-method api-method-post">post</span></td><td><a href="#op-post-tui-select-session">/tui/select-session</a></td><td class="api-index-id">tui.selectSession</td></tr><tr><td class="api-index-method"><span class="api-method api-method-get">get</span></td><td><a href="#op-get-tui-config">/tui/config</a></td><td class="api-index-id">tui.config</td></tr><tr><td class="api-index-method"><span class="api-method api-method-get">get</span></td><td><a href="#op-get-tui-control-next">/tui/control/next</a></td><td class="api-index-id">tui.control.next</td></tr><tr><td class="api-index-method"><span class="api-method api-method-post">post</span></td><td><a href="#op-post-tui-control-response">/tui/control/response</a></td><td class="api-index-id">tui.control.response</td></tr></tbody></table>

### Append Prompt

post /tui/append-prompt [#](#op-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 

1

2

3

4

5

6

```
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"

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

Try it

directory _query_  workspace _query_ 

Request body _application/json_ { "text": "" }

---

Source: https://nikcli-ai.dev/docs/api/tui
