Files
gh-johnlindquist-badger-235…/commands/create-badge-app.md
2025-11-30 08:28:30 +08:00

59 lines
1.6 KiB
Markdown

---
description: Create a new MonaOS app with proper structure, template code, and icon
---
# Create Badge App
Create a complete MonaOS application structure with all required files.
## What to do
1. Ask the user for the app name if not provided
2. Validate the app name (lowercase, no spaces, alphanumeric with underscores/hyphens)
3. Create the following directory structure:
```
{app_name}/
├── __init__.py # Main app file from template
├── icon.png # 24x24 icon
└── assets/ # Optional assets directory
```
4. Use the app template from `badger-marketplace/badger-2350-dev/templates/app_template.py`
5. Replace `{{APP_NAME}}` placeholders with the actual app name
6. Copy the icon template from `badger-marketplace/badger-2350-dev/templates/icon_template.png`
7. Create an empty `assets/` directory
## After creation
Tell the user:
**Next Steps:**
1. **Test your app locally:**
```bash
mpremote run {app_name}/__init__.py
```
2. **Edit the code:**
- Open `{app_name}/__init__.py` in your editor
- Replace TODO comments with your app logic
- Add button handlers, animations, and content
3. **Deploy to badge when ready:**
```bash
/deploy-to-badge {app_name}
```
4. **Customize the icon:**
- Edit `{app_name}/icon.png` (must be 24x24 pixels)
- Use any image editor or pixel art tool
Your app structure is ready! The template includes examples of:
- Button handling for all 5 buttons
- Simple animation with frame counter
- Text and shape drawing
- State management pattern
Check the `examples/` directory in this plugin for working examples like `hello_world` and `meditation_timer`.