Skip to content

Conversation

@anshumanjadiya1102
Copy link
Member

@anshumanjadiya1102 anshumanjadiya1102 commented Nov 10, 2025

Making MyCMD's own Window and updating installer

Summary by CodeRabbit

Release Notes

  • New Features

    • GUI with dark theme and neon cyan styling
    • Terminal-like interface for command input and output
    • Windows application launcher
  • Chores

    • Configured automated GitHub Actions CI/CD pipeline
    • Streamlined distribution format to single JAR file
    • Updated project configuration and build tools

Added various file types and IDE directories to .gitignore to prevent them from being tracked.
Updated project details and dependencies for MyCMD-GUI.
Removed command-line interface code and added JavaFX GUI launch.
Refactor Command interface to define description and usage methods.
Removed unused methods and variables related to command history and environment variables. Simplified alias management.
This class provides functionality to register and retrieve commands by their names, ensuring case insensitivity.
This class serves as the central execution engine for processing commands.
Implement a developer console mode for debugging commands.
Implement JavaFX application for MyCMD terminal.
Updated build script to use Maven Wrapper and improved output messages.
Updated build script to use Maven Wrapper and simplified the build process.
@github-actions
Copy link
Contributor

🚀 Hi @anshumanjadiya1102!

Thank you for contributing to MyCMD. A maintainer will review your PR shortly. 🎉

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 10, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Refactors MyCMD from a CLI shell to a JavaFX GUI application. Updates Maven configuration with JavaFX dependencies and plugins, adds GitHub Actions CI/CD workflow, introduces new GUI components (MainApp, TerminalController) with FXML layout and CSS styling, reorganizes build scripts, creates launcher scripts, and simplifies the shell infrastructure with updated core classes.

Changes

Cohort / File(s) Summary
CI/CD Pipeline
.github/workflows/build.yml
Introduces GitHub Actions workflow triggering on push/PR to main, building with Maven and uploading JAR artifacts.
Build Configuration
pom.xml, mvnw, mvnw.cmd
Reconfigures Maven project: renames artifactId to MyCMD-GUI, updates version to 1.0.0, replaces Lombok with JavaFX 21 dependencies, updates compiler plugin, replaces jar/spotless plugins with javafx-maven-plugin and maven-shade-plugin; adds Maven wrapper scripts.
Build Scripts
scripts/build-linux.sh, scripts/build-windows.bat
Simplifies build process: switches from mvn to ./mvnw/mvnw.cmd, removes multi-step packaging/jpackage logic, outputs single JAR to dist/MyCMD-GUI.jar.
Project Structure
.gitignore, lib/.gitkeep, launcher/MyCMD.bat
Expands .gitignore patterns for IDE/build artifacts; adds lib directory placeholder; adds Windows batch launcher setting MYCMD_LAUNCHED env var and launching JAR via javaw.
Shell Infrastructure
src/main/java/com/mycmd/Command.java, src/main/java/com/mycmd/CommandRegistry.java, src/main/java/com/mycmd/ShellContext.java, src/main/java/com/mycmd/ShellEngine.java, src/main/java/com/mycmd/StringUtils.java
Refactors core: makes Command's description() and usage() abstract; introduces CommandRegistry for command lookup; simplifies ShellContext to manage only directory and aliases; adds ShellEngine for command execution with error handling; replaces StringUtils Levenshtein logic with simple isEmpty() and join() utilities.
Entry Points
src/main/java/com/mycmd/App.java, src/main/java/com/mycmd/ConsoleShell.java
Redirects App.main to launch JavaFX GUI via Application.launch(MainApp.class) with launcher environment check; adds ConsoleShell for developer REPL-like console access.
GUI Components
src/main/java/com/mycmd/gui/MainApp.java, src/main/java/com/mycmd/gui/TerminalController.java
Introduces MainApp extending Application to initialize shell components, register built-in commands, load FXML, and configure Stage; adds TerminalController to manage terminal UI with input field, output area, and Enter key handler for command execution.
GUI Resources
src/main/resources/com/mycmd/gui/terminal.fxml, src/main/resources/com/mycmd/gui/style.css
Defines FXML layout: AnchorPane with VBox containing TextArea (output) and HBox with prompt label and TextField (input); defines dark CSS theme with cyan accents, Jetbrains Mono font, and gradient background.
Configuration
src/main/resources/com/mycmd/config/default.properties
Adds application defaults: name, version, author, dark theme, font size, accent color, background image, default directory, shell history settings.

Sequence Diagram

