Push & Pull
Push — Deploy a Component
myop push uploads the component to the Myop platform. After a successful push, the component is live immediately — no rebuild or redeploy of the host application needed.
# Push using componentId from myop.config.json
npx myop push
# Push to a specific component ID (overrides config)
npx myop push <componentId>
What happens during push
- Reads
myop.config.jsonto identify the component - If a
componentIdargument is passed, it overrides the config - Detects the entry point:
- Single-file mode —
index.htmlin the root - Multi-file mode —
dist/index.html(runsnpm run buildfirst)
- Single-file mode —
- Authenticates (prompts for login if needed)
- Uploads the HTML via a presigned URL
- Confirms the upload
First push vs subsequent pushes
First push:
- Assigns a
componentId(UUID) and saves it tomyop.config.json - Adds the
organizationfield tomyop.config.json - The component appears on the Myop Dashboard
Subsequent pushes:
- Adds a new version to the existing component
- The latest version goes live immediately
- Previous versions remain accessible
Dashboard URL
After pushing:
https://dashboard.myop.dev/dashboard/2.0/component/<componentId>
Pull — Download a Component
myop pull downloads a component's latest version from the Myop platform.
# Pull using componentId from myop.config.json
npx myop pull
# Pull a specific component by ID
npx myop pull <componentId>
# Pull to a custom output path
npx myop pull <componentId> -o ./components/sidebar/index.html
What happens during pull
- Determines
componentIdfrom the argument ormyop.config.json - Authenticates (prompts for login if needed)
- Fetches the component HTML from Myop
- Writes the HTML to the output path
- Creates or updates
myop.config.jsonwith component metadata
Output path logic
- If
-o <path>is specified — writes to that path - If
dist/index.htmlexists — writes there - Otherwise — writes to
index.html
Parent directories are created automatically.
Use cases
- Clone a remote component —
myop pull <id>in an empty directory createsindex.html+myop.config.json - Sync latest version —
myop pullin an existing component directory gets the latest remote version - Download to custom path — use
-oflag
List — Browse & Batch Operations
myop list provides interactive search, multi-select, and batch pull or push for all components in your organization.
# Interactive browse
npx myop list
# Specify organization
npx myop list --org <orgId>
How it works
- Authenticates and loads your organizations
- Resolves which org to use:
--org <orgId>flag takes precedence- Otherwise uses the saved default from
~/.myop/preferences.json - If only one org, uses it automatically
- If multiple orgs, prompts for selection
- Fetches all components
- Shows a searchable list — type to filter by name, press Enter to select, repeat
- When done, choose:
- Pull — downloads all selected components in parallel, each into its own subdirectory with
index.html+myop.config.json - Push — scans local directories for matching
componentIds and uploads in parallel
- Pull — downloads all selected components in parallel, each into its own subdirectory with
Batch pull example
Clone an entire environment:
mkdir my-components && cd my-components
npx myop list
# Type to search, select components, choose Pull
# Each component gets its own subdirectory:
# ./sidebar/index.html + myop.config.json
# ./chart/index.html + myop.config.json
# ./modal/index.html + myop.config.json
Batch push example
Push all local changes at once:
cd my-components
npx myop list
# Select the components you've modified, choose Push
# Scans for matching componentIds in local directories
# Uploads all in parallel
Organization memory
The selected organization is saved to ~/.myop/preferences.json and reused automatically on subsequent runs. Use --org <orgId> to switch.
Authentication
Push, pull, and list all require authentication. If you're not logged in, the CLI prompts automatically.
# Log in (opens browser for OAuth)
npx myop login
# Check who you're logged in as
npx myop whoami
# Log out
npx myop logout
Credentials are stored at ~/.myop/credentials.json with 0o600 permissions. Tokens refresh automatically when expired.