One-click deployment of static websites to BytePlus / VolcEngine Edge Pages platform, supporting auto project creation, update deployment, custom domain bind...
---
name: byted-bp-cdn-pagesdeploy
description: One-click deployment of static websites to BytePlus / VolcEngine Edge Pages platform, supporting auto project creation, update deployment, custom domain binding, and CDN acceleration.
---
# Pages Deploy Skill
## Overview
One-click deployment of static website code to BytePlus / VolcEngine Edge Pages platform. Designed for use in Coding Agents (Cursor, Claude Code, Trae, etc.) to quickly complete hosting, building, and CDN integration after generating static web pages.
## Use Cases
- Deploy static web code generated by Coding Agent
- Deploy local static sites to global CDN
- Bind custom domains to deployed sites
- Iteratively update existing Pages projects
## Prerequisites
1. **AK/SK Configuration**: Requires BytePlus / VolcEngine Access Key and Secret Key
- Mira client: Stored in `secrets/byteplus.json`, format: `{"access_key": "xxx", "secret_key": "xxx"}`
- Manual config: `nest config set -g cloud.access_key YOUR_AK && nest config set -g cloud.secret_key YOUR_SK`
2. **Static site directory**: A directory containing `index.html`
## CLI Commands
### Full Deployment (Auto-detects create vs. update)
```bash
# Auto-detect: creates project if not exists, updates deployment if exists
bash /path/to/scripts/deploy.sh --name my-site --dir ./dist
# Specify description and acceleration region
bash /path/to/scripts/deploy.sh --name my-site --dir ./dist --desc "AI generated site" --region global
# Bind custom domain
bash /path/to/scripts/deploy.sh --name my-site --dir ./dist --domain www.example.com
```
### Parameters
| Parameter | Required | Description |
|-----------|----------|-------------|
| `--name` | Yes | Pages project name |
| `--dir` | Yes | Static site resource directory (must contain index.html) |
| `--desc` | No | Project description |
| `--region` | No | Acceleration region: `global` / `chinese_mainland` / `outside_chinese_mainland` |
| `--domain` | No | Custom domain |
| `--build-cmd` | No | Build command to run before deployment (e.g. `npm run build`) |
| `--secrets-file` | No | AK/SK config file path (default: secrets/byteplus.json) |
### Other Operations
```bash
# List projects
bash /path/to/scripts/manage.sh list
# Show project details
bash /path/to/scripts/manage.sh get --pages p-xxx
# Show deployment history
bash /path/to/scripts/manage.sh deployments --pages p-xxx
# Local preview
bash /path/to/scripts/manage.sh serve --dir ./dist --port 8080
# Domain management
bash /path/to/scripts/manage.sh domain-list --pages p-xxx
bash /path/to/scripts/manage.sh domain-add --pages p-xxx --domain www.example.com
bash /path/to/scripts/manage.sh domain-verify --pages p-xxx --domain www.example.com
# Offline / Delete
bash /path/to/scripts/manage.sh offline --pages p-xxx
bash /path/to/scripts/manage.sh delete --pages p-xxx
```
## Complete Workflow
```
Step 0: Environment Setup (one-time) → Install CLI + Configure AK/SK
Step 1: Coding Agent generates code → ./my-site/
Step 2: Local preview → nest pages serve ./my-site
Step 3: Deploy → deploy.sh --name xxx --dir ./my-site
Step 4: Check domain → manage.sh get --pages p-xxx
Step 5: Bind domain → deploy.sh --name xxx --dir ./my-site --domain www.example.com
Step 6: Iterative update → deploy.sh --name xxx --dir ./my-site
Step 7: Manage → manage.sh list / deployments / offline
```
## Notes
- China mainland production does not provide a default domain; a custom domain must be bound for access
- CLI package name is `@byteplus/nest` (not `@byted/nest`)
- CDN propagation takes 1-5 minutes after deployment
- Custom domains require adding a CNAME record at your DNS provider
don't have the plugin yet? install it then click "run inline in claude" again.
restructured original into 6 implexa components, made implicit deployment logic explicit (create vs update decision point), documented byteplus api credentials and setup requirements, added edge cases for rate limits and auth errors, preserved all original cli commands and workflow, added error codes and outcome validation steps.
Deploy static websites to BytePlus / VolcEngine Edge Pages platform with a single command. use this after a coding agent generates static html/css/js to ship it live with auto project creation, optional custom domain binding, and global CDN acceleration. handles both fresh deploys and iterative updates to existing projects.
BytePlus / VolcEngine API credentials
secrets/byteplus.json as {"access_key": "xxx", "secret_key": "xxx"} or set via environment variables BYTEPLUS_AK and BYTEPLUS_SK. alternatively, configure via nest cli: nest config set -g cloud.access_key YOUR_AK && nest config set -g cloud.secret_key YOUR_SK.Static site directory
index.html and all assets (css, js, images, etc.). directory path required as --dir parameter.BytePlus CLI tool
@byteplus/nest npm package (note: not @byted/nest). install via npm install -g @byteplus/nest.Optional inputs
--name (required for deployment).--desc.--region (global / chinese_mainland / outside_chinese_mainland).--domain.--build-cmd (runs before deployment, e.g. npm run build).--secrets-file (default: secrets/byteplus.json).step 1: verify credentials and environment
secrets/byteplus.json exists or env vars BYTEPLUS_AK and BYTEPLUS_SK are set. test connectivity with nest pages list. if auth fails, stop and request valid credentials.step 2: validate static site directory
--dir parameter.index.html. if missing, fail with message "directory does not contain index.html".step 3: run build command (if provided)
--build-cmd parameter (optional).--build-cmd is specified, execute it (e.g. npm run build) in the target directory. capture stdout/stderr. if build fails, stop and report error.--dir.step 4: check if project exists
--name parameter.nest pages list and search for project matching --name. determine if create or update path.step 5: create new project (if not exists)
nest pages create --name <name> --desc <desc> --region <region> (region defaults to global if not specified). capture project id (format p-xxx).step 6: deploy / update project
--dir, upload to byteplus pages via nest pages deploy --pages <id> --dir <dir>. monitor upload progress. if rate limited (429 response), retry after 30 seconds up to 3 times. if upload fails after retries, report error and roll back.step 7: bind custom domain (if provided)
--domain parameter.nest pages domain-add --pages <id> --domain <domain>. log cname record required for dns setup. inform user to add cname at their dns provider. do not wait for dns propagation.step 8: report deployment summary
if project name not provided: fail with error message "project name required (--name parameter)".
if directory does not contain index.html: fail with error "target directory is not a valid static site (missing index.html)".
if project already exists: skip step 5 (create) and proceed to step 6 (deploy/update). this enables iterative updates without recreating the project.
if region is chinese_mainland and no custom domain provided: warn user "china mainland deployment requires custom domain binding for access. provide --domain or configure after deployment via manage.sh domain-add".
if custom domain provided but project not yet deployed: bind domain immediately after first deployment (step 7).
if upload fails with 429 (rate limit): retry deployment after 30 second backoff, up to 3 attempts total. if all retries fail, report rate limit error and suggest trying again later.
if upload fails with 401/403 (auth error): stop immediately. report credential error and ask user to verify byteplus ak/sk.
if network timeout during upload: retry once, then fail with network error message. suggest checking internet connection.
if deployment succeeds but cname validation times out: notify user that domain binding is in progress and may take up to 48 hours to resolve. provide dns check command.
successful deployment
https://p-<id>.pages.byteplus.com (or custom domain if bound).file and artifact locations
--dir unchanged after deployment (not deleted).custom domain binding
error states
user sees live website at returned url (https://p-xxx.pages.byteplus.com or custom domain) within 1-5 minutes. running curl https://p-xxx.pages.byteplus.com returns 200 status and html content. running nest pages get --pages <id> shows deployment status as "active" or "ready". if custom domain bound, dns resolves to cdn edge ip within 48 hours and https works after certificate provisioning. iterative updates confirmed when re-running deploy.sh with same --name shows new deployment id and updated content appears live within 1-2 minutes (faster than initial deploy due to cdn cache).