Skip to content

ZekOo33/Command-Line-Interpreter-CLI-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Mini-Command-Line-Interpreter

mini-cli is a lightweight, cross-platform command-line interface implemented in Java. It mimics core Unix shell functionalities while remaining fully portable on Windows, macOS, and Linux.

mini-cli

A minimal, cross-platform command-line interface written in Java.
mini-cli provides basic shell functionality such as navigating directories, listing files, copying data, zipping/unzipping, and more β€” all implemented from scratch without relying on system shell commands.


πŸš€ Features

βœ… Core Shell Commands

Command Description
pwd Show current working directory
cd <path> Change directory (supports absolute & relative paths)
ls List directory contents
cat <file> Print file contents
wc <file> Count lines, words, characters
cp <src> <dest> Copy files
rm <file> Delete a file
mkdir <dir> Create directory
rmdir <dir> Remove directory
touch <file> Create an empty file
zip <zipname> <files...> Create a zip archive
unzip <zipfile> Extract a zip file
help Show help menu

🧱 Architecture

The project is organized into modular components: src/ β”œβ”€β”€ Terminal.java # main loop, command dispatcher β”œβ”€β”€ Parser.java # tokenizing & argument parsing β”œβ”€β”€ Commands/ # commands implementation └── Utils/ # helpers (path resolver, zip utils, IO utils)

βœ… Clear separation of concerns

  • Parser handles tokenizing commands (supports quoting "text with spaces").
  • Executor maps commands β†’ functions.
  • FileSystemUtils ensures safe path handling for all OS environments.
  • ZipUtils wraps Java zip APIs with safe and simple usage.

πŸ“¦ Installation

1. Clone the repository

git clone https://github.com/zekooo69/Command-Line-Interpreter-CLI-.git
cd Command-Line-Interpreter-CLI-.git

2. Compile

Using Gradle:

./gradlew build


Or using javac:

javac -d out src/**/*.java

3. Run
java -cp out Terminal

πŸ–₯️ Usage Example
> pwd
C:/Users/Zaki

> ls
src  README.md  build.gradle

> mkdir test
> cd test
> touch hello.txt
> cat hello.txt

⭐ Support If you find the project helpful, consider giving the repository a star on GitHub!

About

mini-cli is a lightweight, cross-platform command-line interface implemented in Java. It mimics core Unix shell functionalities while remaining fully portable on Windows, macOS, and Linux.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages