ContactCS is a desktop application designed for NUS Computer Science freshmen to help them efficiently manage and locate essential contact details. The app is designed to store and organize contacts for key individuals relevant to their academic journey, including:
The callout boxes below are used in documentation to enhance readability and provide important contextual information.
Info Box: Provides additional information or context.
Tip Box: Offers helpful tips or suggestions.
Caution Box: Alerts you to potential issues or problems that may arise.
Ensure that Java 17 is installed on your computer.
java -version
java version "17.0.1" Download the application
.jar file from here.
Set up the home folder
.jar file to this folder.Run the application
cd) to the folder where you placed the .jar file.
For Windows users, type:
cd \path\to\your\folder
Caution:
Replace path\to\your\folder with the actual path. e.g. cd C:\Documents\ContactCS
To find the actual path to your folder:
Press the Windows key + S to open the search bar, type in the name of the file, and right-click the file that appears. Click on copy path.
For Mac users, type:
cd /path/to/your/folder
Caution:
Replace path/to/your/folder with the actual path. e.g. cd ~/Documents/ContactCS
To find the actual path to your folder:
java -jar contactcs.jar
A GUI similar to the screenshot below should appear in a few seconds. Note how the app contains some sample data.
Type the command in the command box and press Enter to execute it. e.g. typing help and pressing Enter will open the help window.
Some example commands you can try:
list : Lists all contacts.
add n/John Doe p/98765432 e/johnd@example.com r/CS1101S : Adds a contact named John Doe who takes CS1101S to the Address Book.
delete 3 : Deletes the 3rd contact shown in the current list.
clear : Deletes all contacts.
exit : Exits the app.
Refer to the Features below for details of each command.
Once ContactCS is running, you’ll see the main interface divided into several key panels, as illustrated below. Here’s an overview of each panel:
Command Box: You can type and execute commands here .
Result Display Box: Shows the outcome of the commands you enter, including success messages, errors, and other feedback.
Contact List: Displays the list of contacts, allowing easy access to contact information.
Command History Window: Contains a history of commands that modify the contact list, enabling you to quickly refer to recent modifications.
Menu (File/Help): Provides options such as exiting the application and accessing help documentation.
Data Storage Location Footer: Shows the directory where the contact data are saved, providing quick access to storage information.

Info: Notes about the command history
The Command History Window only displays commands that directly modify the contact list, including:
add - Adds a new contact.edit - Edits details of an existing contact.delete - Removes specified contacts.clear - Clears all contacts from the list.Commands that do not alter the contact data, such as list, find, help, and exit, are not shown in the command history window.
This helps keep the command history focused on actions that impact the contact list.
Info: Notes about the command format
Words in UPPER_CASE are the parameters to be supplied by the user.
e.g. in add n/NAME, NAME is a parameter which can be used as add n/John Doe.
Items in square brackets are optional.
e.g n/NAME [t/TAG] can be used as n/John Doe t/friend or as n/John Doe.
Items in square brackets and with + after them can be used zero or more times.
e.g. [t/TAG]+ can be used as (i.e. 0 times), t/friend, t/friend t/family etc.
Items in round brackets and with + after them can be used one or more times.
e.g. (t/TAG)+ can be used as t/friend, t/friend t/family etc.
| operator signifies OR relationship.
e.g. n/NAME | r/MODULECODE means n/NAME or r/MODULECODE
Parameters can be in any order.
e.g. if the command specifies n/NAME p/PHONE_NUMBER, p/PHONE_NUMBER n/NAME is also acceptable.
Extraneous parameters for commands that do not take in parameters (such as list, exit and clear) will be ignored.
e.g. if the command specifies exit 123, it will be interpreted as exit.
If you are using a PDF version of this document, be careful when copying and pasting commands that span multiple lines as space characters surrounding line-breaks may be omitted when copied over to the application.
helpHelp command supports two input formats which allows for more flexibility when you want to seek help:
Format: help [COMMAND_KEYWORD]
Shows a message explaining the usage of the specified command keyword
Example:
Format: help
Shows a message and a pop-up window showing the full list of help messages, and an external link to the full user guide.
Example:
addAdds a person to the address book.
Format: add n/NAME (p/PHONE_NUMBER | e/EMAIL | p/PHONE_NUMBER e/EMAIL) [r/MODULECODE[-ROLETYPE]]+ [a/ADDRESS] [t/TAG]+ [d/DESCRIPTION]
NAME can take any values and can not be blank.PHONE_NUMBER is almost a free-form text field with minimal validation.MODULECODE should be valid NUS module codes such as 'CS2040S' or 'MA1521'.ROLETYPE can be one of the following: student, ta, tutor, prof, professor. It defaults to student if not specified.r/MODULECODE[-ROLETYPE] parameter means that the person has the role for this module (e.g. r/CS1101S-student means that the person is a student of CS1101S).r/CS1101S-student r/CS1101S-prof is not allowed).EMAIL should be a valid email address.ADDRESS can take any values and can not be blank.TAG can take any alphanumeric values and can not be blank.DESCRIPTION can take any values but cannot exceed 500 characters.For more explanation on the format and design of each input field, refer to the input format section.
Info: Duplicate Handling
Info: Input data containing prefixes
add ... d/For a/b testing contains a/ which is reserved), the message will be split into multiple fields.add ... d/For 'a/b testing).Examples:
add n/John Doe p/98765432 e/johnd@example.com r/CS1101S.

