Skip to content

feat: add a project command menu to the TUI - #2143

Open
notgitika wants to merge 4 commits into
refactorfrom
feat/project-tui-menu
Open

feat: add a project command menu to the TUI#2143
notgitika wants to merge 4 commits into
refactorfrom
feat/project-tui-menu

Conversation

@notgitika

@notgitika notgitika commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

This PR makes project navigable in the TUI. adds the project menu and routes its seven subcommands, each throwing a NotImplementedError until it gets a screen of its own. First PR toward a project create wizard.

Ran all CI checks. Tested the build locally.

image

And when I clicked on create for instance, I see this error

Error: 'agentcore project create' has no interactive screen yet; run 'agentcore project create --help' to use it from the command line

bun run /dist/index.js project also opens up this wizard

@github-actions github-actions Bot added the size/m PR size: M label Aug 28, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added agentcore-harness-reviewing AgentCore Harness review in progress claude-security-reviewing Claude Code /security-review in progress labels Aug 28, 2026
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Aug 28, 2026
`project` was listed in the root TUI menu with no route to match it, so
selecting it fell through to the catch-all HelpScreen — which prints the
launching command's help and exits, leaving a blank frame and no TUI.

Adds the project menu and routes its seven subcommands explicitly. None
has a screen yet, so each reports NotImplementedError via Ink's
exit(error): the TUI tears down, the terminal is restored, and the error
travels the normal CLI path with an exit code.
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Aug 28, 2026

@agentcore-devx-automation agentcore-devx-automation Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AgentCore Harness Review

Verdict: Looks good

The PR does exactly what it says: it plugs the hole where agentcore project [subcommand] in the TUI used to fall through to the catch-all HelpScreen (which prints help and exits, leaving a blank frame), replacing it with an honest NotImplementedError that tears the TUI down via useApp().exit(error) so renderTuiAt's awaited waitUntilExit() rejects and the CLI's normal error path handles it. The reasoning is captured well in the code comments.

Things I checked:

  • PROJECT_COMMANDS in src/components/Root.tsx matches the subcommands registered in src/handlers/project/index.ts (create, add, remove, dev, deploy, status, build).
  • NotImplementedError extends AgentCoreCLIError and defaults exitCode to 1, so the test assertion on exit code === 1 is valid.
  • The ttyTestIO extraction to src/testing/testIO.tsx is a clean move, and the previous inline copy in src/tui/tui.test.tsx was replaced by the import. Defaults (columns=100, rows=40) preserve the original behavior.
  • Test coverage is appropriate: menu listing, reachability from root, esc back, and one test per subcommand plus a dedicated assertion on the error message and exit code.

A couple of nits I'll mention but don't consider blockers:

  • PROJECT_COMMANDS duplicates the router's subcommand list. If someone adds a project subcommand later without updating this array, the new command will silently fall through to HelpScreen again. Fine as an interim, but worth being aware of; if you want to be extra defensive you could derive the list at runtime from the Commander tree the way RouterScreen already does, or add a small sanity test that walks the project router and asserts every subcommand has a route.
  • useEffect(() => { exit(...) }, [exit, command]) slightly diverges from the sibling pattern in HelpScreen (useEffect(exit, [])). Functionally equivalent since exit is stable and command is a route prop, but consistency with the neighboring file wouldn't hurt.

No changes required from my side. Ship it.

@agentcore-devx-automation agentcore-devx-automation Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Aug 28, 2026
@notgitika
notgitika force-pushed the feat/project-tui-menu branch from 51ef172 to c1e480b Compare August 28, 2026 21:35
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Aug 28, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Aug 28, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Aug 28, 2026
@codecov-commenter

codecov-commenter commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.29%. Comparing base (adb02a1) to head (70a9538).

Additional details and impacted files
@@            Coverage Diff            @@
##           refactor    #2143   +/-   ##
=========================================
  Coverage     97.29%   97.29%           
=========================================
  Files           478      479    +1     
  Lines         29642    29673   +31     
=========================================
+ Hits          28840    28871   +31     
  Misses          802      802           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Aug 28, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Aug 28, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Aug 28, 2026
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Aug 28, 2026
The project router had no default handler, so `agentcore project` printed
Commander help and exited 2 instead of opening the menu like every sibling
router. Registers renderTui as its default and threads Core through
createProjectHandler.

Drives the subcommand tests off the compiled router rather than a
hardcoded list, so they cover any subcommand added later and fail if one
is missing a route in Root. Adds coverage for the bare entrypoint, which
the path-mounting screen tests could not catch.
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Aug 28, 2026
@notgitika
notgitika marked this pull request as ready for review August 28, 2026 21:55
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Aug 28, 2026
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Aug 28, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Aug 28, 2026
Ink only writes frames incrementally when interactive (`!isInCi && isTTY`),
so waiting on rendered menu text passed locally and timed out on every CI
platform. Asserts renderTui's TTY guard instead, which reaching at all
proves the group routed to the TUI rather than to Commander help.
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Aug 29, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Aug 29, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants