-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture
jake-chromatir edited this page Aug 9, 2026
·
3 revisions
magmascript/
├── core/ # Framework
│ ├── github.py # Shared GitHub API client + WORKFLOWS map
│ ├── config.py # Config loading (env vars + TOML)
│ ├── output.py # Table/JSON/plain formatters
│ ├── registry.py # Domain registry
│ └── rpc.py # JSON-RPC 2.0 client
├── domains/ # One module per domain
│ ├── mcp/ # MCP server (JSON-RPC)
│ ├── pi/ # Raspberry Pi (SSH)
│ └── gh/ # GitHub (HTTPS)
├── cli.py # CLI dispatcher
├── lib/ # Multi-language wrappers
└── tests/
Each domain is a Python package that:
- Registers itself with
core/registry.py - Provides a
Clientclass with typed methods - Returns dataclass instances (not raw strings)
- Create
domains/mydomain/__init__.py:
from magmascript.domains.mydomain.client import MyClient
from magmascript.core.registry import register_domain
register_domain("mydomain", MyClient)- Create
domains/mydomain/client.py:
class MyClient:
def __init__(self, config=None):
cfg = config or get_config()
# ... setup
def action(self, args):
return typed_result- Create
domains/mydomain/tools.py:
@dataclass
class MyResult:
field: str-
Add dispatch to
cli.pyin themain()function. -
Register in
domains/__init__.py.
The core/github.py module provides a shared GitHub API client used by:
-
ghdomain (direct CLI access) - Future domains that need GitHub operations
Contains the canonical WORKFLOWS map (name → file).