Quick Start β
This guide takes you from zero to a running MicroCoreOS application with your first custom endpoint. Estimated time: 2 minutes.
π Recommended: Using uv (Fastest) β
uv is the recommended, ultra-fast tool for managing Python projects and dependencies in MicroCoreOS.
bash
# 1. Initialize project
uv init my_app
cd my_app
# 2. Add microcoreos dependency
uv add microcoreos
# 3. Scaffold directory structure
uv run microcoreos new .
# 4. Boot server
uv run main.pyπ¦ Alternative: Using standard pip β
If you prefer standard pip and virtual environments:
bash
# 1. Install microcoreos package
pip install microcoreos
# 2. Scaffold new project
microcoreos new my_app
cd my_app
# 3. Boot server
microcoreos runπ System Inspection & Plan Commands β
Run the CLI inspection tools anytime:
bash
uv run microcoreos status # Displays active plan & context manifest freshness
uv run microcoreos plan validate # Validates offline plan rulesβοΈ Write Your First Plugin β
Add a custom greeting plugin in a single file. Create domains/hello/plugins/greeting_plugin.py:
python
from microcoreos import BasePlugin
class GreetingPlugin(BasePlugin):
def __init__(self, http, logger):
self.http = http
self.logger = logger
async def on_boot(self):
self.http.add_endpoint("/hello", "GET", self.execute, tags=["Hello"])
async def execute(self, data: dict, context=None):
self.logger.info("Greeting executed!")
return {"success": True, "data": "Hello from MicroCoreOS!"}Restart the server:
bash
uv run main.pyVisit http://localhost:6060/hello or inspect http://localhost:6060/docs (Swagger UI). You will receive:
json
{
"success": true,
"data": "Hello from MicroCoreOS!"
}Zero Wiring Needed
The Kernel discovered GreetingPlugin by convention, injected http and logger by name, and bound the route. You never edited main.py or a router file.
Next Steps β
- First Plugin (Tutorial) β Hello World β CRUD β Events, step by step.
- Elastic Deployment β Swap SQLite for PostgreSQL or Redis Streams with zero plugin changes.
- Testing & MicroCoreBench β Learn how to run unit tests, mutation testing (
mutmut), and load tests.