add n/Jane Doe p/81234567 e/janed@example.com r/CS1101S-TA r/CS2040S.listShows a list of all persons in the address book.
Format: list
editEdits an existing person in the address book.
The module-role pairs can be edited by adding and deleting.
Format: edit INDEX r/+(MODULECODE[-ROLETYPE])+
Please note that the first + should be typed as is while the second + is the multiplicity syntax explained here.
INDEX. The index refers to the index number shown in the displayed person list." ".STUDENT will be the default.Examples:
edit 1 r/+CS2103T-Prof adds role "professor of CS2103T" to the first person.edit 1 r/+CS1101S MA1521-TA adds role "Student of CS1101S" and "TA of MA1521" to the first person.Caution: Common Mistakes
+ sign before the module-role pair.
The subsequent pairs should not have a + sign before them. i.e. r/+CS1101S +MA1521-TA is unnecessary and will cause an error.r/. i.e. r/+CS1101S r/+MA1521-TA is unnecessary and will cause an error.Format: edit INDEX r/-(MODULECODE[-ROLETYPE])+
INDEX. The index refers to the index number shown in the
displayed person list." ".edit 1 r/-MA1521 will delete MA1521-Student, MA1521-TA or MA1521-Prof, whichever is present.Examples:
edit 1 r/-CS2103T deletes any role related to module CS2103T from the first person.edit 1 r/-CS1101S-Student MA1521-TA deletes the role "Student of CS1101S" and "TA of MA1521" from the first person.Caution:
Student by default.Except for the module-role pairs, all other fields can only be edited by complete replacement.
Format: edit INDEX [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [t/TAG]+ [d/DESCRIPTION]
INDEX. The index refers to the index number shown in the displayed person list. The index must be a positive integer 1, 2, 3, …t/ without
specifying any tags after it.d/ without specifying any description after it.Examples:
edit 1 p/91234567 e/johndoe@example.com Edits the phone number and email address of the 1st person to be 91234567 and johndoe@example.com respectively.edit 2 n/Betsy Crower t/ Edits the name of the 2nd person to be Betsy Crower and clears all existing tags.findThe find command allows you to locate persons by their names, module-role pairs, tags or any combinations of them.
Finds persons whose names contain any of the given keywords.
Format: find (n/KEYWORD)+
hans will match HansJohn DoeJohn Doe will not match John David DoeHan will match HansOR search).
e.g. find n/Hans n/Bo will match Hans Gruber, Bo YangExamples:
Finds persons whose module-role pairs contain any of the given keywords.
Format: find (r/KEYWORD)+
CS2103T-Prof will search for the module CS2103T with the role Professor.cs2103t-student will match CS2103T-Student.STUDENT will be assumed. For example, find r/CS2103T will return all students taking CS2103T.Examples:
find r/CS2103T returns all students taking the module CS2103T
find r/CS2103T-Prof r/CS1101S returns all persons with the role Prof in CS2103T or Student in CS1101S
Finds persons whose tags contain any of the given keywords.
Format: find (t/KEYWORD)+
Friends will match friendsclass will match classmatesExamples:
find t/office returns all contacts whose tags contain word office
find t/classmates t/friends returns all contacts whose tags contain either classmates or friends
Finds persons whose names, module-role pairs and tags contain any combination of the given keywords.
Format: find [chained] (n/KEYWORD | r/KEYWORD | t/KEYWORD)+
Persons matching at least one name keyword (if provided) AND at least one module-role keyword (if provided) AND at least one tag keyword (if provided) will be returned.
If chained is specified, chained find will be used.
Chained Find
The Chained Find feature allows you to narrow down previous search results by applying additional filters,
making it easier to locate specific entries that meet multiple criteria.
How to Use Chained Find
Start with an Initial Search:
Apply Additional Filters with find chained:
Example
find n/John and hit enter. You will see all entries with "John" in their names;find chained n/Doe and hit enter. This time you will see only the entries that contain both "John" and "Doe" in their names.Example:
find n/Martin n/Boyd r/cs1101s-prof r/cs1231s-prof t/favorite return all persons whose name are either Martin or Boyd, and assumes either CS1101S Professor or CS1231S Professor, and has the tag favorite.
deleteDeletes the specified person from the address book.
Format: delete (INDEX)+
Examples:
list followed by delete 1 2 3 deletes the 1st, 2nd and 3rd person in the address book.find n/Betsy followed by delete 1 deletes the 1st person in the results of the find command.clearClears all contacts from the address book.
Format: clear
undoUndoes the effect done by the latest data-modifying command, if any.
Format: undo
undo when there's nothing to undo, GUI will remind you about this
and no effect would be applied to the address book.Examples:
delete command,
you can revert this change by input undo command.

