π οΈ CLI
The cli module provides a command-line interface for rapid feature development and project scaffolding in the codex-bot framework.
π§ The Why
Standardized Scaffolding
In a feature-based architecture, every module must follow a strict directory structure (handlers, logic, ui, resources, etc.). Manually creating these folders and files is error-prone and tedious. The codex-bot CLI automates this process, ensuring that every new feature is consistent with the framework's standards from the start.
Rapid Prototyping
By using pre-defined templates, developers can generate a fully functional "Hello World" feature (including FSM states, keyboards, and orchestrators) in seconds. This allows for faster iteration and prototyping of new bot capabilities.
π The Flow
- Command: The developer runs
codex-bot create-feature <name> [--type redis]. - Template Loading: The CLI loads the appropriate
.py.tplfiles from the library's internaltemplatesdirectory. - Variable Injection: The CLI injects the feature name, class names, and keys into the templates.
- File Creation: A new directory structure is created in the project's
features/folder, populated with the generated files. - Integration: The developer is prompted to add the new feature path to the
INSTALLED_FEATURESlist in their settings.
πΊοΈ Module Map
| Component | Description |
|---|---|
| π API Reference | Technical details for CLI commands. |
| π create-feature | Scaffolding command for new features. |
Last Updated: 2025-02-07