Skip to content

The terminal UI

apic ui is the interactive face of the same project the CLI runs: requests on the left, and a preview, the response, the checks, the session and the history on the right. It sends requests with the same runner as apic run, so what you see is what CI will see.

apic ui

Terminal window
apic ui # the project in the current directory
apic ui -C api --env staging # a project elsewhere, in another environment
apic ui --demo # a fake API served in-process, nothing to set up

apic ui --demo writes the bundled example project to a temporary directory, serves the fake API it targets on a free localhost port inside the same process, and opens the UI on it. Quitting shuts the server down and removes the directory. It is the fastest way to see what apic does, and it needs no network access.

apic demo is the two-terminal version: it writes the same project to ./apic-demo (in the current directory) and serves the API. Because apic ui resolves .http files relative to -C (default: the current directory), running plain apic ui in a second terminal won’t see that project — pass -C apic-demo (or cd into it first).

Every apic command, ui included, only ever looks at .http/.rest files under -C (default .). There is no global registry of projects and no upward search past that directory. If a request doesn’t show up, or the UI opens empty, check you’re pointed at the right directory before anything else.

Requests (left) lists every request grouped by file, each row showing its state, method, id and description:

MarkMeaning
●Ready to run: every variable it needs resolves.
○Not ready: something is missing, usually a token another request captures.
✓Ran and passed every assertion and capture.
✗Ran and failed, or could not be sent at all.
-# @disabled: dimmed, and skipped by f and a; enter still sends it.
spinnerIn flight.

Once a request has run, its status code and round trip sit at the right of the row (200 12ms), and the file heading above it rolls its requests up as ✓9 ✗1, so a flow over a long file reads at a glance. A narrow pane sheds the timing first and the description second; the status code and the mark always stay. The colour of a status code is its class, not its verdict: a 404 a request asserts is still a ✓. When the list is taller than the pane, the right of its title counts the rows out of view: ↑3 ↓8.

Preview is apic describe for the selected request: the URL template, headers, the body, auth, every variable with the source it resolved from, and the declared captures and asserts. Missing variables are called out with the request that would provide them.

Response is one scroll in three labelled parts. Under request is the line that was sent, with every variable resolved. Under response is the status line, timing and size, a line saying where the time went (DNS, connect, TLS, first byte, total, and whether the connection was reused) and the body pretty-printed and syntax-highlighted. Under checks are the assertions and captures. H adds the headers and the body sent to the first part and the response headers to the second; c swaps in the equivalent curl command, and each further press the same request as HTTPie, PowerShell, Python, JavaScript and Go (see apic snippet) before the response comes back. When a tab holds more than fits, the right of the tab strip says where you are in it: top ↓, ↑ 40% ↓, ↑ end.

Checks shows each assertion with its actual and expected value, which is the fastest way to see why a check failed, plus everything the request captured, under the same request, response and checks rules as the response tab.

Session lists the values captured for the current environment, the same ones apic session prints and the same ones later runs will use, and the cookies in the jar when cookies: true is set. x clears them after a confirmation.

History lists the selected request’s earlier responses in the current environment, newest first, and under them what changed between the last two: the status, then the body, compared as apic history diff compares them. It needs history: N in apic.yaml; until then the tab says so. Every run from the UI adds an entry, including the requests a # @ref ran first.

The status bar carries the project root, the environment, a spinner with progress and a running clock while a request is out, and the result of the last run. demo and redact badges show when --demo or --redact is in force, so a screenshot never hides that values were masked. On a narrow terminal the bar gives up the project root first, then the last result, then the environment, so the key hint and anything in flight stay in view.

KeyAction
↑/k, ↓/jMove between requests
g, GFirst and last request
/Filter by id, URL, method, file or description; ↑/↓ move through the matches while you type, enter keeps the filter
enterRun the selected request
fRun every request in its file, in order, as a flow
aRun every request in the project
escCancel a run, clear the filter, or close an overlay
tab/l, shift+tab/hNext and previous tab
1 2 3 4 5Jump to preview, response, checks, session, history
HToggle request and response headers
cShow the selected request as curl; again for HTTPie, PowerShell, Python, JavaScript, Go, then back to the response
J, KScroll the right pane a line down or up
pgup/ctrl+u, pgdn/ctrl+dScroll the right pane half a page
e, ESwitch to the next and the previous environment
rReload the project from disk
oOpen the request’s file at its line in $EDITOR
xClear the session for this environment
?Show every key
q, ctrl+cQuit
  • One request at a time. Runs are serialised, because they share the session and the values captured along the way. Starting a run while one is in flight says so rather than queueing; esc cancels.
  • Flows update live. Running a file sends its requests one after another, and each row turns green or red as its response arrives, so a long flow shows progress instead of a frozen screen. The cursor moves to each request as its response lands, so the pane shows the latest response while the next request is out, and a filter that would hide any of them is cleared when the flow starts, so the pane and the list always agree.
  • Retries happen inside the run. A request with # @retry is sent until its assertions pass; the status line of its response then says how many attempts it took. The row is “running” until then, so a long poll looks like a slow request.
  • Captures apply immediately. After login passes, requests that need {{token}} flip from ○ to ● without a reload. A request with # @ref login is ● from the start: running it runs login first when the token is missing, and login’s row shows that result too.
  • Scrolling stays put. Reading down a long response and it finishes changing underneath you (a later step of a flow landing, the terminal being resized) leaves you where you were. Moving to another request, tab or overlay starts at the top again.
  • Switching environment rebuilds the project with that environment’s variables and session, and clears the results on screen, since they came from somewhere else.
  • Editing is round-tripped. o opens $VISUAL, then $EDITOR (vi, or notepad on Windows), at the request’s line; the project is reloaded when the editor exits. VS Code, Cursor and VSCodium are given --wait so that moment is the tab closing, not the window opening. While the editor runs the UI stops reading the keyboard, so everything typed goes to the editor. r reloads without editing, which picks up files written by anything else.
  • Redaction is honoured. With --redact, bodies, header values, query values and captured values are masked on screen exactly as they are in apic run --redact output.

apic ui needs an interactive terminal on both stdin and stdout.

  • “needs an interactive terminal” means stdout is a pipe or a file. Drop the pipe, or use apic run/apic list --json for scripted work.
  • “does not support --json” means exactly that: the UI has no machine output. apic run --json and apic list --json do.
  • On Windows, run it in Windows Terminal or PowerShell. Git Bash’s mintty needs winpty apic ui.
  • Below 70x16 the UI says the terminal is too small rather than drawing a scrambled screen.

Hosted on Cloudflare, which keeps aggregate traffic statistics. No cookies, no tracking scripts, no per-request logs. Privacy