mcpField
E
edgeone-pages-deploy

edgeone-pages-deploy

github.com/edgeone-pagesCloud & DevOps17169 installsUpdated 30w ago
Repository

About edgeone-pages-deploy

A skill that guides project deployment to EdgeOne Pages using its CLI. It covers site selection, browser or token login, deployment, preview environments, and reporting deployment URLs.

Key features

  1. 01Check CLI version and login status
  2. 02Choose China or Global site
  3. 03Select browser or token login
  4. 04Deploy linked and new projects
  5. 05Deploy to preview environment
  6. 06Extract deployment URLs and IDs

Use cases

  1. 01Deploy a project from a local IDE
  2. 02Deploy from a remote or CI environment
  3. 03Publish a preview deployment

MCP support

This is a deployment skill, not an MCP server; its README describes deploying with the EdgeOne Pages CLI.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/edgeone-pages/edgeone-pages-skills --skill edgeone-pages-deploy

After installing, type/edgeone-pages-deployin Claude Code to confirm it loaded.

Bundled filesreferences/command-reference.md

Details

From the project README

EdgeOne Pages Deployment Skill

Deploy any project to EdgeOne Pages.

⛔ Critical Rules (never skip)

  1. CLI version ≥ 1.2.30 — reinstall if lower. Never proceed with an outdated version.
  2. Never truncate the deploy URL — EDGEONE_DEPLOY_URL includes query parameters required for access. Always output the complete URL.
  3. Ask the user to choose China or Global site before login. Never assume.
  4. Auto-detect the login method — browser login in desktop environments, token login in headless/remote/CI environments. Follow the decision table below.
  5. After token login, ask if the user wants to save the token locally for future use.

Deployment Flow

Run these checks first, then follow the decision table:

# Check 1: CLI installed and correct version?
edgeone -v

# Check 2: Already logged in?
edgeone whoami

# Check 3: Project already linked?
cat edgeone.json 2>/dev/null

# Check 4: Saved token exists?
cat .edgeone/.token 2>/dev/null
Decision Table
CLI versionLogin statusAction
Not installed or < 1.2.30—→ Go to Install CLI
≥ 1.2.30 ✓Logged in→ Go to Deploy
≥ 1.2.30 ✓Not logged in, has saved token→ Go to Deploy with Token (use saved token)
≥ 1.2.30 ✓Not logged in, no saved token→ Go to Login

Install CLI

npm install -g edgeone@latest

Verify: edgeone -v — confirm output is 1.2.30 or higher. Retry installation if not.


Login

1. Ask the user to choose a site

Use the IDE's selection control (ask_followup_question) before running any login command:

Choose your EdgeOne Pages site:

  • China — For users in mainland China (console.cloud.tencent.com)
  • Global — For users outside China (console.intl.cloud.tencent.com)
2. Detect environment and choose login method
ConditionMethod
Local desktop IDE (VS Code, Cursor, etc.)Browser Login
Remote / SSH / container / CI / cloud IDE / headlessToken Login
User explicitly requests tokenToken Login
Browser Login
# China site
edgeone login --site china

# Global site
edgeone login --site global

Wait for the user to complete browser auth. The CLI prints a success message when done.

Token Login

Token login does NOT use edgeone login. Pass the token directly in the deploy command via -t.

Guide the user to obtain a token:

  1. Go to the console:
  2. Find API Token → Create Token → Copy it

⚠️ Remind the user: the token has account-level permissions. Never commit it to a repository.

3. Offer to save the token locally

After the user provides a token, ask:

Save this token locally for future deployments?

  • Yes — Save to .edgeone/.token (auto-used next time)
  • No — Use for this deployment only

If Yes:

mkdir -p .edgeone
echo "<token>" > .edgeone/.token
grep -q '.edgeone/.token' .gitignore 2>/dev/null || echo '.edgeone/.token' >> .gitignore

Confirm to the user: "✅ Token saved to .edgeone/.token and added to .gitignore."


Deploy

Browser-authenticated deploy
# Project already linked (edgeone.json exists)
edgeone pages deploy

# New project (no edgeone.json)
edgeone pages deploy -n <project-name>

<project-name>: auto-generate from the project directory name. The first deploy creates edgeone.json automatically.

Token-based deploy

First check for a saved token:

cat .edgeone/.token 2>/dev/null
  • Saved token found → use it, tell the user: "Using saved token from .edgeone/.token"
  • No saved token → ask the user to provide one (see Token Login above)
# Project already linked
edgeone pages deploy -t <token>

# New project
edgeone pages deploy -n <project-name> -t <token>

The token already contains site info — no --site flag needed.

After a successful deploy with a manually-entered token, ask if the user wants to save it (see "Offer to save the token locally" above).

Deploy to preview environment
edgeone pages deploy -e preview
Build behavior

The CLI auto-detects the framework, runs the build, and uploads the output directory. No manual config needed.


⚠️ Parse Deploy Output (Critical)

After edgeone pages deploy succeeds, the CLI outputs:

[cli][✔] Deploy Success
EDGEONE_DEPLOY_URL=https://my-project-abc123.edgeone.cool?<auth_query_params>
EDGEONE_DEPLOY_TYPE=preset
EDGEONE_PROJECT_ID=pages-xxxxxxxx
[cli][✔] You can view your deployment in the EdgeOne Pages Console at:
https://console.cloud.tencent.com/edgeone/pages/project/pages-xxxxxxxx/deployment/xxxxxxx

Extraction rules:

FieldHow to extract⛔ Warning
Access URLFull value after EDGEONE_DEPLOY_URL=Include the full query string (? and everything after) — without these params the page will not load
Project IDValue after EDGEONE_PROJECT_ID=—
Console URLLine after "You can view your deployment..."—

Show the user:

✅ Deployment complete!

  • Access URL: https://my-project-abc123.edgeone.cool?<auth_query_params>
  • Console URL: https://console.cloud.tencent.com/edgeone/pages/project/...

Error Handling

ErrorSolution
command not found: edgeoneRun npm install -g edgeone@latest
Browser does not open during loginSwitch to token login
"not logged in" errorRun edgeone whoami to check, then re-login or use token
Auth error with tokenToken may be expired — regenerate at the console
Project name conflictUse a different name with -n
Build failureCheck logs — usually missing deps or bad build script

For CLI command reference, environment variables, local dev setup, and token management details, see references/command-reference.md.

Comments

Markdown supported