A Java‑based, offline‑first, console‑driven library management CLI. Written in pure Java, no external DB, data persisted to CSV/text files.
- Java 17+ (or your GraalVM distribution set as
JAVA_HOME) - Gradle 8+
For dev, use the utility psh script to run
.\run.ps1 --help
-
Build your native image or Jar:
./gradlew build
-
(Optional, for Jar) Create a launcher script named
ebenlib:#!/usr/bin/env bash java -jar /full/path/to/ebenlib.jar "$@"
-
Make it executable and move it into your
$PATH:chmod +x ebenlib sudo mv ebenlib /usr/local/bin/
Now you can run:
ebenlib --help
ebenlib auth signin
ebenlib --interactiveebenlib <command> [options]
| Command | Description |
|---|---|
--interactive |
Launch the interactive, menu‑driven UI |
auth signin |
Sign in to your account |
auth signup |
Register a new Reader or Librarian |
auth signout |
Sign out of the current session |
user list |
List all users (Librarian only) |
user delete |
Delete a user account |
user promote |
Promote a user to Librarian |
user demote |
Demote a Librarian to Reader |
user suspend |
Suspend a user’s account |
user activate |
Reactivate a suspended user |
book add |
Add a book to inventory (Librarian only) |
book update |
Update book details |
book delete |
Remove a book from inventory |
book list |
List all books |
book search |
Search books by title/author/ISBN |
book stats |
Show stats for a given book (times borrowed, overdue count, etc.) |
borrow request |
Request to borrow a book |
borrow approve |
Approve a borrow request (Librarian only) |
borrow reject |
Reject a borrow request (Librarian only) |
borrow return |
Return a borrowed book |
borrow list |
List all pending borrow requests |
borrow history |
Show your personal borrowing history |
profile view |
View your user profile |
profile update |
Update your username |
profile password |
Change your password |
system init |
Initialize or reset system data (Librarian only) |
system stats |
Show system usage statistics |
system overdue |
List all overdue items and fines |
system report |
Generate system‑wide reports (most borrowed, top fines, category distribution) |
report top‑borrowed |
Report: top borrowed books |
report top‑fines |
Report: borrowers with highest outstanding fines |
report category‑distribution |
Report: inventory distribution by category |
test |
Run the built‑in console UI tests |
--help, -h |
Show this help message |
# Sign up new Librarian
ebenlib auth signup
# Sign in
ebenlib auth signin
# Add a new book
ebenlib book add --title="1984" --author="Orwell" --copies=5
# Search books
ebenlib book search --title="Potter"
# Borrow a book
ebenlib borrow request --book-id=42
# Run the interactive menu
ebenlib --interactive./Library-Management-System/*
├─ app/*
| ├─ src/*
| | ├─ main/*
| | | ├─ java/*
| | | | └─ org/*
| | | | └─ ebenlib/*
| | | | ├─ cli/*
| | | | | ├─ AuthHandler.java
| | | | | ├─ CommandRouter.java
| | | | | ├─ ConsoleThemeTest.java
| | | | | ├─ ConsoleUI.java
| | | | | ├─ InteractiveMenus.java
| | | | | ├─ InteractiveShell.java
| | | | | ├─ TablePrinter.java
| | | | | └─ User.java
| | | | └─ App.java
| | | └─ resources/*
| | | ├─ session.txt
| | | └─ users.csv
| | └─ test/*
| | ├─ java/*
| | | └─ org/*
| | | └─ ebenlib/*
| | | └─ AppTest.java
| | └─ resources/*
| └─ build.gradle
├─ gradle/*
| ├─ wrapper/*
| | ├─ gradle-wrapper.jar
| | └─ gradle-wrapper.properties
| └─ libs.versions.toml
├─ .gitattributes
├─ .gitignore
├─ demo.png
├─ gradle.properties
├─ gradlew
├─ gradlew.bat
├─ README.md
├─ run.ps1
└─ settings.gradle-
Adding new commands:
- Extend
CommandRouter.route(...). - Implement a new handler class (e.g.
BookHandler). - Wire it in
CommandRouterand add stubs inInteractiveMenus.
- Extend
-
Interactive UI: Uses ANSI colors, pagination, spinners—fully themable via
ConsoleTheme. -
Native packaging: For lightning‑fast startup, use GraalVM’s
native-imageto compile into a standaloneebenlibbinary. See GraalVM docs.
- Implement actual logic behind the stubs (
BookHandler,BorrowHandler, etc.) - Add JUnit tests under
/testto cover each service - Integrate fine calculation, overdue monitoring, and report generation
- Fork this repo
- Create your feature branch (
git checkout -b feature/xyz) - Commit your changes (
git commit -m "feat: add XYZ") - Push to your branch (
git push origin feature/xyz) - Open a Pull Request
Happy coding! 🚀
