From 167585265e2d4fc8c67c8676c31f68cb2fec68a6 Mon Sep 17 00:00:00 2001 From: kalzu rekku Date: Mon, 5 Aug 2024 22:28:02 +0300 Subject: [PATCH] Wrote better README. --- README.md | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1e7dd51..f6c65eb 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,67 @@ # core_daemon -My attempt of creating python daemon handler. \ No newline at end of file +My attempt of creating python daemon handler. +This was written with Python 3.11 + +## Features + +- Core daemon that runs continuously and manages modules +- Interactive shell for user interaction +- Dynamic loading and unloading of modules +- Custom command execution from loaded modules +- Auto-completion for commands in the shell +- Ability to upgrade the core daemon +- Modules are loaded from an 'modules' directory + +## Structure + +dynamic-module-manager/ +├── core_daemon.py +├── daemon_cli.py +├── modules/ +│ ├── extra_commands.py +│ └── http_service.py +└── README.md + +## Getting Started + +1. Start the core daemon: + +python3 core_daemon.py + + +2. In a separate terminal, start the shell: + +python3 shell.py + +## Usage + +Once in the shell, you can use the following commands: + +- `list_available`: List all available modules in the 'modules' directory +- `load `: Load a module +- `unload `: Unload a module +- `list`: List all currently loaded modules +- `upgrade`: Upgrade the core daemon (restarts the daemon in current implementation) +- Any custom commands provided by loaded modules + +Use tab completion to see available commands and modules. + +## Creating New Modules + +To create a new module: + +1. Create a new Python file in the 'modules' directory +2. Define your module as a class +3. Implement at least one of these functions `initialize()`, `shutdown()`, `get_commands()` + +See `modules/extra_commands.py` and `modules/http_service.py` for an example of how to structure a module. + + +# Todo + +- Maybe add ability to search for modules in directories set by a command + +- Create module to add auth for the cli connections... + +- Add error handling to core_daemon and daemon_cli...