clear command,
you can restore the whole address book using undo command as well.undo as well.redoRedoes the latest undone modification on contact data, if any.
Format: redo
redo when there's nothing to redo, GUI will remind you about this
and no effect would be applied to the address book.

Examples:
redo after undo the change to restore it back.
exitExits the program.
Format: exit
ContactCS data are saved in the hard disk automatically after any command that changes the data. There is no need to save manually.
ContactCS data are saved automatically as a JSON file [JAR file location]/data/contactcs.json. Advanced users are welcome to update data directly by editing that data file.
Caution:
If your changes to the data file makes its format invalid, ContactCS will discard all data and start with an empty data file at the next run. Hence, it is recommended to take a backup of the file before editing it.
Furthermore, certain edits can cause the ContactCS to behave in unexpected ways (e.g., if a value entered is outside the acceptable range). Therefore, edit the data file only if you are confident that you can update it correctly.
[coming in v2.0]Details coming soon ...
NAME fieldIn our application, we understand that everyone's names can have various characters and symbols, thus we decided that as long as it is not a blank string, it is considered acceptable.
PHONE_NUMBER fieldThe PHONE_NUMBER field (specified in the add or edit commands) is defined as a string where, if split by spaces, at least one of the resulting tokens is a valid phone number.
Definition of a valid phone number
In our application, the concept of a valid phone number is defined as:
Some valid phone numbers include +6581234567, 81234567, or +44-1234567.
Some invalid phone numbers include +6 5 8 1 2 3 4 5 6 7, or 8123p4567.
Some valid PHONE_NUMBER values include 81234567, 81234567 (handphone), or 81234567 (office 1) 91234567 (office 2).
Since a contact may have different phone numbers at the same time, such as mobile, office, home etc, and any length of annotation to differentiate between them,
we decide not to enforce any input length restriction on this field, to offer you more flexibility when taking down and annotating phone numbers of a contact.
Caution: To allow more flexibility in the input format, we have to sacrifice some validation checks. As such, it is important to ensure that the phone number you input is correct.
EMAIL fieldThe EMAIL field accepts any string that is a valid email address.
Note that the email address does not need to contain a period(.) to be considered valid. For example, example@domain is considered valid.
MODULE_ROLE fieldThe MODULE_ROLE field represents the role of a contact, such as CS1101S Student, CS1231S Tutor or MA1522 Professor and so on.
It consists of two sub-fields: MODULECODE and ROLETYPE.
MODULECODE fieldThe MODULECODE field refers to the module codes of modules in NUS, and is defined as at least one letter followed by at least one number
and lastly ended by an optional sequence of letters.
This field is case-insensitive.
Some valid module code inputs include CS1231S, CS1231, CFG2002MY and DMA1201CH.
Take note that even though the modules that can be taken by NUS Y1 CS Students are quite limited, we recognize that they may take on double majors/minors, or courses from DYOC (Design Your Own Course) Scheme, hence we do not enforce strict validation to check whether the provided module code represents a valid NUS CS module and only checks on its basic format. Since some courses (e.g. DYOC, Global Industry Insights) may have potentially longer module code, we do not enforce input length restriction either. The onus is on you to ensure that the module code provided is a real module code in NUS.
ROLETYPE fieldThe ROLETYPE field refers to the role assumed by a person in a module, and currently can be any of student, professor or tutor.
This field is case-insensitive.
Acronyms can be used for easier input:
Take note that each role type only represents a single role, and you should define the role type of a person based on the most accurate description of this person's role. For example, if a professor is also the tutor of the course, it is better to specify the role of this contact as the professor of this course instead of tutor. Similarly, even though it is unlikely for a contact to be a professor and a student at the same time, we do not enforce strict validation on this to give you more flexibility in annotating your contact and avoid potential input issues in rare scenario due to overzealous validation.
ADDRESS fieldThe ADDRESS field can be used to refer to the address of any location related to a contact, such as home, office, consultation venue etc.
Since the length of address input may differ drastically because of the nature of the location and the complexity in its address name structure, we do not enforce restriction on the input length and as long as the input is not blank, it is considered as a valid address.
Some valid ADDRESS values include COM3-01-20, #05-03, Blk 211, Any Place Street 123, Singapore 123456, Utown Residence #12-34 etc.
TAG fieldThe TAG field allows you to group contacts. you can later use the find by tag feature to query them more easily.
For more detail on find by tag feature, refer to find contacts by tag section.
Examples of TAG values include friends, office and classmates.
DESCRIPTION fieldThe DESCRIPTION field aims to provide you a simple way to annotate a contact with some basic information for easy reference in the future.
For example, you can use it to record down how you feel about a professor's way of teaching, or remember the important birthday of a friend in NUS SOC or even zoom link of a lecture/tutorial session taught by a professor/tutor.As you can see, we try to provide as much flexibility to you as possible to allow you to record any short pieces of information about the contact, but we also want it to be short. Hence, we restrict the input size of the description to be 500 characters which should be enough for most users.
Q: How do I transfer my data to another computer?
A: Install the app in the other computer and overwrite the empty data file it creates with the file that contains the data of your previous ContactCS home folder.
preferences.json file created by the application before running the application again.help command (or use the Help menu, or the keyboard shortcut F1) again, the original Help Window will remain minimized, and no new Help Window will appear. The remedy is to manually restore the minimized Help Window.
| Action | Format, Examples |
|---|---|
| Add | add n/NAME (p/PHONE_NUMBER | e/EMAIL | p/PHONE_NUMBER e/EMAIL) [r/MODULECODE[-ROLETYPE]]+ [a/ADDRESS] [t/TAG]+ [d/DESCRIPTION] e.g., add n/James Ho p/22224444 e/jamesho@example.com r/CS1101S a/123, Clementi Rd, 1234665 t/friend t/colleague d/A good guy |
| Clear | clear |
| Delete | delete (INDEX)+e.g., delete 3 or delete 1 3 5 |
| Edit | edit INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [t/TAG]+ [r/(+|-)(MODULECODE[-ROLETYPE])+] [d/DESCRIPTION]e.g., edit 2 n/James Lee e/jameslee@example.com r/+CS2030S CS1101S-TA |
| Find | find [chained] (n/KEYWORD | r/KEYWORD | t/KEYWORD)+e.g., find chained n/James n/Jake r/CS1101S r/MA1521 t/friends t/classmates |
| Undo | undo |
| Redo | redo |
| List | list |
| Help | help [COMMAND_KEYWORD]e.g., help add or help |
| Exit | exit |