Skip to main content

Overview

The sunpeak push command uploads your built MCP Resources to the Sunpeak repository, making them available for deployment and version management.
sunpeak push [file] [options]
You must be logged in to use this command. Run sunpeak login first.

Prerequisites

Before pushing:
  1. Login - Run sunpeak login to authenticate
  2. Build - Run sunpeak build to create production bundles

How It Works

The push command:
  1. Finds all built resources in dist/
  2. Reads metadata from *.json files (name, title, description, mimeType)
  3. Uploads each resource to the Sunpeak repository
  4. Optionally assigns a tag for version management
Resource names must be unique within a repository. If you push a resource with a name that already exists, it will update the existing resource. The resource name is the name field in your .json file.
$ sunpeak push
Pushing 2 resource(s) to repository "myorg/my-app"...

 Pushed search (id: abc123)
 Pushed dashboard (id: def456)

 Successfully pushed 2 resource(s).

Arguments

ArgumentDescription
fileOptional JS file to push (e.g., dist/carousel.js). If not provided, pushes all resources from dist/

Options

OptionShortDescription
--repository <owner/repo>-rRepository name (defaults to git remote origin)
--tag <name>-tTag to assign to pushed resources (can be specified multiple times)
--help-hShow help message

Usage Examples

Push All Resources

Push all resources from the dist/ directory:
sunpeak push

Push a Single Resource

Push a specific resource file:
sunpeak push dist/carousel.js

Push with Tag

Tag resources for versioning or environment management:
sunpeak push --tag v1.0.0
sunpeak push --tag staging

Push with Multiple Tags

Apply multiple tags in a single push:
sunpeak push --tag v1.0.0 --tag latest

Specify Repository

Override the repository name (useful for CI/CD or monorepos):
sunpeak push --repository myorg/my-app

Combined Options

sunpeak push -r myorg/my-app -t staging

Repository Detection

By default, the repository name is detected from your git remote:
# Detected from git remote origin URL:
# - https://github.com/myorg/my-app.git → myorg/my-app
# - [email protected]:myorg/my-app.git → myorg/my-app
If no git remote is found, you must specify the repository explicitly with --repository.

Resource Discovery

The command discovers resources by finding all .js files in the dist directory:
dist/
├── search.js       # Resource: search
├── search.json     # Metadata for search resource
├── dashboard.js    # Resource: dashboard
└── dashboard.json  # Metadata for dashboard resource
Each resource needs a corresponding .json file containing metadata like name, title, description, and uri. URIs are generated during sunpeak build—if a resource is missing its URI, push will fail with an error.