Simply git clone this repository.
The console can be opened at the project-level directory with the following command:
./console.py
A new console with the prefix (hbnb)
will open.
The console has the following existing classes:
- Amenity
- BaseModel
- City
- Place
- Review
- State
- User
<class>
used below, is meant to be substituted for the class names above.
The console can perform the following commands:
create <class>
- Creates a new instance in the
file.json
file. Its ID will be printed.
- Creates a new instance in the
show <class> <id>
- Shows all data of this instance as found in
file.json
.
- Shows all data of this instance as found in
destroy <class> <id>
- Deletes all data pertaining to this instance from
file.json
.
- Deletes all data pertaining to this instance from
all
- Shows all data for all instances in
file.json
.
- Shows all data for all instances in
all <class>
- Shows all data for all instances of
<class>
infile.json
.
- Shows all data for all instances of
update <class> <id> <attribute> <value>
- Updates the instance with the specified attribute and value. The attribute and the value are not restricted in terms of what they can be.
The commands above can also be invoked with the following input:
<class>.create()
<class>.show(<id>)
<class>.destroy(<id>)
<class>.all()
<class>.update(<id>, <attribute>, <value>)
Use help <command>
for additional information on the commands above.