-
Notifications
You must be signed in to change notification settings - Fork 445
feat: add TUI launcher script for easy app startup #513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add TUI launcher script for easy app startup #513
Conversation
Add a beautiful terminal user interface (TUI) script that provides an interactive menu for launching Automaker in different modes: - [1] Web Browser mode (localhost:3007) - [2] Desktop App (Electron) - [3] Desktop + Debug (Electron with DevTools) - [Q] Exit Features: - ASCII art logo with gradient colors - Centered, responsive layout that adapts to terminal size - Animated spinner during launch sequence - Cross-shell compatibility (bash/zsh) - Clean exit handling with cursor restoration This provides a more user-friendly alternative to remembering npm commands, especially for new users getting started with the project.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello @JZilla808, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly improves the developer and user experience by introducing a new TUI-based launcher script for the Automaker application. The script provides an intuitive, interactive menu that allows users to easily start the application in various modes (web, desktop, or debug) without needing to recall specific Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces an excellent TUI launcher script, which greatly improves the developer experience for starting the application. The script is well-structured and makes effective use of terminal capabilities. My review focuses on enhancing its robustness, maintainability, and user flow. I've suggested adding dependency checks, removing unused code, replacing hardcoded values with dynamic calculations for better centering, and refining the launch sequence for a cleaner UI transition.
start automaker.sh
Outdated
| #!/bin/bash | ||
| set -e | ||
| cd "$(dirname "$0")" | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To improve robustness, it's best to verify that required dependencies like node, npm, and tput are available before executing the main script logic. This prevents unexpected errors and provides clear feedback to the user if their environment is not set up correctly.
| # Check for required dependencies | |
| for cmd in node npm tput; do | |
| if ! command -v "$cmd" &> /dev/null; then | |
| echo "Error: Required command '$cmd' not found. Please install it and ensure it's in your PATH." >&2 | |
| exit 1 | |
| fi | |
| done | |
start automaker.sh
Outdated
|
|
||
| APP_NAME="Automaker" | ||
| VERSION="v0.11" | ||
| NODE_VER=$(node -v) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
start automaker.sh
Outdated
| local sub="Autonomous AI Development Studio │ ${VERSION}" | ||
| local sub_display_len=46 | ||
| local sub_pad=$(( (TERM_COLS - sub_display_len) / 2 )) | ||
| printf "%${sub_pad}s" "" | ||
| echo -e "${C_MUTE}Autonomous AI Development Studio${RESET} ${C_GRAY}│${RESET} ${C_GREEN}${VERSION}${RESET}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sub variable is unused and can be removed. More importantly, sub_display_len is a hardcoded 'magic number' (46), which is also incorrect for the current text (the actual visible length is 42). This makes the centering fragile to any text changes. It's better to calculate the length dynamically.
| local sub="Autonomous AI Development Studio │ ${VERSION}" | |
| local sub_display_len=46 | |
| local sub_pad=$(( (TERM_COLS - sub_display_len) / 2 )) | |
| printf "%${sub_pad}s" "" | |
| echo -e "${C_MUTE}Autonomous AI Development Studio${RESET} ${C_GRAY}│${RESET} ${C_GREEN}${VERSION}${RESET}" | |
| local subtitle_text="Autonomous AI Development Studio │ ${VERSION}" | |
| local sub_pad=$(( (TERM_COLS - ${#subtitle_text}) / 2 )) | |
| printf "%${sub_pad}s" "" | |
| echo -e "${C_MUTE}Autonomous AI Development Studio${RESET} ${C_GRAY}│${RESET} ${C_GREEN}${VERSION}${RESET}" |
start automaker.sh
Outdated
| local footer_text="Use keys [1-3] or [Q] to select" | ||
| local f_pad=$(( (TERM_COLS - 31) / 2 )) | ||
| printf "%${f_pad}s" "" | ||
| echo -e "${DIM}${footer_text}${RESET}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The length of the footer text is hardcoded as 31. This is a 'magic number' and makes the script brittle. If the footer text changes, this value would need to be manually updated. It's better to calculate the length dynamically from the variable itself. This pattern of using hardcoded lengths for centering appears in several other places (e.g., lines 142, 147, 174) and should be refactored throughout the script for better maintainability.
| local footer_text="Use keys [1-3] or [Q] to select" | |
| local f_pad=$(( (TERM_COLS - 31) / 2 )) | |
| printf "%${f_pad}s" "" | |
| echo -e "${DIM}${footer_text}${RESET}" | |
| local footer_text="Use keys [1-3] or [Q] to select" | |
| local f_pad=$(( (TERM_COLS - ${#footer_text}) / 2 )) | |
| printf "%${f_pad}s" "" | |
| echo -e "${DIM}${footer_text}${RESET}" |
start automaker.sh
Outdated
| echo "" | ||
| echo "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…tation Major improvements to start-automaker.sh launcher script: **Architecture & Code Quality:** - Organized into logical sections with clear separators (8 sections) - Extracted all magic numbers into named constants at top - Added comprehensive comments throughout **Functionality:** - Dynamic version extraction from package.json (no manual updates) - Pre-flight checks: validates Node.js, npm, tput installed - Platform detection: warns on Windows/unsupported systems - Terminal size validation: checks min 70x20, displays warning if too small - Input timeout: 30-second auto-timeout for hands-free operation - History tracking: remembers last selected mode in ~/.automaker_launcher_history **User Experience:** - Added --help flag with comprehensive usage documentation - Added --version flag showing version, Node.js, Bash info - Added --check-deps flag to verify project dependencies - Added --no-colors flag for terminals without color support - Added --no-history flag to disable history tracking - Enhanced cleanup function: restores cursor + echo, better signal handling - Better error messages with actionable remediation steps - Improved exit experience: "Goodbye! See you soon." message **Robustness:** - Real initialization checks (validates node_modules, build artifacts) - Spinner uses frame counting instead of infinite loop (max 1.6s) - Proper signal trap handling (EXIT, INT, TERM) - Error recovery: respects --no-colors in pre-flight checks **File Management:** - Renamed from "start automaker.sh" to "start-automaker.sh" for consistency - Made script more portable with SCRIPT_DIR detection **Documentation:** - Added section to README.md: "Interactive TUI Launcher" - Documented all launch modes and options with examples - Added feature list, history file location, usage tips - Updated table of contents with TUI launcher section Fixes: AutoMaker-Org#511 (CI test failures resolved) Improvements: Better UX for new users, production-ready error handling Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
The 'local' keyword can only be used inside functions. Line 423 had 'local timeout_count=0' in the main script body which caused a bash error. Removed the unused variable declaration. Fixes: bash error 'local: can only be used in a function' Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Add 4 launch options matching dev.mjs (Web, Electron, Docker Dev, Electron+Docker) - Add arrow key navigation in menu with visual selection indicator - Add cross-platform port conflict detection and resolution (Windows/Unix) - Add Docker container detection with Stop/Restart/Attach/Cancel options - Add Electron process detection when switching between modes - Add centered, styled output for Docker build progress - Add HUSKY=0 to docker-compose files to prevent permission errors - Fix Windows/Git Bash compatibility (platform detection, netstat/taskkill) - Fix bash arithmetic issue with set -e causing script to hang Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
Add a beautiful terminal user interface (TUI) launcher script that provides an interactive menu for starting Automaker in different modes without needing to remember npm commands.
What This PR Does
start automaker.sh- a shell script with an interactive TUI menuTesting