Taskforge TUI Guide
This document covers the current Taskforge TUI user workflow and developer architecture.
It is intended for:
- Operators who run
taskforge tuiday to day - Contributors extending screens, actions, and themes
What the TUI Is
The TUI is a keyboard-first interface over the Taskforge API, built with Bubble Tea.
It provides:
- Live snapshot browsing for workflows, runs, triggers, events, secrets, and tokens
- In-place actions (run/toggle/archive/update/create) through keybindings and modals
- Context tabs for Overview, JSON, Steps, and Logs
- A command palette for navigation, actions, themes, and network simulation
- A run inspector for deep log and step exploration
Launching the TUI
From the CLI:
taskforge tui
The command lives in apps/cli/internal/cli/tui.go and starts the Bubble Tea program in alt-screen mode.
Config and Auth
The TUI uses the same CLI config as other commands.
Config shape (apps/cli/internal/config/config.go):
serverUrltokenprofile(optional)theme(optional)
Default config path is OS-specific (via os.UserConfigDir), typically under taskforge/config.json.
Layout and Focus Model
Primary layout:
- Left sidebar (navigation)
- Main panel (table + dashboard/list content)
- Context drawer (bottom panel, collapsible)
- Footer (hints + paging)
Focus panes:
sidebarmaincontext
Focus controls:
tabnext paneshift+tabprevious paneleft/rightdirectional pane jump
Context drawer:
ctrl+jtoggles collapsed/expanded
Global Keybindings
Defined in apps/cli/internal/tui/app/keymap.go.
Core:
q,ctrl+cquit?toggle help viewctrl+kopen command palette/table search modectrl+fcontext search modectrl+rretry refresh (when stale/error)gjump topGjump bottomscycle sort columnStoggle sort direction
Pane controls:
tabnext paneshift+tabprev panectrl+jtoggle context drawer
Context tab controls (when context pane focused):
[/hprevious tab]/lnext tab1Overview2JSON3Steps4Logs
Main/context scrolling:
- Main panel:
alt+up,alt+down,pgup,pgdown,home,end - Context panel:
j,k,pgup,pgdown,ctrl+u,ctrl+d,home,end
Screen Reference
Screen data and column definitions are in apps/cli/internal/tui/screens/screens.go.
Dashboard
Shows summary cards and recent runs table.
Columns:
- Run ID
- Workflow
- Status
- Started
Actions:
- Mostly read-only; use palette for navigation and global actions
Workflows
Columns:
- Name
- Active
- Latest Version
- Triggers
- Last Run
- Updated
Actions:
rrun selected workflowetoggle active/archive statenrename selected workflowccreate trigger (for selected workflow)darchive workflow (confirmation modal)fcycle status scope (all -> active -> inactive)
Runs
Columns:
- Run ID
- Workflow
- Status
- Trigger
- Started
- Duration
Actions:
enteropen run inspector
Triggers
Columns:
- Name
- Type
- Workflow
- Active
- Created
Actions:
etoggle active/archive statenupdate selected triggerccreate triggerdarchive trigger (confirmation modal)fcycle status scope (all -> active -> inactive)
Events
Columns:
- Event ID
- Trigger
- Type
- Received
- Linked Run
Actions:
- Read-only view in current implementation
Secrets
Columns:
- Name
- Description
- Created
Actions:
ccreate secretnupdate selected secretdhard-delete selected secret (typed confirmation phrase)
Security behavior:
- Secret values are never shown in context
- Value input is masked in modals
API Tokens
Columns:
- Name
- Scopes
- Created
- Last Used
- Status
Actions:
dcurrently shows an unavailable warning (revoke action not implemented in TUI yet)
Context Panel and Tabs
Context content generation is in apps/cli/internal/tui/screens/context.go.
Tabs:
- Overview: entity summary/details
- JSON: structured payloads and config
- Steps: step timeline/details for runs
- Logs: step logs for runs
Notes:
- Steps/Logs tabs are meaningful for
RunsandDashboard-selected runs - Other views show an unsupported message for those tabs
Modals and Mutation Flows
Modal openers and behavior:
- Openers:
apps/cli/internal/tui/app/model_modals.go - Validation/helpers:
apps/cli/internal/tui/app/model_modal_helpers.go - Modal update/submit:
apps/cli/internal/tui/app/model_modal_update.go
Mutation commands:
apps/cli/internal/tui/app/model_mutations.go
Destructive confirmation semantics:
- Workflow archive: phrase
ARCHIVE <workflow-id> - Trigger archive: phrase
ARCHIVE <trigger-id> - Secret delete: phrase
DELETE <secret-id>
Archive behavior:
- Workflow/trigger "delete" in TUI is archive semantics (inactive), aligned with current UX copy
Command Palette
Open with ctrl+k.
Palette features:
- Navigate screens
- Execute actions for selected row
- Toggle auto-refresh
- Clear filters
- Theme switching
- Network profile switching
- CLI handoff shortcuts for workflow authoring
- Recent command history (top entries)
Palette disables commands that do not apply in current context and shows reason text.
Implementation: apps/cli/internal/tui/app/model_palette.go.
Run Inspector
Open from Runs screen with enter.
Implementation: apps/cli/internal/tui/app/inspector.go.
Behavior:
- Left column: steps list
- Right column: logs viewport
tabswitches focus between columnswtoggles wrap mode/starts log searchescexits inspector
Sorting, Filtering, and Status Scope
Filtering and table state logic:
apps/cli/internal/tui/app/model_view_state.goapps/cli/internal/tui/app/model_table.goapps/cli/internal/tui/screens/screens.go
Capabilities:
- Full-table text filtering via
/ - Per-view sort column and sort direction memory
- Status scope cycling for Workflows and Triggers only
Refresh and Network Profiles
Runtime behavior is in apps/cli/internal/tui/app/model_runtime.go.
Profiles:
- Fast
- Normal
- Slow
- Flaky
Effects:
- API fetch delay simulation
- Auto-refresh interval
- Failure simulation for flaky profile
Surface states:
- loading
- refreshing
- success
- empty
- error
- stale
Theme System
Theme registry and style mapping:
apps/cli/internal/tui/styles/theme.go
Available themes:
- taskforge
- dracula
- one-dark-pro
- rose-pine-moon
- solarized-dark
- solarized-light
- nord
- gruvbox-dark
- tokyo-night
- catppuccin
- fallout
- retro-amber
Theme can be changed:
- From command palette (
ctrl+k-> Themes) - Persisted to config as
theme
Known Limitations
- API token revoke flow is not wired in TUI actions yet.
- Worker count/workspace indicators are currently static placeholders in the UI model.
- TUI is keyboard-first; mouse-specific interactions are not a primary path.
Troubleshooting
API appears offline
- Verify server URL and token in config.
- Use
ctrl+rto retry from stale/error states.
Context text readability issues (theme-specific)
- Switch theme from palette to compare.
- If needed, set a safer theme in config (
taskforge,nord,one-dark-pro).
Weird ANSI artifacts in table rows
- Ensure you are running the latest built CLI binary.
- Rebuild:
cd apps/cli
go build -o ../../taskforge ./cmd/taskforge
Developer Architecture
TUI packages:
apps/cli/internal/tui/app: state machine, input routing, modals, mutations, rendering orchestrationapps/cli/internal/tui/screens: row builders, sorting semantics, context builders, lookup helpersapps/cli/internal/tui/components: reusable table/modal/cards rendering primitivesapps/cli/internal/tui/styles: theme tokens and style mappingapps/cli/internal/tui/layout: responsive layout computationapps/cli/internal/tui/data: normalized in-memory data modelapps/cli/internal/tui/utils: text helpers (wrap, filter, JSON formatting)
Data loading pipeline:
apps/cli/internal/tui/app/data_source.gofetches paginated API data, normalizes todata.Store, and emits snapshot messages
Contributing to the TUI
Add a new theme
- Add token set in
styles.ThemeRegistry(apps/cli/internal/tui/styles/theme.go) - Add palette labels and entries in
apps/cli/internal/tui/app/model_palette.go - Optionally add a font hint in
apps/cli/internal/tui/app/view_chrome.go - Verify table/context readability in both selected and non-selected states
Add a new screen
- Add
ViewIDand registration inapps/cli/internal/tui/app/model.go - Implement rows/sort/context in
apps/cli/internal/tui/screens - Wire any screen-specific actions in
apps/cli/internal/tui/app/model_input.go - Add tests and update this doc
Add a new mutation action
- Add opener/modal wiring in
model_modals.goand modal update/validation helpers - Add API mutation command in
model_mutations.go - Add palette action entry if relevant
- Ensure success/error toast + refresh behavior is correct
Build and Test (CLI)
cd apps/cli
go test ./...
go build -o ../../taskforge ./cmd/taskforge