Myop CLI
The Myop CLI is a command-line tool for creating, developing, and deploying Myop components — isolated, independently deployable UI modules that integrate into any host application.
npm install -g myop
# or use directly
npx myop create
Workflow
Build a component in three steps — create, develop, deploy:
| Step | Command | What happens |
|---|---|---|
| Create | npx myop create | Scaffolds index.html + myop.config.json, installs AI skills, starts dev server |
| Develop | npx myop dev | Local dev server on port 9292 with hot reload |
| Deploy | npx myop push | Uploads to Myop platform — live instantly, no redeploy needed |
Component Public API
Every Myop component communicates through exactly 2 global functions:
| Function | Direction | Purpose |
|---|---|---|
myop_init_interface(data) | Host → Component | Receive data, render UI |
myop_cta_handler(action, payload) | Component → Host | Send user actions back |
Types are defined in a <script type="myop/types"> block with TypeScript interfaces — used by auto-generated packages and AI coding assistants.
Learn more about component development →
Dev Server
Start a local development server with file watching and instant HMR:
npx myop dev # Single component
npx myop dev -m # Monorepo mode — multiple components
- Port 9292 — Component preview with hot reload
- Port 9293 — Management dashboard
- Monorepo mode — Serve multiple components simultaneously
Learn more about the dev server →
Host Integration
Embed Myop components in any framework with the official SDKs:
import { MyopComponent } from "@myop/react";
<MyopComponent
componentId="your-component-id"
data={{ title: "Hello", items: ["a", "b"] }}
onItemSelected={({ itemId }) => console.log(itemId)}
/>
All SDKs support typed event handlers, data binding, preloading, auto-sizing, custom loaders/fallbacks, and enableLocalDev() for local development.
Learn more about host integration →
Push & Pull
Deploy components and download them from the Myop platform:
npx myop push # Deploy to Myop
npx myop pull <componentId> # Download component
npx myop list # Browse, search, batch pull/push
- First push assigns a
componentId(UUID) and saves it tomyop.config.json - Subsequent pushes add new versions — live instantly
myop listprovides interactive search with multi-select for batch operations
Learn more about push & pull →
AI Integration
Teach AI coding assistants how to build Myop components and give them platform access:
npx myop train # Install AI agent skills (30+ assistants)
npx myop mcp # Configure MCP server (Claude Code, Cursor, Windsurf, Copilot)
myop train installs SKILL.md files using the Agent Skills standard — works with Claude Code, Cursor, Windsurf, VS Code Copilot, Kiro, Goose, Augment, Cline, and 30+ more.
myop mcp configures the Myop MCP server so your AI assistant can upload, list, and read components directly.
Learn more about AI integration →
All Commands
| Command | Description |
|---|---|
myop create | Create a new component |
myop dev | Start dev server with HMR |
myop push | Deploy component to Myop |
myop pull | Download component from Myop |
myop list | Browse and batch operations |
myop train | Install AI agent skills |
myop mcp | Configure MCP server |
myop login | Authenticate with Myop |
myop logout | Clear credentials |
myop whoami | Show current user |