sequenceDiagram
    actor User
    participant Launcher as MyCMD.bat
    participant App as App.main()
    participant MainApp as MainApp (JavaFX)
    participant TerminalController
    participant ShellEngine
    participant CommandRegistry

    User->>Launcher: Execute MyCMD.bat
    Launcher->>Launcher: Set MYCMD_LAUNCHED=true
    Launcher->>App: javaw -jar MyCMD-GUI.jar
    
    App->>App: Check MYCMD_LAUNCHED env var
    alt MYCMD_LAUNCHED != true
        App->>App: Print error & exit
    else Valid launch
        App->>MainApp: Application.launch(MainApp.class)
        MainApp->>MainApp: Initialize ShellContext
        MainApp->>MainApp: Initialize CommandRegistry
        MainApp->>MainApp: registerBuiltIns (alias, dir, echo)
        MainApp->>MainApp: Load terminal.fxml
        MainApp->>TerminalController: init(ShellEngine, ShellContext)
        MainApp->>MainApp: Show Stage with scene
        TerminalController->>TerminalController: Display welcome message
        
        loop User interaction
            User->>TerminalController: Type command + Enter
            TerminalController->>TerminalController: Echo input to output
            TerminalController->>ShellEngine: execute(input)
            ShellEngine->>ShellEngine: Resolve command via alias
            ShellEngine->>CommandRegistry: get(commandName)
            CommandRegistry-->>ShellEngine: Return Command
            ShellEngine->>ShellEngine: cmd.execute(args, context)
            ShellEngine-->>TerminalController: Command output
            TerminalController->>TerminalController: Append to output area
        end
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Areas requiring extra attention:

  • pom.xml refactoring: Verify JavaFX version compatibility, Maven plugin configurations (javafx-maven-plugin, maven-shade-plugin), and ensure manifest transformer correctly sets the mainClass.
  • App.java security check: Validate the MYCMD_LAUNCHED environment variable logic and confirm it properly enforces launcher-only execution.
  • ShellContext simplification: Review the removal of history, scanner, and environment variable management to ensure no critical functionality is lost and null/invalid directory checks are sufficient.
  • ShellEngine error handling: Confirm IOException handling and unknown command messaging are appropriate for the GUI context.
  • JavaFX integration: Verify FXML controller injection, stage initialization, and event handler setup in TerminalController and MainApp are correct.
  • Build script changes: Confirm Maven Wrapper invocation works on both Linux and Windows, and that dist directory structure meets deployment requirements.

Poem

🐰 From CLI's command line, we hop to the GUI,
With JavaFX styling under a futuristic sky,
Dark theme and cyan glow, a shell refined,
Build scripts simplified, clean and designed,
MyCMD dances forward, refactored with pride! 🚀

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e43bd32 and 60c9008.

⛔ Files ignored due to path filters (1)
  • src/main/resources/com/mycmd/icons/logo.png is excluded by !**/*.png
📒 Files selected for processing (21)
  • .github/workflows/build.yml (1 hunks)
  • .gitignore (1 hunks)
  • launcher/MyCMD.bat (1 hunks)
  • lib/.gitkeep (1 hunks)
  • mvnw (1 hunks)
  • mvnw.cmd (1 hunks)
  • pom.xml (1 hunks)
  • scripts/build-linux.sh (1 hunks)
  • scripts/build-windows.bat (1 hunks)
  • src/main/java/com/mycmd/App.java (1 hunks)
  • src/main/java/com/mycmd/Command.java (1 hunks)
  • src/main/java/com/mycmd/CommandRegistry.java (1 hunks)
  • src/main/java/com/mycmd/ConsoleShell.java (1 hunks)
  • src/main/java/com/mycmd/ShellContext.java (1 hunks)
  • src/main/java/com/mycmd/ShellEngine.java (1 hunks)
  • src/main/java/com/mycmd/StringUtils.java (1 hunks)
  • src/main/java/com/mycmd/gui/MainApp.java (1 hunks)
  • src/main/java/com/mycmd/gui/TerminalController.java (1 hunks)
  • src/main/resources/com/mycmd/config/default.properties (1 hunks)
  • src/main/resources/com/mycmd/gui/style.css (1 hunks)
  • src/main/resources/com/mycmd/gui/terminal.fxml (1 hunks)

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

🚀 Hi @anshumanjadiya1102!

Thank you for contributing to MyCMD. A maintainer will review your PR shortly. 🎉

@anshumanjadiya1102 anshumanjadiya1102 merged commit 0a64628 into Drive-for-Java:main Nov 10, 2025
2 of 5 checks passed
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.

1 participant