Skip to content

[Feature] Implement a Command-Line Interface (CLI) Master Menu using Textual #1421 - #1675

Merged
steam-bell-92 merged 3 commits into
steam-bell-92:mainfrom
knoxiboy:feat/issue-1421-cli-menu
Jul 12, 2026
Merged

[Feature] Implement a Command-Line Interface (CLI) Master Menu using Textual #1421#1675
steam-bell-92 merged 3 commits into
steam-bell-92:mainfrom
knoxiboy:feat/issue-1421-cli-menu

Conversation

@knoxiboy

@knoxiboy knoxiboy commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

📝 Description

What: Implements a unified, interactive Terminal UI (TUI) master menu using the Textual framework, replacing the previous input()-based console launcher.

Why: Currently, to run any mini-project (game, utility, math tool), a user must manually navigate to the folder and execute the specific script. This TUI provides a single entry point (python main.py) to browse, search, filter, and launch all projects interactively.

How:

  • Dynamic scanning: main.py dynamically scans the games/, math/, security/, and utilities/ directories at startup, matching discovered scripts against projects_registry.json for rich metadata (emoji, difficulty, description). For scripts not in the registry, it falls back to AST-based docstring extraction.
  • Sidebar + List layout: The TUI features a category sidebar (All, Games, Math, Security, Utilities) and a scrollable project list with a detail panel showing name, description, difficulty, category, and file path.
  • Real-time search: An input field at the top filters projects by name or description as you type.
  • Subprocess launching: Selecting a project suspends the Textual app (App.suspend()), runs the script via subprocess.run() in the full terminal, and resumes the TUI on completion.
  • Keyboard shortcuts: g/m/c/u/a for category switching, s for search focus, q to exit.
  • Robust test suite compatibility: Restructured main.py to keep scanning logic and helpers fully decoupled from Textual imports. This allows unit tests (run in CI with only pytest installed) to import and verify scanning logic without throwing import errors.

Files changed:

File Change
main.py Rewritten to use Textual TUI with dynamic project scanning
requirements.txt Added textual>=0.50.0
tests/test_main_tui.py New unit tests for scanning logic and helpers

🔗 Linked Issue

Closes #1421


📋 Contribution Checklist

  • I have verified that my files are placed in the correct directory.
  • I have tested my changes thoroughly on my local machine.
  • GSSoC 2026: I have been formally assigned to this issue and noted it above.

Copilot AI review requested due to automatic review settings July 12, 2026 14:28
@vercel

vercel Bot commented Jul 12, 2026

Copy link
Copy Markdown

@knoxiboy is attempting to deploy a commit to the Anuj's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@steam-bell-92
steam-bell-92 merged commit 2f098a5 into steam-bell-92:main Jul 12, 2026
3 of 4 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🎉 Thank you for your contribution!

Your Pull Request has been merged successfully.
Thanks again for your support! 🙌

@knoxiboy
knoxiboy deleted the feat/issue-1421-cli-menu branch July 14, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Implement a Command-Line Interface (CLI) Master Menu using Textual

3 participants