Technical Guide - Lominub44/SigmaOS-legacy GitHub Wiki
SigmaOS Package Development Guide
Package Structure
Each package must contain:
main.py
- Entry point executed by SigmaOSdescription.txt
- Package metadata and requirements
description.txt Format
[description]
Brief package description
[author]
Your name or username
[version]
1.0
[requirements]
colorama
requests
or any other dependencies that your package needs...
SigmaOS Integration
- Packages are stored in
SigmaOS/packages/
directory - SigmaOS executes
main.py
when package name is typed - Use colorama for consistent styling
- Handle keyboard interrupts gracefully
Best Practices
- Always include clear_screen() function
- Show package banner
- Use colorama for styling
- Handle user input safely
- Clean up resources on exit
Example Package Structure
import os
from colorama import Fore, Style, init
def clear_screen():
os.system('cls' if os.name == 'nt' else 'clear')
def show_banner():
clear_screen()
print(f"{Fore.CYAN}╔═══ Package Name ═══╗{Style.RESET_ALL}")
print(f"║ Description ║")
print(f"╚════════════════════╝")
def main():
init(autoreset=True)
show_banner()
# Your code here
if __name__ == "__main__":
main()
Color Guidelines
- Cyan (Fore.CYAN): Banners, headers
- Green (Fore.GREEN): Success messages, prompts
- Yellow (Fore.YELLOW): Warnings, important notes
- Red (Fore.RED): Errors
- White (Fore.WHITE): Regular text
Error Handling
try:
# Your code
except KeyboardInterrupt:
print(f"\n{Fore.RED}Operation cancelled!{Style.RESET_ALL}")
except Exception as e:
print(f"{Fore.RED}Error: {str(e)}{Style.RESET_ALL}")
Package Testing
- put your package-folder in
SigmaOS/packages/
directory. - Open SigmaOS and type the package name to execute.
As soon as your package is finished, feel free to share your package on the official SigmaOS Discord