Overview
The sunpeak pull command downloads resources from the Sunpeak repository using a tag. This is useful for retrieving production builds, rolling back to previous versions, or syncing resources across environments.
sunpeak pull -r myorg/my-app -t prod
You must be logged in to use this command. Run sunpeak login first.
The --repository option is required because sunpeak pull is typically run from your MCP server directory, not from the source repository.
How It Works
The pull command:
- Looks up resources by tag and repository (optionally filtered by name)
- Downloads the JavaScript bundle for each resource
- Saves the resources and metadata to the output directory
$ sunpeak pull -r myorg/my-app -t prod
Pulling resources from repository "myorg/my-app" with tag "prod"...
Found 2 resource(s):
Resource: search
Title: Search Widget
URI: ui://search-mjdoy6rs
Tags: prod, v1.2.0
Created: 2024-01-15T10:30:00Z
Downloading JS file...
✓ Saved search.js
✓ Saved search.json
Resource: dashboard
Title: Dashboard Widget
URI: ui://dashboard-abc123
Tags: prod
Created: 2024-01-15T11:00:00Z
Downloading JS file...
✓ Saved dashboard.js
✓ Saved dashboard.json
✓ Successfully pulled 2 resource(s) to .
Options
| Option | Short | Description |
|---|
--repository <owner/repo> | -r | Repository name (required) |
--tag <name> | -t | Tag name to pull (required) |
--name <name> | -n | Resource name to filter by (optional) |
--output <path> | -o | Output directory (defaults to current directory) |
--help | -h | Show help message |
Usage Examples
Pull All Resources with Tag
sunpeak pull -r myorg/my-app -t prod
Pull Specific Resource by Name
sunpeak pull -r myorg/my-app -t prod -n review
Pull Specific Version
sunpeak pull -r myorg/my-app -t v1.0.0
Custom Output Directory
sunpeak pull -r myorg/my-app -t prod -o ./builds
Output Files
The pull command creates two files for each resource:
dist/
├── search.js # The JavaScript bundle
└── search.json # Resource metadata
The metadata file contains:
{
"uri": "ui://search-mjdoy6rs",
"name": "search",
"title": "Search Widget",
"description": "A search interface",
"mimeType": "text/html+skybridge",
"_meta": {
"openai/widgetDomain": "example.com",
"openai/widgetCSP": {
"connect_domains": ["api.example.com"],
"resource_domains": ["cdn.example.com"]
}
}
}
Use Cases
Rollback to Previous Version
# Pull a known-good version
sunpeak pull -r myorg/my-app -t v1.0.0
# Deploy it
sunpeak deploy
Sync Across Environments
# Pull from staging
sunpeak pull -r myorg/my-app -t staging
# Push to production
sunpeak push --tag prod
Inspect Production Build
# Download current production build
sunpeak pull -r myorg/my-app -t prod -o ./review
Pull a Single Resource
# Pull only the "search" resource from production
sunpeak pull -r myorg/my-app -t prod -n search