A CLI interface to visualize and manage your Hive data without the need for a Flutter app
Usage:
While Hive Shell provides a streamlined interface, it assumes that developers have familiarity with their data structures and the names of the boxes they wish to interact with. This knowledge empowers developers to swiftly access and modify their Hive boxes, simplifying the development and debugging processes.
Commands:
General:
--version
or-v
: Displays the version of Hive Shell.
hshell --version
--help
or-h
: Displays the available commands and their descriptions.
hshell --help
Hive Box Interaction:
-
Add Data:
- Usage:
hshell --path=<path_to_hive_file> add --key=<key_name> --value=<value>
- Usage:
-
Update Data:
- Usage:
hshell --path=<path_to_hive_file> update --key=<key_name> --value=<new_value>
- Usage:
-
Delete Data:
- Usage:
hshell --path=<path_to_hive_file> delete --key=<key_name>
- Usage:
-
List Data:
- Usage:
hshell --path=<path_to_hive_file> datas
- Usage:
-
Backup Hive Box:
- Usage:
hshell --path=<path_to_hive_file> backup --destination=<backup_location>
- Usage:
-
Restore from Backup:
- Usage:
hshell --path=<path_to_hive_file> restore --source=<backup_file_location>
- Usage:
Specifics:
-
The tool uses
adb
(Android Debug Bridge) to interact with devices. Therefore, ensure you haveadb
installed and accessible from your command line. -
Restoring from a backup currently replaces the original box file entirely. Future implementations may allow for a merge approach, where developers can determine how data should merge in the case of conflicts between the backup and the original data.
-
While working with the tool, make sure you are providing the correct box path, especially when using operations that modify data, to prevent unintended data loss.
Conclusion:
Hive Shell is a powerful utility for developers working with Hive in their Flutter applications. By integrating this tool into their workflow, developers can ensure a smoother and more efficient development process.