Repository navigation
Add custom modules with official/custom separation - #3
Closed
arifinsiddiqzisan wants to merge 5 commits into
Closed
arifinsiddiqzisan wants to merge 5 commits into
arifinsiddiqzisan wants to merge 5 commits into
Conversation
…fficial update and reload function and file stracture
Add custom modules with official/custom separation
Owner
|
I will review them all in the day time InshaAllah |
Owner
|
Also please make sure fork the main repo otherwise I also have to create another same pull request |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🧠 Proposed Architecture (Official vs Custom Hard Separation)
1) New Custom Storage (Separate from Official Files)
Add new folders:
Reason:
Official
modules/*.shremain untouched, ensuring thatak update/ak reloadbehavior stays stable.2) Load Order in
core/init.shLoad official modules first:
Then load custom modules:
Before sourcing custom commands, run a conflict guard:
If a custom command name already exists in the official command list:
Skip sourcing that custom command
Mark its status as:
✅ This ensures that if a command later becomes official:
3) Command Registry Utility (Single Source of Truth)
Create file:
Responsibilities
Scan and index:
modules/*.sh(official)custom/modules/*.sh(custom)APIs
🧩 New CLI Commands
ak addA short command to create custom modules.
Flow (fzf-based TUI)
Also collect:
Output Files
ak editEdit existing custom modules.
Features
Show only custom modules (via fzf)
Edit module metadata
Manage commands:
Constraints
.shand.mdfiles automaticallyak customDisplays:
Custom modules
Command status:
🖥 TUI UX Design (fzf-based)
The TUI is implemented as a single-form wizard interface inside the terminal using
fzf.Layout Overview
Title:
Navigation hint:
Status indicator:
Form Fields
The interface presents a structured form:
Actions
At the bottom of the form:
Behavior
Save
Save & Add Another
Cancel
Interaction Model
✅ Fully terminal-compatible
✅ No extra dependencies
✅ Structured form-based input (instead of prompt loops)
✅ Scalable for future fields/extensions
🧱 File Changes Plan
Create
Update
Add routing for:
Load custom modules with conflict guard
Update
Include new commands in help output
Show custom modules tagged as:
Create
Documentation Updates
README.mddocs/src/MANUAL.mddocs/src/contributing.md🔒 Validation Rules
Module Name Validation
Prefer lowercase slug:
Reject if:
Exists in official modules
Exists in custom modules
Matches reserved keywords:
Command Name Validation
For each custom command:
Edit Permissions
🚀 Rollout Phases
Phase 1 (MVP)
ak addwizardPhase 2
ak editfull CRUDPhase 3
Conflict reconciliation after update/reload
Auto-status:
Skip conflicting custom commands
Phase 4
✅ This architecture ensures: