tui-development
Skill15k starsChanged 59 days agoApache-2.0View on GitHub
Guide for developing the OpenShell TUI — a ratatui-based terminal UI for the OpenShell platform. Covers architecture, navigation, data fetching, theming, UX conventions, and development workflow. Trigger keywords - term, TUI, terminal UI, ratatui, openshell-tui, tui development, tui feature, tui bug.
Trending
Less talk lately.about the whole repository
Who's talking about NVIDIA/OpenShell
- @sungkim.bsky.social“When you feel you need a head-inducing list of configurable ACL for your shell/VM, to run your AI agents. …”Bluesky · Sep 29, 2026 · 23 likes
- cncf/sandbox“[Sandbox] OpenShell”GitHub · Sep 8, 2026 · 17 reactions
- @cboettig.bsky.social“hmm, openshell looks pretty interesting: github.com/NVIDIA/OpenS... basically just runs your agent in an …”Bluesky · Mar 23, 2026 · 4 likes
- A Hacker News story“OpenShell: Nvidia's sandbox for AI agents like OpenClaw”Hacker News · Mar 16, 2026 · 4 points
- @github-trending.bsky.social“🎉 Celebrating! 🎉 (500+ new stars) 📦 NVIDIA / OpenShell ⭐ 9,944 (+978) 🗒 Rust OpenShell is the safe, …”Bluesky · Sep 29, 2026 · 3 likes
The biggest 5 of 44 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 44
Talked about on GitHub, Bluesky and Hacker News (44 times).
On GitHub · 26
- Sep 8, 2026[Sandbox] OpenShell — cncf/sandbox17 reactions · 14 comments
- Jul 3, 2026feat: add openshell_direct adapter for NVIDIA OpenShell sandboxed agent execution — paperclipai/paperclip3 reactions · 1 comment
- Sep 27, 2026chore(deps): update dependency nvidia/openshell to v0.1.2 — fullsend-ai/fullsend2 reactions · 8 comments
- Aug 31, 2026Add retry with backoff for openshell binary download in sandbox setup — fullsend-ai/fullsend2 reactions · 3 comments
- Aug 28, 2026chore(deps): update dependency nvidia/openshell to v0.0.116 — fullsend-ai/fullsend2 reactions · 10 comments
21 more on GitHub
- Aug 22, 2026chore(deps): update dependency nvidia/openshell to v0.0.111 — fullsend-ai/fullsend2 reactions · 20 comments
- Aug 20, 2026sandbox name should be no more than 19 characters — fullsend-ai/fullsend2 reactions · 4 comments
- Aug 17, 2026Supporting Nvidia OpenShell as shell provider — langgenius/dify2 reactions · 1 comment
- Mar 19, 2026Support OpenShift deployment via agent-sandbox CRD — NVIDIA/NemoClaw2 reactions · 5 comments
- Oct 3, 2026feat: support Laya as a typed dispatch provider — kunchenguid/firstmate1 reaction · 3 comments
- Oct 1, 2026Update OpenShell to v0.1.3-pre.1 — openclaw/openclaw-enterprise1 reaction · 2 comments
- Sep 25, 2026Add NVIDIA OpenShell as an optional sandbox provider — napetrov/enterprise-agent-toolkit1 reaction · 3 comments
- Sep 2, 2026Migrate sandbox operations from OpenShell CLI subprocesses to the Go SDK — fullsend-ai/fullsend1 reaction · 4 comments
- Aug 25, 2026replace gateway info command calls as it's no longer available on recent OpenShell versions — openkaiden/kaiden1 reaction · 1 comment
- Aug 21, 2026feat(dify-agent): add OpenShell runtime backend — langgenius/dify1 reaction · 4 comments
- Aug 6, 2026Add controller-managed, time-bounded disruption protection for Sandbox pods — kubernetes-sigs/agent-sandbox1 reaction · 2 comments
- Aug 5, 2026rust: support SCCACHE_BASEDIRS across checkout roots — mozilla/sccache1 reaction · 6 comments
- Jul 26, 2026fix(openshell): bound generated sandbox names — openclaw/openclaw1 reaction · 5 comments
- Jul 14, 2026chore(deps): update dependency nvidia/openshell to v0.0.83 — fullsend-ai/fullsend1 reaction · 1 comment
- Jul 3, 2026Rewrite openshell-cli.ts on top of the new OpenShell typescript SDK — openkaiden/kaiden1 reaction · 5 comments
- Jun 30, 2026Update OpenCode to support VertexAI — openkaiden/kaiden1 reaction · 3 comments
- Jun 23, 2026[Bug]: Mirror mode with OpenShell >= 0.0.37 creates recursively nested previous-workspace directories in sandbox — openclaw/openclaw1 reaction · 1 comment
- Jun 11, 2026feat(openshell): build and create sandbox via openshell-image-builder — openkaiden/kaiden1 reaction · 4 comments
- Jun 3, 2026AgentHarness: phaseToCondition should fall back to status.conditions when phase=UNSPECIFIED — kagent-dev/kagent1 reaction · 2 comments
- May 10, 2026openshell: 0.0.116 -> 0.1.0 — NixOS/nixpkgs1 reaction · 10 comments
- Apr 18, 2026Composite action needs retry logic for OpenShell and CLI downloads to handle transient CDN failures — fullsend-ai/fullsend1 reaction · 7 comments
On Bluesky · 14
- Sep 29, 2026When you feel you need a head-inducing list of configurable ACL for your shell/VM, to run your AI agents. github.com/NVIDIA/OpenS... — @sungkim.bsky.social23 likes and reposts
- Mar 23, 2026hmm, openshell looks pretty interesting: github.com/NVIDIA/OpenS... basically just runs your agent in an OCI container (like we already do)… — @cboettig.bsky.social4 likes and reposts · 1 reply
- Sep 29, 2026🎉 Celebrating! 🎉 (500+ new stars) 📦 NVIDIA / OpenShell ⭐ 9,944 (+978) 🗒 Rust OpenShell is the safe, private runtime for autonomous AI… — @github-trending.bsky.social3 likes and reposts · 1 reply
- Sep 1, 2026NVIDIA / OpenShell: OpenShell is the safe, private runtime for autonomous AI agents. ★8466 https://github.com/NVIDIA/OpenShell — @rusttrending.bsky.social3 likes and reposts
- Jul 10, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 NVIDIA / OpenShell ⭐ 7,607 (+108) 🗒 Rust OpenShell is the safe, private runtime for autonomous AI… — @github-trending-rs.bsky.social3 likes and reposts
9 more on Bluesky
- Sep 29, 2026今日のGitHubトレンド NVIDIA/OpenShell OpenShellは、自律型AIエージェント向けの安全でプライベートな実行環境です。 エージェントにファイル操作やAPI利用などの機能を提供しつつ、ポリシーによってデータやネットワークへのアクセスを制限します。… — @dailygithubtrends.bsky.social2 likes and reposts
- May 13, 2026NVIDIA / OpenShell: OpenShell is the safe, private runtime for autonomous AI agents. ★5863 https://github.com/NVIDIA/OpenShell — @rusttrending.bsky.social2 likes and reposts
- Oct 2, 2026AI news - Oct 2, 2026 1. Cloudflare Releases Open-Source Clef Decision Models LINK 2. NVIDIA OpenShell enforces agent security via… — @hackobar.bsky.social1 likes and repost · 1 reply
- Oct 1, 2026NVIDIA / OpenShell: OpenShell is the safe, private runtime for autonomous AI agents. ★13657 https://github.com/NVIDIA/OpenShell — @rusttrending.bsky.social1 likes and repost
- Jul 22, 2026NVIDIA / OpenShell: OpenShell is the safe, private runtime for autonomous AI agents. ★7733 https://github.com/NVIDIA/OpenShell — @rusttrending.bsky.social1 likes and repost
- Jun 2, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 NVIDIA / OpenShell ⭐ 6,582 (+142) 🗒 Rust OpenShell is the safe, private runtime for autonomous AI… — @github-trending-rs.bsky.social1 likes and repost
- May 14, 2026📦 NVIDIA / OpenShell ⭐ 5,866 (+46) 🗒 Rust OpenShell is the safe, private runtime for autonomous AI agents. — @github-trending-rs.bsky.social1 likes and repost
- Mar 21, 2026NVIDIA OpenShell: safe, private runtime for autonomous AI agents https://github.com/NVIDIA/OpenShell — @nono2357.bsky.social1 likes and repost · 1 reply
- Sep 29, 2026🎉 Celebrating! 🎉 (500+ new stars) 📦 NVIDIA / OpenShell ⭐ 9,944 (+978) 🗒 Rust OpenShell is the safe, private runtime for autonomous AI… — @github-trending-rs.bsky.social0 likes and reposts · 1 reply
On Hacker News · 4
- Mar 16, 2026OpenShell: Nvidia's sandbox for AI agents like OpenClaw4 points · 1 comment
- Oct 2, 2026Nvidia/OpenShell: Safe, private runtime for autonomous AI agents2 points
- Apr 21, 2026Nvidia OpenShell: safe, private runtime for autonomous AI agents2 points
- Mar 17, 2026OpenShell – private runtime for autonomous AI agents2 points
In this repository25 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- build-from-issueSkill
- build-openshell-mxc-windowsSkill
- create-github-issueSkill
- create-github-prSkill
- create-rfcSkill
- create-spikeSkill
- fix-security-issueSkill
- helm-dev-environmentSkill
- launch-openshell-gatorSkill
- review-github-prSkill
- review-security-issueSkill
- sbomSkill
- sync-agent-infraSkill
- test-release-canarySkill
- triage-issueSkill
- update-docs-from-commitsSkill
- watch-github-actionsSkill
- openshell-policy-advisorSkill
- gator-gateSkill
- debug-inferenceSkill
- debug-openshell-clusterSkill
- generate-sandbox-policySkill
- openshell-cliSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
25 rules. About 0 are common, 9 are distinctive, and 16 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
16
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 129
Every frame renders four vertical regions:
- Very specific: line 152
Add a variant to Screen in app.rs.
- Very specific: line 153
Create a new module under src/ui/ with a pub fn draw(frame, app, area).
- Very specific: line 154
Add the module declaration in ui/mod.rs.
- Very specific: line 155
Add a match arm in ui::draw() to dispatch to the new module.
- Very specific: line 156
Add relevant Focus variants if the screen has multiple panels.
- Very specific: line 157
Add key handling methods in App for the new focus states.
- Very specific: line 158
Add nav bar hints in draw_nav_bar() for the new screen/focus combinations.
- Distinctive: line 164
Always grab a batch of initial data so the UI has content immediately, then attach streaming for live updates.
- Distinctive: line 181
Only one collection-refresh task may run at a time.
- Very specific: line 185
All network calls must be spawned as async tasks via tokio::spawn.
- Very specific: line 219
All gRPC calls use a 5-second timeout via tokio::time::timeout:
- Distinctive: line 308
Always show a y/n confirm dialog before delete, stop, or other irreversible operations.
- Distinctive: line 331
When adding new TUI features, check what the CLI offers and maintain consistency.
- Distinctive: line 350
When content can exceed the viewport width (log lines, field lists, etc.):
- Very specific: line 494
Delete responses carry DeletionOutcome: distinguish Accepted (cleanup pending), Completed, and AlreadyAbsent.
- Distinctive: line 536
All gRPC calls use a 5-second timeout:
- Distinctive: line 612
Always run before committing:
- Distinctive: line 620
If you change sandbox or server code that affects the backend, restart or redeploy the gateway for the compute platform you are using.
- Very specific: line 642
Check the proto definitions in openshell-core for available RPCs and message types.
- Very specific: line 643
Add the call in lib.rs following the existing pattern (timeout wrapper, error handling, state update).
- Very specific: line 644
If the call is triggered by a key press, add a pending_* flag to App and handle it in the event loop.
- Very specific: line 645
If the call returns streaming data, spawn it as a background task and send results via Event variants.
- Very specific: line 649
Add the variant to Event in event.rs.
- Very specific: line 651
Update App state as needed from the event data.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
OpenShell TUI Development Guide
Comprehensive reference for any agent working on the OpenShell TUI.
1. Overview
The OpenShell TUI is a ratatui-based terminal UI for the OpenShell platform. It provides a keyboard-driven interface for managing gateways, sandboxes, and logs — the same operations available via the openshell CLI, but with a live, interactive dashboard.
- Launched via:
openshell termormise run term - Crate:
crates/openshell-tui/ - Key dependencies:
ratatui(workspace version) — usesframe.area()for the drawable terminal areacrossterm(workspace version) — terminal backend and event pollingtonicwith TLS — gRPC client for the OpenShell gatewaytokio— async runtime for event loop, spawned tasks, and mpsc channelsopenshell-core— proto-generated types (OpenShellClient, request/response structs)openshell-bootstrap— gateway discovery (list_gateways())
- Theme: Adaptive dark/light via
Themestruct — NVIDIA-branded green accents. Controlled by--themeflag,OPENSHELL_THEMEenv var, or auto-detection.
2. Domain Object Hierarchy
The data model follows a strict hierarchy: Gateway > Workspace > Sandboxes/Providers/Settings > Logs.
Gateway (discovered via openshell_bootstrap::list_gateways())
├── Global Settings (fetched via GetGatewayConfig)
├── Global Policy indicator (fetched via ListSandboxPolicies global=true)
├── Workspaces (fetched via ListWorkspaces)
├── Provider Profiles (fetched via ListProviderProfiles, workspace-scoped)
├── Providers (fetched via ListProviders, workspace-scoped)
│ └── cached ProviderProfile (matched by type + workspace)
└── Sandboxes (fetched via ListSandboxes, workspace-scoped)
├── Policy (fetched via GetSandboxConfig)
├── Settings (effective settings with scope, from GetSandboxConfig)
├── Draft recommendations (fetched via GetDraftPolicy)
└── Logs (fetched via GetSandboxLogs + streamed via WatchSandbox)- Gateways are discovered from on-disk config via
openshell_bootstrap::list_gateways(). Each gateway has a name, endpoint, local/remote flag, and source label. - Workspaces are fetched via
ListWorkspaces. The user cycles through workspaces with[w], or views all workspaces at once. The current workspace scopes provider and sandbox lists. - Provider Profiles are fetched per-workspace via
ListProviderProfiles. Profiles are cached in aProviderProfileCachekeyed by(workspace, profile_id)and matched to providers by type. They provide category, credential metadata, endpoint/binary counts, and inference capability. - Providers are fetched via
ListProvidersscoped to the current workspace. EachProviderListEntrypairs a provider with its optional cached profile. The TUI supports profile-backed create, update, and delete operations. - Global Settings are fetched via
GetGatewayConfigand displayed in a tabbed pane alongside providers on the dashboard. Each setting is a registered key with a typed value (bool/int/string). Platform-admin access is required;PermissionDenieddisables the pane. - Sandboxes belong to the active gateway and workspace. Fetched via
ListSandboxeswith a periodic tick refresh. - Sandbox Settings are effective settings returned by
GetSandboxConfig, each with a scope (sandbox, global, or unset). Globally-managed settings are blocked from sandbox-level edits. - Logs belong to a single sandbox. Initial batch fetched via
GetSandboxLogs(500 lines), then live-tailed viaWatchSandboxwithfollow_logs: true.
The title bar always reflects this hierarchy, reading left-to-right from general to specific:
OpenShell v<version> │ Current Gateway: <name> [source] (<status>) │ Workspace: <name|all> │ <screen/context>3. Navigation & Screen Architecture
Screens (Screen enum)
Top-level layouts that own the full content area. Each has its own nav bar hints.
| Screen | Description | Module |
Splash | Boot screen shown on startup, auto-dismissed after 3 seconds | ui/splash.rs |
Dashboard | Gateway list (top) + providers/settings (middle) + sandbox table (bottom) | ui/dashboard.rs |
Sandbox | Single-sandbox view — metadata (top) + policy/settings/logs/drafts (bottom) | ui/sandbox_detail.rs, ui/sandbox_policy.rs, ui/sandbox_settings.rs, ui/sandbox_logs.rs, ui/sandbox_draft.rs |
Focus (Focus enum)
Tracks which panel currently receives keyboard input.
| Focus | Screen | Description |
Gateways | Dashboard | Gateway list panel has input focus |
Providers | Dashboard | Provider list or global settings pane (depends on MiddlePaneTab) |
Sandboxes | Dashboard | Sandbox table panel has input focus |
SandboxPolicy | Sandbox | Policy viewer or settings table (depends on SandboxPolicyTab) |
SandboxLogs | Sandbox | Log viewer with structured rendering |
SandboxDraft | Sandbox | Draft policy recommendations list |
Tab enums
Two tab enums control which sub-view renders within a focus area:
MiddlePaneTab(Providers|GlobalSettings): toggles the middle dashboard pane between the provider list and the global settings table. Switched with[h/l].SandboxPolicyTab(Policy|Settings): toggles the sandbox bottom pane between the policy viewer and the sandbox settings table. Switched with[h].
Screen dispatch
The top-level ui::draw() function (ui/mod.rs) handles the chrome (title bar, nav bar, command bar) and dispatches to the correct screen module:
match app.screen {
Screen::Splash => unreachable!(),
Screen::Dashboard => dashboard::draw(frame, app, chunks[1]),
Screen::Sandbox => draw_sandbox_screen(frame, app, chunks[1]),
}Within the Sandbox screen, sandbox_detail::required_height sizes the metadata and restart status pane to its contents. The remaining area dispatches based on focus and tab state:
match app.focus {
Focus::SandboxLogs => sandbox_logs::draw(frame, app, chunks[1]),
Focus::SandboxDraft => sandbox_draft::draw(frame, app, chunks[1]),
_ => match app.sandbox_policy_tab {
SandboxPolicyTab::Settings => sandbox_settings::draw(frame, app, chunks[1]),
SandboxPolicyTab::Policy => sandbox_policy::draw(frame, app, chunks[1]),
},
}On the dashboard, the middle pane dispatches by MiddlePaneTab:
match app.middle_pane_tab {
MiddlePaneTab::Providers => providers::draw(frame, app, chunks[1], mid_focused),
MiddlePaneTab::GlobalSettings => global_settings::draw(frame, app, chunks[1], mid_focused),
}Layout structure
Every frame renders four vertical regions:
┌─────────────────────────────────────────────┐
│ Title bar (1 row) — brand + gateway + context│
├─────────────────────────────────────────────┤
│ │
│ Main content (flexible) │
│ │
├─────────────────────────────────────────────┤
│ Nav bar (1 row) — context-sensitive key hints│
├─────────────────────────────────────────────┤
│ Command bar (1 row) — `:` command input │
└─────────────────────────────────────────────┘Title bar examples
- Dashboard:
>_ OpenShell v<version> | Current Gateway: openshell [local] (Healthy) | Workspace: default | Dashboard - Sandbox detail:
>_ OpenShell v<version> | Current Gateway: openshell [local] (Healthy) | Workspace: team-a | Sandbox: my-sandbox
Adding a new screen
- Add a variant to
Screeninapp.rs. - Create a new module under
src/ui/with apub fn draw(frame, app, area). - Add the module declaration in
ui/mod.rs. - Add a match arm in
ui::draw()to dispatch to the new module. - Add relevant
Focusvariants if the screen has multiple panels. - Add key handling methods in
Appfor the new focus states. - Add nav bar hints in
draw_nav_bar()for the new screen/focus combinations.
4. Data Fetching Pattern
Initial fetch first, then stream
Always grab a batch of initial data so the UI has content immediately, then attach streaming for live updates.
Logs example (spawn_log_stream in lib.rs):
Phase 1: GetSandboxLogs → 500 initial lines → send via Event::LogLines
Phase 2: WatchSandbox(follow_logs: true) → live tail → send via Event::LogLinesSandboxes: Fetched via ListSandboxes in a background collection-refresh task scheduled from the 2-second tick, scoped to the current workspace (or all workspaces). Follow next_page_token until empty so the dashboard reflects the complete collection. The NOTES column summarizes active ConfigurationInvalid readiness conditions as Invalid config before port forwards and clears the note on refresh after repair. Full diagnostics remain available through openshell sandbox get <name> -o json. Timed-out provisioning attempts show Provisioning timed out with cleanup pending or compute reclaimed, preserving port forwards. The sandbox detail pane wraps the full configuration error in its Notes field.
Providers: Fetched via ListProviders in the background collection-refresh task. Provider profiles are fetched per-workspace via ListProviderProfiles and cached in a ProviderProfileCache keyed by (workspace, profile_id). Follow each list RPC's next_page_token until empty.
Settings: Global settings are fetched via GetGatewayConfig on each tick. Sandbox settings are fetched alongside the sandbox policy via GetSandboxConfig and refreshed on each tick when viewing a sandbox.
Workspaces: The workspace list is fetched via ListWorkspaces in the background collection-refresh task, following next_page_token until empty.
Only one collection-refresh task may run at a time. Workspace and gateway changes abort the active task, and refresh results carry their gateway/workspace context so stale results are discarded.
Never block the event loop
All network calls must be spawned as async tasks via tokio::spawn. The event loop in lib.rs must remain responsive to keyboard input and rendering at all times.
Pattern:
// Background task sends data back via mpsc channel
let handle = tokio::spawn(async move {
let result = client.some_rpc(request).await;
let _ = tx.send(Event::SomeData(result));
});Loading states
Show "Loading..." while async data is in flight (see sandbox_logs.rs — renders a loading message when filtered is empty and sandbox_log_lines is also empty).
Event channel
Background tasks communicate with the event loop via mpsc::UnboundedSender<Event>. The EventHandler provides a sender() method to clone the transmit handle. There are many Event variants for different async results (log lines, create results, provider CRUD results, setting CRUD results, draft action results, forward warnings):
// In lib.rs
spawn_log_stream(&mut app, events.sender());
// In the spawned task
let _ = tx.send(Event::LogLines(lines));Access denial handling
Global settings and global policy queries may return PermissionDenied when the user lacks platform-admin access. The TUI sets global_settings_access_denied / global_policy_access_denied flags to stop retrying these calls on subsequent ticks, and clears the corresponding UI state.
gRPC timeouts
All gRPC calls use a 5-second timeout via tokio::time::timeout:
tokio::time::timeout(Duration::from_secs(5), client.health(req)).await5. Style Guide & Colors
Theme System (theme.rs)
Colors and styles are defined in crates/openshell-tui/src/theme.rs via the Theme struct. The TUI supports dark and light terminal backgrounds.
Theme selection
Theme mode is controlled by three mechanisms (highest priority first):
--theme dark|light|autoCLI flag onopenshell termOPENSHELL_THEMEenvironment variable- Auto-detection via
COLORFGBGenv var (falls back to dark)
The ThemeMode enum (Auto, Dark, Light) is resolved at startup via theme::detect() before entering raw mode.
Brand colors (theme::brand)
| Constant | Value | Usage |
NVIDIA_GREEN | Color::Rgb(118, 185, 0) | Primary accent (dark theme) |
NVIDIA_GREEN_DARK | Color::Rgb(80, 140, 0) | Primary accent (light theme — darker for contrast) |
EVERGLADE | Color::Rgb(18, 49, 35) | Dark green — borders, title bar bg (dark theme) |
MAROON | Color::Rgb(128, 0, 0) | Pacman chase animation |
Theme struct fields
The Theme struct has 16 Style fields, accessed at runtime via app.theme:
| Field | Dark value | Light value | Usage |
text | White fg | Near-black fg | Default body text |
muted | White + DIM | Gray fg | Secondary info, separators |
heading | White + BOLD | Near-black + BOLD | Panel titles, names |
accent | NVIDIA_GREEN fg | NVIDIA_GREEN_DARK fg | Selected row marker, source labels |
accent_bold | NVIDIA_GREEN + BOLD | NVIDIA_GREEN_DARK + BOLD | Brand text, command prompt |
selected | BOLD only | BOLD only | Selected row emphasis |
border | EVERGLADE fg | Light sage fg | Unfocused panel borders |
border_focused | NVIDIA_GREEN fg | NVIDIA_GREEN_DARK fg | Focused panel borders |
status_ok | NVIDIA_GREEN fg | NVIDIA_GREEN_DARK fg | Healthy, INFO, Ready |
status_warn | Yellow fg | Dark yellow fg | Degraded, WARN, Provisioning, Starting |
status_err | Red fg | Dark red fg | Unhealthy, ERROR |
key_hint | NVIDIA_GREEN fg | NVIDIA_GREEN_DARK fg | Keyboard shortcut labels |
log_cursor | EVERGLADE bg | Light green bg | Selected log line highlight |
claw | MAROON + BOLD | MAROON + BOLD | Pacman animation |
title_bar | White on EVERGLADE + BOLD | Near-black on light green + BOLD | Title bar strip |
badge | Black on NVIDIA_GREEN + BOLD | White on NVIDIA_GREEN_DARK + BOLD | Notification badges |
Accessing the theme in draw functions
The Theme is stored on App and accessed via a local alias:
fn draw_my_widget(frame: &mut Frame<'_>, app: &App, area: Rect) {
let t = &app.theme;
frame.render_widget(
Paragraph::new(Span::styled("Hello", t.text)),
area,
);
}For functions that don't take &App (e.g., detail popups, helpers), pass &Theme as a parameter:
fn draw_detail_popup(frame: &mut Frame<'_>, data: &MyData, area: Rect, theme: &Theme) {
let t = theme;
// ...
}Visual conventions
- Selected row: Green
▌left-border marker on the selected row. Active gateway also gets a green●dot. - Focused panel: Border changes from
bordertoborder_focusedstyle. - Status indicators: Green for healthy/ready/info, yellow for degraded/provisioning/starting/warn, red for unhealthy/error.
- Separators: Muted
│characters between title bar segments and nav bar sections. - Log source labels:
"sandbox"source renders inaccent(green),"gateway"inmuted.
6. UX Conventions
Destructive actions require confirmation
Always show a y/n confirm dialog before delete, stop, or other irreversible operations.
Delete sandbox 'my-sandbox'? [y] Confirm [Esc] CancelThe confirm_delete flag in App gates destructive key handling — while true, only y, n, and Esc are processed.
CLI parity
TUI actions should parallel openshell CLI commands so users have familiar mental models:
| CLI Command | TUI Equivalent |
openshell sandbox list | Sandbox table on Dashboard |
openshell sandbox delete <name> | [d] on sandbox detail, then [y] to confirm |
openshell sandbox create | [c] on sandbox panel to open create form |
openshell sandbox connect | [s] on sandbox policy view to launch SSH shell |
openshell logs <name> | [l] on sandbox detail to open log viewer |
openshell provider list | Provider table on Dashboard (middle pane) |
openshell provider create | [c] on provider panel |
openshell status | Status in title bar + gateway list |
When adding new TUI features, check what the CLI offers and maintain consistency.
The create form parses the optional Command field as shell words before starting creation. Preserve the parsed argument vector through post-create execution and shell-escape each argument at the SSH boundary. Quoting groups arguments; expansions and operators remain literal unless the user explicitly invokes a shell such as sh -c. Invalid quoting must leave the form open with an error and must not queue sandbox creation.
Scrollable views follow k9s conventions
Any scrollable content (logs, future long lists) should follow the k9s autoscroll pattern:
- Autoscroll on by default — when entering a scrollable view, it auto-follows new content
- Scrolling up pauses — any upward scroll (keyboard or mouse) disables autoscroll
forGre-enables — jump to bottom and resume following- Visual indicator — show
● FOLLOWING(green) or○ PAUSED(yellow) in the panel footer - Mouse scroll supported —
ScrollUp/ScrollDownevents move by 3 lines and respect autoscroll state - Scroll position shown —
[current/total]in the panel footer
State is tracked via log_autoscroll: bool on App. The scroll_logs(delta) method handles both keyboard and mouse input uniformly.
Long content: truncate + detail popup
When content can exceed the viewport width (log lines, field lists, etc.):
- Truncate in the list view — hard-cut at the viewport's inner width and append
…. This keeps density high and avoids wrapping that breaks the 1-line-per-entry model. - Enter opens a detail popup — a centered overlay showing the full untruncated content with word-wrap.
EscorEntercloses it. Track the open state viaOption<usize>index. - Drop noise in the list view — omit empty fields, remove developer-internal info (like module paths / tracing targets) that the user doesn't need at a glance.
- Smart field ordering — for known message types (e.g. CONNECT, L7_REQUEST), put the most important fields first and trail with process ancestry / noise. Unknown types sort alphabetically.
- Show everything in the popup — the detail popup is where target, all fields (including empty ones if useful), and the full message are visible.
This pattern should be reused for any future view with potentially long entries.
Vim-style navigation
| Key | Action |
j / Down | Move selection down |
k / Up | Move selection up |
g | Jump to top (logs), disables autoscroll |
G | Jump to bottom (logs), re-enables autoscroll |
f | Follow / re-enable autoscroll (logs) |
Tab / BackTab | Switch between panels on Dashboard |
Enter | Select / drill into item; open detail popup in logs |
Esc | Go back one level |
q | Quit (from any screen) |
Ctrl+C | Force quit |
Keyboard-first, mouse-augmented
All actions are accessible via keyboard shortcuts displayed in the nav bar. The nav bar is context-sensitive — it shows different hints depending on the current screen and focus state. Mouse scrolling is supported as a convenience but never required — every action must have a keyboard equivalent.
Command mode
: enters command mode (like vim). The command bar renders at the bottom with a green : prompt and a block cursor. Currently supports:
:q/:quit— exit the application
Esc returns to normal mode. Enter executes the command.
Screen-specific key hints
Dashboard (Gateways focus):
[Tab] Switch Panel [Enter] Select [j/k] Navigate │ [:] Command [q] Quit
Dashboard (Providers focus):
[Tab] Switch Panel [h/l] Switch Tab [j/k] Navigate [Enter] Detail [c] Create [u] Update [d] Delete [w] Workspace │ [:] Command [q] Quit
Dashboard (Global Settings focus):
[Tab] Switch Panel [h/l] Switch Tab [j/k] Navigate [Enter] Edit [d] Delete │ [:] Command [q] Quit
Dashboard (Sandboxes focus):
[Tab] Switch Panel [j/k] Navigate [Enter] Select [c] Create Sandbox [w] Workspace │ [:] Command [q] Quit
Sandbox (Policy focus):
[h] Switch Tab [j/k] Scroll [g/G] Top/Bottom [s] Shell [l] Logs [r] Rules [d] Delete │ [Esc] Back [q] Quit
Sandbox (Settings focus):
[h/l] Switch Tab [j/k] Navigate [Enter] Edit [d] Delete │ [Esc] Back [q] Quit
Sandbox (Logs focus):
[j/k] Navigate [Enter] Detail [g/G] Top/Bottom [f] Follow [s] Source: <filter> [y] Copy [Y] Copy All [v] Select [r] Rules │ [Esc] Policy [q] Quit
Sandbox (Draft focus):
[j/k] Navigate [Enter] Detail [a] Approve [x] Reject [A] Approve All [p] Policy [l] Logs │ [Esc] Back [q] Quit
7. Architecture & Key Files
| File | Purpose |
crates/openshell-tui/Cargo.toml | Crate manifest — dependencies on openshell-core, openshell-bootstrap, ratatui, crossterm, tonic, tokio |
crates/openshell-tui/src/lib.rs | Entry point. Event loop, background collection refresh (spawn_list_refresh), gRPC calls (refresh_global_settings, spawn_log_stream, handle_sandbox_delete), gateway switching, mTLS channel building, provider CRUD spawners, settings CRUD spawners, draft approval spawners |
crates/openshell-tui/src/app.rs | App state struct, Screen/Focus/InputMode/LogSourceFilter/MiddlePaneTab/SandboxPolicyTab enums, LogLine/GatewayEntry/GlobalSettingEntry/SandboxSettingEntry/ProviderListEntry/ProviderDetailView structs, create sandbox/provider form state, all key handling logic |
crates/openshell-tui/src/event.rs | Event enum (Key, Mouse, Tick, Redraw, Resize, LogLines, ListRefreshCompleted, CreateResult, ProviderCreateResult, ProviderDetailFetched, ProviderUpdateResult, ProviderDeleteResult, DraftActionResult, GlobalSettingsFetched, GlobalSettingSetResult, GlobalSettingDeleteResult, SandboxSettingSetResult, SandboxSettingDeleteResult, ForwardWarnings), EventHandler with mpsc channels and crossterm polling |
crates/openshell-tui/src/theme.rs | colors module (NVIDIA_GREEN, EVERGLADE, BG, FG) and styles module (all Style constants) |
crates/openshell-tui/src/clipboard.rs | Clipboard copy support for log lines |
crates/openshell-tui/src/ui/mod.rs | Top-level draw() dispatcher, draw_title_bar (with workspace display), draw_nav_bar, draw_command_bar, screen routing, shared setting-edit overlay, modal helpers |
crates/openshell-tui/src/ui/dashboard.rs | Dashboard screen — 3-pane vertical layout: gateway list (25%) + provider/settings middle pane (25%) + sandbox table (50%) |
crates/openshell-tui/src/ui/providers.rs | Provider list table with profile-aware columns: Name, Category, Type, Credentials, Workspace |
crates/openshell-tui/src/ui/global_settings.rs | Global settings table: Key, Type, Value. Includes edit overlay, confirm-set, and confirm-delete popups |
crates/openshell-tui/src/ui/sandboxes.rs | Reusable sandbox table widget with columns: Name, Status, Created, Age, Image, Workspace, Notes |
crates/openshell-tui/src/ui/sandbox_detail.rs | Sandbox metadata view — name, status, image, created, age, restart policy/status, providers, policy version |
crates/openshell-tui/src/ui/sandbox_policy.rs | Policy viewer — rendered policy lines with scroll support, tab title |
crates/openshell-tui/src/ui/sandbox_settings.rs | Sandbox settings table: Key, Type, Value, Scope. Includes edit overlay and confirm popups |
crates/openshell-tui/src/ui/sandbox_logs.rs | Structured log viewer — timestamp, source, level, target, message, key=value fields, scroll position, source filter, visual selection mode, clipboard copy |
crates/openshell-tui/src/ui/sandbox_draft.rs | Draft policy recommendations — chunk list, detail popup, approve/reject/approve-all flows |
crates/openshell-tui/src/ui/create_sandbox.rs | Create sandbox modal form with name, image, command, providers, ports |
crates/openshell-tui/src/ui/create_provider.rs | Create provider modal, provider detail popup, update provider form |
crates/openshell-tui/src/ui/splash.rs | Splash/boot screen |
Module dependency flow
lib.rs (event loop, gRPC, async tasks, capability fetch)
├── app.rs (state + key handling + tab/workspace logic)
├── event.rs (Event enum + EventHandler)
├── clipboard.rs (copy support)
├── theme.rs (colors + styles)
└── ui/
├── mod.rs (draw dispatcher, chrome, shared overlays)
├── splash.rs (boot screen)
├── dashboard.rs (3-pane layout: gateways + middle + sandboxes)
├── providers.rs (provider list with profile awareness)
├── global_settings.rs (settings table + edit/confirm overlays)
├── sandboxes.rs (sandbox table widget)
├── sandbox_detail.rs (metadata view)
├── sandbox_policy.rs (policy viewer)
├── sandbox_settings.rs (sandbox settings table + overlays)
├── sandbox_logs.rs (log viewer + visual selection)
├── sandbox_draft.rs (draft recommendations)
├── create_sandbox.rs (create sandbox modal)
└── create_provider.rs (create/detail/update provider modals)8. Technical Notes
Dependency constraints
openshell-tuicannot depend onopenshell-cli— this would create a circular dependency. TLS channel building for gateway switching is done directly inlib.rsusingtonic::transportprimitives (Certificate,Identity,ClientTlsConfig,Endpoint).- Gateway authentication supports both mTLS and OIDC.
connect_to_gateway()reads gateway metadata to determine the auth mode, then builds anEdgeAuthInterceptor(bearer token for OIDC, noop for mTLS). - mTLS certs are read from
~/.config/openshell/gateways/<name>/mtls/(ca.crt, tls.crt, tls.key). - OIDC tokens are loaded via
openshell_bootstrap::oidc_token::load_oidc_token()and checked for expiry.
Proto generated code
Proto types come from openshell-core which generates them from OUT_DIR via include!. They are not checked into the repo. Import paths look like:
use openshell_core::proto::openshell_client::OpenShellClient;
use openshell_core::proto::{
all_workspaces_selector, workspace_selector, GetSandboxLogsRequest,
ListSandboxesRequest, ...
};Proto field gotchas
DeleteSandboxRequestusesnamefor the primary sandbox and an explicit workspace selector:let req = openshell_core::proto::DeleteSandboxRequest { name: sandbox_name, workspace_scope: Some(workspace_selector(workspace)), allow_missing: true, ..Default::default() };- Delete responses carry
DeletionOutcome: distinguishAccepted(cleanup pending),Completed, andAlreadyAbsent. Treat unspecified or unknown outcomes as unconfirmed, not completed. WatchSandboxRequesthas extra fields beyond what you might need — always use..Default::default():let req = openshell_core::proto::WatchSandboxRequest { sandbox: sandbox_name, follow_status: false, follow_logs: true, follow_events: false, log_tail_lines: 0, workspace_scope: Some(workspace_selector(workspace)), ..Default::default() };SandboxLogLineproto fields:sandbox_id,event_time(Option<prost_types::Timestamp>),level,target,message,source,fields(HashMap<String, String>).- Workspace-scoped requests use
workspace_scope: Option<WorkspaceSelector>. Select one workspace withSome(workspace_selector(name)). Collection list requests that explicitly support cross-workspace access also acceptSome(all_workspaces_selector()); do not use that marker on other requests. GetSandboxLogsRequestfields:sandbox,lines(u32),since_time(Option<prost_types::Timestamp>),sources(Vec<String>),min_level(String),workspace_scope.ListSandboxesRequestfields:page_size(i32),page_token(String),label_selector(String),workspace_scope.ListProvidersRequestfields:page_size(i32),page_token(String),workspace_scope.ListWorkspacesRequestfields:page_size(i32),page_token(String),label_selector(String).- Paginated list responses return
next_page_token. Continue with the same request parameters and that token until it is empty; changing filters or scope invalidates the token. UpdateConfigRequestfields includesandbox(String, canonical sandbox name),setting_key,setting_value,delete_setting(bool),global(bool), andworkspace_scope. Sandbox-scoped updates require canonicalsandboxand a named selector; gateway-global updates leavesandboxempty andworkspace_scopeasNone.- Most workspace-scoped requests require an explicit named selector, including
the
defaultworkspace. An omitted selector is not an implicit default.
gRPC timeouts
All gRPC calls use a 5-second timeout:
tokio::time::timeout(Duration::from_secs(5), client.health(req)).awaitThe connect timeout for gateway switching is 10 seconds with HTTP/2 keepalive at 10-second intervals.
Log streaming lifecycle
- User presses
[l]on sandbox detail →pending_log_fetch = true - Event loop sees the flag → calls
spawn_log_stream() - Previous stream handle is aborted via
cancel_log_stream() - New
tokio::spawntask: fetches initial 500 lines, then streams viaWatchSandbox - Lines arrive as
Event::LogLinesand are appended toapp.sandbox_log_lines - Auto-scroll kicks in if the user is near the bottom (within 5 lines)
- Stream is cancelled when user presses
Escor navigates away (handle is.abort()ed)
Gateway switching lifecycle
- User selects a different gateway and presses
Enter→pending_gateway_switch = Some(name) - Event loop calls
handle_gateway_switch() - New channel is built via
connect_to_gateway()(mTLS or OIDC depending on gateway metadata) - On success:
app.clientis replaced with a new intercepted clientreset_sandbox_state()clears all sandbox/log/draft/policy data- health and global settings are refreshed, then
spawn_list_refresh()starts the cancellable workspace/provider/sandbox refresh task
- On failure:
status_textshows the error
Initial startup lifecycle
On launch, before the event loop starts:
refresh_gateway_list()— discover gateways from disk- Refresh health and global settings, then start
spawn_list_refresh()for workspaces, providers, and sandboxes
Workspace switching lifecycle
- User presses
[w]on the providers or sandboxes panel →cycle_workspace()advances through discovered workspace names, then "all" pending_workspace_refresh = trueis set, cursor indices are reset- Event loop cancels any in-flight collection refresh and starts
spawn_list_refresh()with the new workspace scope
Settings CRUD lifecycle (global and sandbox)
- User presses
[Enter]on a setting → edit overlay opens (bool types toggle inline and jump to confirmation) - Text input with validation (int, bool, string with allowed-values check)
[Enter]opens a confirmation popup →[y]fires the pending flag- Event loop spawns
spawn_set_global_setting()orspawn_set_sandbox_setting()→UpdateConfigRPC - On success: re-fetches settings to reflect the change
[d]on a setting with a value → confirmation popup →spawn_delete_*_setting()→UpdateConfigwithdelete_setting: true
For sandbox settings, globally-managed entries (scope = global) are blocked from editing or deletion at the sandbox level.
9. Development Workflow
Build and run
# Build the crate
cargo build -p openshell-tui
# Run the TUI against the active gateway
mise run term
# Run with cargo-watch for hot-reload during development
mise run term:dev
# Format
cargo fmt -p openshell-tui
# Lint
cargo clippy -p openshell-tuiPre-commit
Always run before committing:
mise run pre-commitGateway changes
If you change sandbox or server code that affects the backend, restart or redeploy the gateway for the compute platform you are using.
For Docker-backed local development:
mise run gateway:dockerFor Kubernetes Helm deployments:
helm upgrade --install openshell deploy/helm/openshell --namespace openshellFor Kubernetes, pick up new sandbox images after changing sandbox code by deleting the pod manually so it gets recreated:
kubectl delete pod <pod-name> -n <namespace>Adding a new gRPC call
- Check the proto definitions in
openshell-corefor available RPCs and message types. - Add the call in
lib.rsfollowing the existing pattern (timeout wrapper, error handling, state update). - If the call is triggered by a key press, add a
pending_*flag toAppand handle it in the event loop. - If the call returns streaming data, spawn it as a background task and send results via
Eventvariants.
Adding a new Event variant
- Add the variant to
Eventinevent.rs. - Handle it in the
match events.next().awaitblock inlib.rs. - Update
Appstate as needed from the event data.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

