[RFC] feat(cli): Interactive TUI prototype#54
Draft
scoropeza wants to merge 2 commits intoaws-samples:mainfrom
Draft
[RFC] feat(cli): Interactive TUI prototype#54scoropeza wants to merge 2 commits intoaws-samples:mainfrom
scoropeza wants to merge 2 commits intoaws-samples:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[RFC] feat(cli): Interactive TUI prototype
Summary
A full-screen terminal UI (TUI) prototype for
bgagent, built with Ink (React for terminals). Proposes replacing the current text-only CLI with an interactive, tabbed interface that makes managing background coding agents intuitive and discoverable. Uses mock data — not wired to real APIs yet.Demo
Full walkthrough
Watch panel (event streaming + nudge)
What's included
5 panels in a tabbed layout
nnudge,a/dapprove/denya/drespondBranding
UX features
y/nnopens inline input with example textArchitecture
data.ts— abstraction layer over mock data; swap implementations for real APIcontext.tsx— shared React context for approval state + editing lock (useMemo for stable values)constants.ts— single source of truth for colors, icons, labelspeccy-shared.ts— shared pixel rendering + animation sequenceErrorBoundary.tsx— crash recovery with stack trace displayQuality
How to try it
cd cli npm install npm run build npm run tuiWhat's NOT included (next steps)
data.tsto real REST API (replace mock functions with fetch calls)bgagentCLI asbgagent tuicommandTechnical notes — ESM integration
The TUI depends on Ink (React for terminals), figures, and ink-spinner — all of which are ESM-only packages. The existing CLI uses CommonJS (
"module": "CommonJS"intsconfig.json).To avoid disrupting the existing CLI build, the TUI is set up as a separate compilation target within the same workspace:
cli/src/tui/package.json{"type": "module"}— tells TypeScript this directory is ESMcli/src/tui/tsconfig.jsonmodule: "Node16",jsx: "react-jsx",rootDir: "."cli/lib/tui/package.json{"type": "module"}— tells Node to run compiled output as ESMcli/tsconfig.jsonexcludeto skipsrc/tui/**/*andsrc/mock/**/*cli/package.jsontui:compileandtuiscriptsBuild commands:
npm run compile— builds the existing CLI (unchanged, CommonJS)npm run tui:compile— builds the TUI separately (ESM, JSX)npm run tui— compiles + runs the TUINew dependencies added to
cli/:ink@^5.2.1,ink-spinner,react,figures,strip-ansi(runtime)@types/react(dev)When the CLI eventually migrates to ESM (which is the direction the Node ecosystem is heading), the TUI's separate tsconfig can be merged back into the main one and the
package.jsonshims removed.Design decisions
figureslibrary for iconsKnown issues
Related
docs/design/INTERACTIVE_AGENTS.md(rev 6)docs/design/PHASE3_CEDAR_HITL.md(rev 3)bgagent-tui-design.mdin the prototype workspace