create-site
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCreate a New AEM Edge Delivery Site
创建全新的AEM Edge Delivery站点
This skill walks through the full onboarding flow for a new AEM Edge Delivery site. It handles everything that can be automated and clearly signals the steps that require human action.
本技能将引导完成新AEM Edge Delivery站点的完整入门流程。它会处理所有可自动化的步骤,并明确指出需要人工操作的环节。
When to Use This Skill
何时使用此技能
Use this skill when:
- A user wants to create a brand-new AEM Edge Delivery site from scratch
- A user asks to "set up a new site", "create a new EDS project", or "onboard a new site"
- No GitHub repository or DA content exists yet for the project
Do NOT use this skill for:
- Importing or migrating existing pages (use page-import skill)
- Building or modifying blocks on an existing site (use content-driven-development skill)
在以下场景使用本技能:
- 用户想要从零开始创建全新的AEM Edge Delivery站点
- 用户要求“搭建新站点”、“创建新EDS项目”或“接入新站点”
- 项目尚无GitHub仓库或DA内容
请勿在以下场景使用本技能:
- 导入或迁移现有页面(使用page-import技能)
- 在现有站点上构建或修改组件(使用content-driven-development技能)
Prerequisites
前提条件
- A GitHub account with permission to create repositories in the target org
- An Adobe IMS account with access to DA (da.live)
- CLI authenticated (
gh) or a GitHub personal access token withgh auth statusscoperepo - Node.js (for DA token management via da-auth-helper)
- 拥有目标组织中创建仓库权限的GitHub账户
- 有权访问DA(da.live)的Adobe IMS账户
- CLI已认证(
gh),或拥有带有gh auth status权限的GitHub个人访问令牌repo - Node.js(用于通过da-auth-helper管理DA令牌)
Related Skills
相关技能
- page-import — Import existing pages into the newly created site
- content-driven-development — Build and modify blocks once the site exists
- building-blocks — Implement new block code
- page-import — 将现有页面导入新建站点
- content-driven-development — 站点创建完成后构建和修改组件
- building-blocks — 实现新的组件代码
Step 0: Create TodoList
步骤0:创建待办清单
Create a checklist to track progress (use your agent's task-tracking tool if available):
- Gather inputs — org, repo name, site name collected
- Create GitHub repository — repo created from boilerplate template
- Install aem-code-sync (human action) — GitHub App installed on repo
- Authenticate with DA — valid IMS token obtained
- Create initial content in DA — nav, footer, index created
- Trigger preview — all three paths return 200/201
- Hand off — preview URL and DA links delivered to user
创建一个清单来跟踪进度(如果有代理的任务跟踪工具,请使用该工具):
- 收集输入信息 — 已收集组织、仓库名称、站点名称
- 创建GitHub仓库 — 基于模板仓库创建新仓库
- 安装aem-code-sync(人工操作)— 在仓库上安装GitHub应用
- 通过DA认证 — 获取有效的IMS令牌
- 在DA中创建初始内容 — 创建导航页、页脚、首页
- 触发预览 — 三个路径均返回200/201状态码
- 交付 — 将预览URL和DA链接提供给用户
Step 1: Gather Inputs
步骤1:收集输入信息
Ask the user for the following. Do not proceed until all required inputs are provided.
- GitHub org — the GitHub organization or username where the repo will be created (e.g. )
my-org - Project name — the repository name, lowercase, hyphens only (e.g. )
my-site - Site name — the human-readable name used in content (e.g. ). If not provided, derive it from the project name.
My Site
Store as: , ,
{{ORG}}{{REPO}}{{SITE_NAME}}向用户询问以下信息,在获取所有必填信息前请勿继续。
- GitHub组织 — 仓库将创建的GitHub组织或用户名(例如:)
my-org - 项目名称 — 仓库名称,小写,仅使用连字符(例如:)
my-site - 站点名称 — 内容中使用的易读名称(例如:)。如果未提供,从项目名称推导。
My Site
存储为:, ,
{{ORG}}{{REPO}}{{SITE_NAME}}Step 2: Create GitHub Repository
步骤2:创建GitHub仓库
Create a new repository using the template.
adobe/aem-boilerplateOption A — GitHub CLI (preferred, handles auth automatically):
bash
gh repo create {{ORG}}/{{REPO}} \
--template adobe/aem-boilerplate \
--description "{{SITE_NAME}} — AEM Edge Delivery site" \
--publicCheck if is available with . If not authenticated, run first.
ghgh auth statusgh auth loginOption B — GitHub API (if CLI is not available):
ghPOST https://api.github.com/repos/adobe/aem-boilerplate/generate
Authorization: Bearer {{GITHUB_TOKEN}}
Content-Type: application/json
{
"owner": "{{ORG}}",
"name": "{{REPO}}",
"description": "{{SITE_NAME}} — AEM Edge Delivery site",
"private": false,
"include_all_branches": false
}To obtain a token: https://github.com/settings/tokens/new — scope: .
repoSuccess: HTTP 201 (API) or exit code 0 (CLI). The repo is now live at .
https://github.com/{{ORG}}/{{REPO}}使用模板创建新仓库。
adobe/aem-boilerplate选项A — GitHub CLI(推荐,自动处理认证):
bash
gh repo create {{ORG}}/{{REPO}} \
--template adobe/aem-boilerplate \
--description "{{SITE_NAME}} — AEM Edge Delivery site" \
--public使用检查是否可用。如果未认证,先运行。
gh auth statusghgh auth login选项B — GitHub API(如果 CLI不可用):
ghPOST https://api.github.com/repos/adobe/aem-boilerplate/generate
Authorization: Bearer {{GITHUB_TOKEN}}
Content-Type: application/json
{
"owner": "{{ORG}}",
"name": "{{REPO}}",
"description": "{{SITE_NAME}} — AEM Edge Delivery site",
"private": false,
"include_all_branches": false
}获取令牌:https://github.com/settings/tokens/new — 权限范围:。
repo成功标志: API返回HTTP 201,或CLI返回退出码0。仓库现已上线,地址为。
https://github.com/{{ORG}}/{{REPO}}Step 3: Install aem-code-sync (human action required)
步骤3:安装aem-code-sync(需人工操作)
The aem-code-sync GitHub App connects the repository to AEM's content delivery pipeline. This step cannot be automated — the user must complete it in the browser.
Tell the user:
Action required: Install the AEM Code Sync app on your new repository.
- Open this URL: https://github.com/apps/aem-code-sync/installations/new
- Under "Repository access", select Only select repositories
- Choose {{ORG}}/{{REPO}} from the list
- Click Save
Reply "done" when complete.
Wait for confirmation before proceeding.
Verify: After confirmation, check that returns a valid JSON response (not 404). If it does, the app is correctly installed.
https://admin.hlx.page/status/{{ORG}}/{{REPO}}/main/aem-code-sync GitHub应用将仓库连接到AEM的内容交付管道。此步骤无法自动化 — 用户必须在浏览器中完成。
告知用户:
需要执行操作: 在新仓库上安装AEM Code Sync应用。
- 打开此链接:https://github.com/apps/aem-code-sync/installations/new
- 在“仓库访问”下,选择仅选择仓库
- 从列表中选择**{{ORG}}/{{REPO}}**
- 点击保存
完成后回复“done”。
等待确认后再继续。
验证: 确认后,检查是否返回有效的JSON响应(非404)。如果是,则应用已正确安装。
https://admin.hlx.page/status/{{ORG}}/{{REPO}}/main/Step 4: Authenticate with DA
步骤4:通过DA认证
DA requires Adobe IMS authentication. Choose the appropriate path:
Option A — da-auth-helper (preferred)
da-auth-helper~/.aem/da-token.json- Check for a valid cached token:
bash
node -e "
const fs = require('fs');
const p = process.env.HOME + '/.aem/da-token.json';
if (!fs.existsSync(p)) { console.log('No cache'); process.exit(1); }
const t = JSON.parse(fs.readFileSync(p));
console.log('Valid:', t.expires_at > Date.now());
console.log('Expires:', new Date(t.expires_at).toISOString());
"- If valid, capture the token and skip to Step 5:
bash
DA_TOKEN=$(node -e "const t = require(process.env.HOME + '/.aem/da-token.json'); process.stdout.write(t.access_token);")- If missing or expired, install da-auth-helper from GitHub (it is not published to npm) and refresh:
bash
npm install -g github:adobe-rnd/da-auth-helper
da-auth-helper tokenThis opens a browser for Adobe IMS login and writes the new token to . Then capture it as in step 2.
~/.aem/da-token.jsonOption B — DA MCP is configured
If the DA MCP server is available, trigger the authentication tool to start the OAuth flow and share the authorization URL with the user.
Option C — Manual token
Ask the user to obtain an IMS token from their browser (e.g. from the DA network tab or an existing session) and paste it. Store as .
{{DA_TOKEN}}DA需要Adobe IMS认证。选择合适的方式:
选项A — da-auth-helper(推荐)
da-auth-helper~/.aem/da-token.json- 检查是否有有效的缓存令牌:
bash
node -e "
const fs = require('fs');
const p = process.env.HOME + '/.aem/da-token.json';
if (!fs.existsSync(p)) { console.log('No cache'); process.exit(1); }
const t = JSON.parse(fs.readFileSync(p));
console.log('Valid:', t.expires_at > Date.now());
console.log('Expires:', new Date(t.expires_at).toISOString());
"- 如果有效,捕获令牌并跳至步骤5:
bash
DA_TOKEN=$(node -e "const t = require(process.env.HOME + '/.aem/da-token.json'); process.stdout.write(t.access_token);")- 如果令牌缺失或过期,从GitHub安装da-auth-helper(未发布到npm)并刷新:
bash
npm install -g github:adobe-rnd/da-auth-helper
da-auth-helper token这会打开浏览器进行Adobe IMS登录,并将新令牌写入。然后按照步骤2捕获令牌。
~/.aem/da-token.json选项B — 已配置DA MCP
如果DA MCP服务器可用,触发认证工具启动OAuth流程,并将授权URL分享给用户。
选项C — 手动令牌
要求用户从浏览器获取IMS令牌(例如从DA的网络标签或现有会话)并粘贴。存储为。
{{DA_TOKEN}}Step 5: Create Initial Content in DA
步骤5:在DA中创建初始内容
Create the three mandatory pages every EDS site requires. Use the templates below exactly — they are pre-validated for EDS compliance.
Option A — DA MCP:
Call the DA create source tool three times with the content below.
Option B — DA API:
Write each file to a temp file first, then POST using syntax. Inline multiline content with causes curl to fail (exit 26). Use explicitly to avoid PATH resolution issues in subshells.
@-F 'data=...'/usr/bin/curlbash
cat > /tmp/nav.html << 'EOF'
<nav content>
EOF
/usr/bin/curl -s -o /dev/null -w "%{http_code}" -X POST "https://admin.da.live/source/{{ORG}}/{{REPO}}/nav.html" \
-H "Authorization: Bearer {{DA_TOKEN}}" \
-F "data=@/tmp/nav.html;type=text/html"Repeat for and .
footer.htmlindex.htmlVerify: After each POST, expect HTTP 201. If you get 401, the token has expired — return to Step 4.
创建每个EDS站点都需要的三个必填页面。请严格使用以下模板 — 它们已预先验证符合EDS规范。
选项A — DA MCP:
使用以下内容调用三次DA创建源工具。
选项B — DA API:
先将每个文件写入临时文件,然后使用语法进行POST。在中使用多行内联内容会导致curl失败(退出码26)。显式使用以避免子shell中的PATH解析问题。
@-F 'data=...'/usr/bin/curlbash
cat > /tmp/nav.html << 'EOF'
<nav content>
EOF
/usr/bin/curl -s -o /dev/null -w "%{http_code}" -X POST "https://admin.da.live/source/{{ORG}}/{{REPO}}/nav.html" \
-H "Authorization: Bearer {{DA_TOKEN}}" \
-F "data=@/tmp/nav.html;type=text/html"为和重复上述操作。
footer.htmlindex.html验证: 每次POST后,预期返回HTTP 201。如果返回401,说明令牌已过期 — 返回步骤4。
nav.html
nav.html
html
<main>
<div>
<p><a href="/">{{SITE_NAME}}</a></p>
</div>
<div>
<ul>
<li><a href="/">Home</a></li>
</ul>
</div>
<div></div>
</main>html
<main>
<div>
<p><a href="/">{{SITE_NAME}}</a></p>
</div>
<div>
<ul>
<li><a href="/">Home</a></li>
</ul>
</div>
<div></div>
</main>footer.html
footer.html
html
<main>
<div>
<p>© 2024 {{SITE_NAME}}. All rights reserved.</p>
</div>
</main>html
<main>
<div>
<p>© 2024 {{SITE_NAME}}. All rights reserved.</p>
</div>
</main>index.html
index.html
html
<main>
<div>
<h1>Welcome to {{SITE_NAME}}</h1>
<p>Your new site is ready. Start editing this page in DA.</p>
</div>
</main>html
<main>
<div>
<h1>Welcome to {{SITE_NAME}}</h1>
<p>Your new site is ready. Start editing this page in DA.</p>
</div>
</main>Step 6: Trigger Preview
步骤6:触发预览
Preview pulls the DA content into the AEM delivery pipeline and makes it accessible on the domain.
.aem.pageDA-sourced content requires the Bearer token on preview requests — even for public repos. Use explicitly.
/usr/bin/curlbash
/usr/bin/curl -s -o /dev/null -w "%{http_code}" -X POST "https://admin.hlx.page/preview/{{ORG}}/{{REPO}}/main/nav" \
-H "Authorization: Bearer {{DA_TOKEN}}"
/usr/bin/curl -s -o /dev/null -w "%{http_code}" -X POST "https://admin.hlx.page/preview/{{ORG}}/{{REPO}}/main/footer" \
-H "Authorization: Bearer {{DA_TOKEN}}"
/usr/bin/curl -s -o /dev/null -w "%{http_code}" -X POST "https://admin.hlx.page/preview/{{ORG}}/{{REPO}}/main/" \
-H "Authorization: Bearer {{DA_TOKEN}}"Success: HTTP 200 or 201 for each. The homepage is now live at:
https://main--{{REPO}}--{{ORG}}.aem.page/预览会将DA内容拉入AEM交付管道,并使其在域名上可访问。
.aem.pageDA源内容的预览请求需要Bearer令牌 — 即使是公共仓库也是如此。显式使用。
/usr/bin/curlbash
/usr/bin/curl -s -o /dev/null -w "%{http_code}" -X POST "https://admin.hlx.page/preview/{{ORG}}/{{REPO}}/main/nav" \
-H "Authorization: Bearer {{DA_TOKEN}}"
/usr/bin/curl -s -o /dev/null -w "%{http_code}" -X POST "https://admin.hlx.page/preview/{{ORG}}/{{REPO}}/main/footer" \
-H "Authorization: Bearer {{DA_TOKEN}}"
/usr/bin/curl -s -o /dev/null -w "%{http_code}" -X POST "https://admin.hlx.page/preview/{{ORG}}/{{REPO}}/main/" \
-H "Authorization: Bearer {{DA_TOKEN}}"成功标志: 每个请求均返回HTTP 200或201。首页现已上线,地址为:
https://main--{{REPO}}--{{ORG}}.aem.page/Step 7: Confirm and Hand Off
步骤7:确认并交付
Tell the user:
Your site is ready!
- Preview:
https://main--{{REPO}}--{{ORG}}.aem.page/- Browse content in DA:
https://da.live/#/{{ORG}}/{{REPO}}/- Edit homepage:
https://da.live/edit#/{{ORG}}/{{REPO}}/index- Edit nav:
https://da.live/edit#/{{ORG}}/{{REPO}}/nav- Edit footer:
https://da.live/edit#/{{ORG}}/{{REPO}}/footer- GitHub repo:
https://github.com/{{ORG}}/{{REPO}}To start developing locally:bashgit clone https://github.com/{{ORG}}/{{REPO}}.git cd {{REPO}} npm install aem upWhat would you like to do next — add more pages, customize a block, or set up a custom domain?
告知用户:
您的站点已准备就绪!
- 预览地址:
https://main--{{REPO}}--{{ORG}}.aem.page/- 在DA中浏览内容:
https://da.live/#/{{ORG}}/{{REPO}}/- 编辑首页:
https://da.live/edit#/{{ORG}}/{{REPO}}/index- 编辑导航:
https://da.live/edit#/{{ORG}}/{{REPO}}/nav- 编辑页脚:
https://da.live/edit#/{{ORG}}/{{REPO}}/footer- GitHub仓库:
https://github.com/{{ORG}}/{{REPO}}如需开始本地开发:bashgit clone https://github.com/{{ORG}}/{{REPO}}.git cd {{REPO}} npm install aem up接下来您想做什么 — 添加更多页面、自定义组件,还是设置自定义域名?
Troubleshooting
故障排除
| Symptom | Likely cause | Fix |
|---|---|---|
| Step 2 returns 422 | Repo name already exists | Ask user for a different name |
| Step 3 verify returns 404 | aem-code-sync not installed | Re-send the installation URL |
| Step 4 cached token missing/expired | No prior DA session on this machine | Install da-auth-helper from GitHub ( |
| Step 5 curl exits with code 26 | Inline multiline content in | Write content to a temp file and use |
| Step 5 returns 401 | Expired or missing IMS token | Re-check |
| Step 5 returns 403 | Token lacks permission for this org/repo | Confirm the user has write access to |
| Step 6 returns 401 | DA-sourced content requires auth on preview | Add |
| Step 6 returns 404 | aem-code-sync not installed correctly | Verify Step 3, then retry |
| PATH not resolved in subshell | Use |
| Preview URL shows blank page | nav or index not previewed | Re-run Step 6 for the failing path |
| 症状 | 可能原因 | 解决方法 |
|---|---|---|
| 步骤2返回422 | 仓库名称已存在 | 请求用户提供其他名称 |
| 步骤3验证返回404 | 未安装aem-code-sync | 重新发送安装链接 |
| 步骤4缓存令牌缺失/过期 | 此机器上无先前的DA会话 | 从GitHub安装da-auth-helper( |
| 步骤5 curl返回退出码26 | | 将内容写入临时文件并使用 |
| 步骤5返回401 | IMS令牌过期或缺失 | 重新检查 |
| 步骤5返回403 | 令牌缺少此组织/仓库的权限 | 确认用户在DA中拥有 |
| 步骤6返回401 | DA源内容的预览请求需要认证 | 在预览请求中添加 |
| 步骤6返回404 | aem-code-sync安装不正确 | 验证步骤3,然后重试 |
脚本中出现 | 子shell中未解析PATH | 显式使用 |
| 预览URL显示空白页面 | 未预览导航或首页 | 为失败路径重新运行步骤6 |
Reference
参考资料
- Boilerplate: https://github.com/adobe/aem-boilerplate
- aem-code-sync app: https://github.com/apps/aem-code-sync
- DA docs: https://da.live/docs
- DA Admin API: https://opensource.adobe.com/da-admin/
- DA Auth (IMS token helper): https://github.com/adobe-rnd/da-auth-helper
- AEM Admin API: https://www.aem.live/docs/admin.html
- Full onboarding guide: https://www.aem.live/developer/create-site.md
- 模板仓库:https://github.com/adobe/aem-boilerplate
- aem-code-sync应用:https://github.com/apps/aem-code-sync
- DA文档:https://da.live/docs
- DA Admin API:https://opensource.adobe.com/da-admin/
- DA认证(IMS令牌助手):https://github.com/adobe-rnd/da-auth-helper
- AEM Admin API:https://www.aem.live/docs/admin.html
- 完整入门指南:https://www.aem.live/developer/create-site.md
DA URL patterns
DA URL模式
- Browse folder:
https://da.live/#/{{org}}/{{repo}}{{folder-path}} - Edit HTML document:
https://da.live/edit#/{{org}}/{{repo}}{{path-without-extension}} - Edit JSON/sheet:
https://da.live/sheet#/{{org}}/{{repo}}{{path-without-extension}}
- 浏览文件夹:
https://da.live/#/{{org}}/{{repo}}{{folder-path}} - 编辑HTML文档:
https://da.live/edit#/{{org}}/{{repo}}{{path-without-extension}} - 编辑JSON/表格:
https://da.live/sheet#/{{org}}/{{repo}}{{path-without-extension}}