Skip to content

TUI Walkthrough

caracal-tui is a terminal UI for inspecting all Caracal entities without leaving the shell. It fetches from the same control-plane API as the CLI and renders into a full-screen terminal buffer with keyboard navigation.


Terminal window
caracal-tui

Requirements:

  • A TTY terminal (stdin must be a TTY).
  • CARACAL_ADMIN_TOKEN set in the environment.
  • CARACAL_API_URL set in production (localhost default in development).
  • For agent and delegation views: CARACAL_COORDINATOR_URL and CARACAL_COORDINATOR_TOKEN.

On startup, the TUI enters full-screen alt buffer mode and hides the cursor. Press q or ctrl-c at any time to exit and restore the terminal.


┌──────────────────────────────────────────────────────────────────┐
│ Caracal TUI http://localhost:3000│ banner
│ > menu › zones › zone_abc123 │ breadcrumb
├──────────────────────────────────────────────────────────────────┤
│ │
│ (view content) │
│ │
├──────────────────────────────────────────────────────────────────┤
│ (status message) │ status line
│ ↑/↓:move enter:select z:set-zone h:back q:quit │ key hints
└──────────────────────────────────────────────────────────────────┘

The terminal is redrawn every 30 ms when content changes. Resize events (SIGWINCH) trigger an immediate redraw. The last column in every list view expands to fill the remaining terminal width.


The main menu is the root view. Navigate with arrow keys or number shortcuts:

KeyViewZone required
1ZonesNo
2ApplicationsYes
3ResourcesYes
4ProvidersYes
5PoliciesYes
6Policy-setsYes
7GrantsYes
8SessionsYes
9Audit (live)Yes
0AgentsYes + CARACAL_COORDINATOR_TOKEN

For views that require a zone, press z to open the zone picker before navigating.


KeyAction
qQuit the TUI
ctrl-cQuit the TUI
h, esc, Go back to the parent view
, jMove cursor up one row
, kMove cursor down one row
pgupMove up 10 rows
pgdnMove down 10 rows
home, gJump to the first row
end, GJump to the last row
enterOpen selected row
rReload data from the API
zOpen zone picker

Press z from the main menu or any list view to change the active zone. All zone-scoped views use the selected zone.

The zone picker lists all zones with columns: slug, id, name. The currently selected zone is highlighted.

Navigate with the standard list keys. Press enter to confirm the selection and return to the previous view. Press h, esc, or to cancel without changing the zone.


Each entity type opens its own list view with fixed-width columns and an expanding final column. The status line shows loading state, errors, and the row count.

Loading states:

  • loading… — initial fetch in progress.
  • (no rows) — fetch succeeded with an empty result set.
  • Error message in red — fetch failed. Common errors:
    • 401 Unauthorized — check CARACAL_ADMIN_TOKEN.
    • 403 Forbidden — token lacks required scope.
    • 404 Not Found — resource may have been deleted since the previous load.
    • Connection error — check caracal status to confirm the stack is running.

Columns per view:

ViewColumns
Zonesslug (18), name (24), login_flow (12), dcr (5), pkce (5), id
Applicationsname (24), method (8), cred (12), traits (24), id
Resourcesidentifier (32), name (18), upstream (32), scopes
Providersidentifier (24), name (24), kind (10), owner (10), id
Policiesname (28), owner (10), description (32), id
Policy-setsname (24), active_version (36), description
Grantsapp (36), user (36), resource (36), status (10), scopes
Sessionssubject (36), type (10), status (10), expires_at (24), id
Agentsapplication (36), parent (36), status (10), depth (6), spawned_at (24), id

Text that exceeds a column’s width is truncated with .


Press enter on any list row to open the detail view for that entity. The detail view renders the full API response as pretty-printed JSON.

Navigation in detail view:

KeyAction
, jScroll up one line
, kScroll down one line
pgupScroll up 10 lines
pgdnScroll down 10 lines
home, gJump to the top
end, GJump to the bottom
rReload from the API
h, esc, Back to the list view

The Audit view (9 from the main menu) polls the audit API every 2 seconds and displays events as they arrive. Up to 500 events are kept in memory.

Columns: occurred_at (22), event_type (28), decision (8), status (12), request_id (24)

Decision coloring:

DecisionColor
allowGreen
denyRed
partialOrange

Audit-specific keys:

KeyAction
pToggle pause / resume streaming
dCycle decision filter: allallowdenypartialall
enterOpen full audit detail for the selected event
rForce immediate reload

The current filter is shown in the status line (e.g., filter:deny). When paused, p:resume is shown. When streaming, p:pause is shown.

Audit detail:

Press enter on an audit event to open its full detail view, showing the complete AuditDetail record including determining_policies_json and diagnostics_json. This is the TUI equivalent of caracal explain <request_id>.


API errors are shown in the status line in red. The TUI does not exit on API errors — press r to retry, or press h to go back and try a different view.

ErrorLikely cause
unauthorized — check CARACAL_ADMIN_TOKENToken missing, wrong, or expired
forbidden — token lacks required scopeToken does not have admin scope
not found — resource may have been deletedEntity was removed between load and detail fetch
is the stack running? try 'caracal up'API not reachable
coordinator URL not setCARACAL_COORDINATOR_URL is missing
coordinator token not setCARACAL_COORDINATOR_TOKEN is missing