Skip to content

Drive-for-Java/MyCMD

πŸ’» MyCMD – A Custom Command Prompt in Java

Build Java License Platform

MyCMD is a fully custom command prompt implemented in Java.
It mimics the behavior of Windows cmd.exe with commands like dir, cd, echo, mkdir, del, and more β€” plus it has its own installer.

Meet our CMD-builders


πŸ“š Documentation & Command Reference

For a complete guide detailing the syntax, arguments, and options for every command, please see the full COMMANDS.md file.


MyCMD/ ┣ README.md # Project description, badges, usage ┣ pom.xml # Maven build config ┣ src/ ┃ β”— main/ ┃ β”— java/ ┃ β”— com/ ┃ β”— mycmd/ ┃ ┣ App.java # Main entry point (starts the shell) ┃ ┣ ShellContext.java # Stores current working dir, state ┃ ┣ Command.java # Interface for all commands ┃ β”— commands/ # All custom command classes ┃ ┣ DirCommand.java ┃ ┣ CdCommand.java ┃ ┣ EchoCommand.java ┃ ┣ MkdirCommand.java ┃ ┣ RmdirCommand.java ┃ ┣ CopyCommand.java ┃ ┣ DelCommand.java ┃ ┣ TypeCommand.java ┃ ┣ ClsCommand.java ┃ ┣ HelpCommand.java ┃ ┣ ExitCommand.java ┃ β”— VersionCommand.java ┣ icons/ ┃ β”— mycmd.ico # App/installer icon ┣ scripts/ ┃ ┣ build-windows.bat # Build + package EXE + run installer script ┃ β”— build-linux.sh # Build + package for Linux (deb/rpm) ┣ installer/ ┃ β”— mycmd.iss # Inno Setup script for Windows installer β”— dist/ # Output folder (auto-created after build) ┣ bin/ ┃ β”— MyCMD.exe # Wrapped executable (via Launch4j or jpackage) ┣ lib/ ┃ β”— dependencies.jar # Extra JAR dependencies (if any) β”— setup.exe # Generated installer (from Inno Setup)



---

## πŸš€ Key Features ✨

<div align="center">

| Feature | Description |
|---------|-------------|
| βœ… **Windows-like Commands** | Supports `dir`, `cd`, `mkdir`, `del`, `copy`, `type`, `cls` |
| ⚑ **Extensible** | Easily add new commands via Java classes |
| πŸ–₯️ **Executable Packaging** | Packaged into `.exe` using **Launch4j** |
| πŸ› οΈ **Installer Wizard** | Simple setup using **Inno Setup** |
| 🌐 **Cross-Platform** | Works on **Windows** and **Linux** (via `jpackage`) |

</div>

---


## πŸ“¦ Requirements

To build MyCMD you need:

- [Java JDK 17+](https://adoptium.net/)  
- [Apache Maven](https://maven.apache.org/)  
- [Launch4j](https://launch4j.sourceforge.net/) (for `.exe` wrapping)  
- [Inno Setup](https://jrsoftware.org/isinfo.php) (for Windows installer)  

*(Linux users can use `jpackage` instead of Launch4j/Inno Setup.)*

---

## πŸ› οΈ Build Instructions
Building MyCMD is simple and automated for both Windows πŸͺŸ and Linux 🐧 platforms

### πŸ”Ή Windows
```bash
scripts\build-windows.bat

πŸ“¦ This script will automatically:

1.🧩 Build the JAR using Apache Maven

2.βš™οΈ Wrap it into an .exe using Launch4j

3.πŸͺ„ Generate a setup.exe installer via Inno Setup

Final Output

dist/
 ┣ bin/MyCMD.exe
 ┣ lib/dependencies.jar
 β”— setup.exe

Linux

chmod +x scripts/build-linux.sh
./scripts/build-linux.sh

This will build a .deb or .rpm package using jpackage.

πŸ–₯️ Usage

After installation, run:

MyCMD

You can now use commands like:

> dir
> cd ..
> mkdir test
> echo Hello World!
> type file.txt
> del file.txt
> help
> exit

🧩 Extending MyCMD

Note

There are many commands left like ls and Ping Command

🀝 Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create! πŸ’ͺ

We welcome all kinds of improvements β€” from fixing bugs πŸ› to adding new commands βš™οΈ.

πŸͺœ Steps to Contribute

  1. 🍴 Fork the repository
  2. 🌿 Create a new branch
    git checkout -b feature/your-feature-name
    

πŸ“œ License

🧾 Apache License 2.0
This project is open-source and available for anyone to use, modify, and share under the terms of the Apache License.

✨ Attribution is appreciated but not required.
πŸ“Ž For complete terms, check the LICENSE file.