This project is an implementation of a command-line interpreter for an AirBnB clone. The interpreter allows users to create, manage, and interact with various data models, such as User, State, City, Place, Amenity, and Review.
To start the command interpreter, follow these steps:
- Clone the project repository from GitHub.
- Navigate to the project directory in your terminal.
The command interpreter supports various commands to interact with the available data models. Here's a list of commands and their usage:
-
create: Create a new instance of a specified class and save it to the JSON file.
- Usage:
create <class name>
- Usage:
-
show: Print the string representation of an instance based on the class name and ID.
- Usage:
show <class name> <id>
- Usage:
-
destroy: Delete an instance based on the class name and ID (save the change into the JSON file).
- Usage:
destroy <class name> <id>
- Usage:
-
all: Print all string representations of instances based on the class name or all instances.
- Usage:
all [<class name>]
- Usage:
-
update: Update an instance based on the class name and ID by adding or updating an attribute (save the change into the JSON file).
- Usage:
update <class name> <id> <attribute name> "<attribute value>"
- Usage:
-
quit/EOF: Quit the program.
Here are some examples of how to use the command interpreter:
1. Creating a User instance: create BaseModel
2. Showing a User instance by ID: show BaseModel
3. Deleting a User instance by ID: destroy
4. Listing all instances of a class: all BaseModel
5. Updating an instance's attribute: update BaseModel <user BaseModel I.D>
6. Quitting the program: EOF or quit or Ctrl+D
Victor Njeru | Email: ynwvroy
Jonathan Kyule | Email: JMK-WRL