This is a project template for a greenfield Java project, Twin.
It’s named after the concept of a “digital twin” — a task companion that helps manage your tasks efficiently.
Given below are instructions on how to set it up and run it.
Prerequisites:
- JDK 17
- The latest version of IntelliJ IDEA
-
Open IntelliJ
If you are not on the welcome screen, click File → Close Project to close any existing project. -
Open the project
- Click Open.
- Select the project directory and click OK.
- If there are any further prompts, accept the defaults.
-
Configure the JDK
- Go to File → Project Structure → Project.
- Set Project SDK to JDK 17 (not any other version).
- Set Project language level to SDK default.
-
Run the main class
- Locate the file:
src/main/java/Twin.java - Right-click it and select Run 'Twin.main()'.
- Locate the file:
Twin is a simple chatbot that helps you manage tasks such as todos, deadlines, and events.
ℹ️ Notes about the command format:
-
Words in
UPPER_CASEare parameters to be supplied by the user.
e.g. intodo TASK_DESCRIPTION,TASK_DESCRIPTIONis a parameter which can be used astodo read book. -
Items in square brackets are optional.
e.g.event DESCRIPTION /from START /to ENDrequires all three parts, but commands likelisttake no parameters. -
Parameters can be in any order if clearly labelled with
/from,/to,/by. -
Extraneous parameters for commands that do not take any (such as
list,bye) will be ignored.
e.g. if the command specifieslist 123, it will be interpreted aslist.
Adds a simple task without any date/time.
Format: todo TASK_DESCRIPTION
Examples:
todo read book
todo buy groceries
Adds a task that must be done before a specific date/time.
Format: deadline TASK_DESCRIPTION /by DEADLINE
Examples:
deadline submit report /by Monday
deadline return book /by 2025-10-10
Adds an event that starts and ends at specific times.
Format: event TASK_DESCRIPTION /from START_TIME /to END_TIME
Examples:
event project meeting /from 2pm /to 4pm
event orientation camp /from 2025-08-01 /to 2025-08-03
Shows a list of all tasks in the chatbot.
Format: list
Marks an existing task as completed.
Format: mark INDEX
INDEXmust be a positive integer (1, 2, 3, …).- The index refers to the number shown in the task list.
Example:
mark 1
Marks an existing task as not done yet.
Format: unmark INDEX
Example:
unmark 2
Deletes a task from the list.
Format: delete INDEX
Examples:
list
delete 2 (deletes the 2nd task shown in the list)
Exits the chatbot.
Format:
bye
Twin automatically saves the task list to your hard disk after any command that modifies the data (e.g. add, delete, mark).
There is no need to save manually.
| Action | Format | Examples |
|---|---|---|
| List | list |
— |
| Add Todo | todo TASK_DESCRIPTION |
todo read book |
| Add Deadline | deadline TASK_DESCRIPTION /by DEADLINE |
deadline submit report /by Monday |
| Add Event | event TASK_DESCRIPTION /from START /to END |
event meeting /from 2pm /to 4pm |
| Mark | mark INDEX |
mark 1 |
| Unmark | unmark INDEX |
unmark 2 |
| Delete | delete INDEX |
delete 2 |
| Exit | bye |
— |