netlify-deploy by openai/skills
npx skills add https://github.com/openai/skills --skill netlify-deploy使用 Netlify CLI 将 Web 项目部署到 Netlify,并智能检测项目配置和部署上下文。
此技能通过以下方式自动化 Netlify 部署:
sandbox_permissions=require_escalated 重新运行。该技能使用预身份验证的 Netlify CLI 方法:
npx netlify status 检查身份验证状态npx netlify login身份验证使用以下任一方式:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
netlify loginNETLIFY_AUTH_TOKEN 环境变量检查用户是否已登录 Netlify:
npx netlify status
预期输出模式:
如果未通过身份验证,引导用户:
npx netlify login
这将打开一个浏览器窗口进行 OAuth 身份验证。等待用户完成登录,然后再次使用 netlify status 进行验证。
备选方案:API 密钥身份验证
如果浏览器身份验证不可用,用户可以设置:
export NETLIFY_AUTH_TOKEN=your_token_here
根据 netlify status 输出,确定:
如果已链接 → 跳转到步骤 4
如果未链接,尝试通过 Git 远程仓库链接:
# 检查项目是否基于 Git
git remote show origin
# 如果是基于 Git 的,提取远程 URL
# 格式:https://github.com/username/repo 或 git@github.com:username/repo.git
# 尝试通过 Git 远程仓库链接
npx netlify link --git-remote-url <REMOTE_URL>
如果链接失败(站点在 Netlify 上不存在):
# 交互式创建新站点
npx netlify init
这将引导用户完成:
在部署之前,确保项目依赖项已安装:
# 对于 npm 项目
npm install
# 对于其他包管理器,检测并使用适当的命令
# yarn install, pnpm install 等
根据上下文选择部署类型:
预览/草稿部署(现有站点的默认设置):
npx netlify deploy
这将创建一个具有唯一 URL 的部署预览,用于测试。
生产部署(适用于新站点或明确的生产部署):
npx netlify deploy --prod
这将部署到实时生产 URL。
部署过程:
部署后,向用户报告:
netlify open 查看站点或仪表板如果存在 netlify.toml 文件,CLI 会自动使用它。如果不存在,CLI 将提示输入:
npm run build、next builddist、build、.next常见框架默认值:
npm run build,发布目录 .nextnpm run build,发布目录 dist如果可能,该技能应从 package.json 检测框架并建议适当的设置。
# 1. 检查身份验证
npx netlify status
# 如果未通过身份验证:
npx netlify login
# 2. 链接站点(如果需要)
# 首先尝试基于 Git 的链接
git remote show origin
npx netlify link --git-remote-url https://github.com/user/repo
# 如果站点不存在,则创建新站点:
npx netlify init
# 3. 安装依赖项
npm install
# 4. 部署(预览用于测试)
npx netlify deploy
# 5. 部署到生产环境(准备就绪时)
npx netlify deploy --prod
常见问题及解决方案:
"Not logged in" → 运行 npx netlify login
"No site linked" → 运行 npx netlify link 或 npx netlify init
"Build failed" → 检查 netlify.toml 或 CLI 提示中的构建命令和发布目录 → 验证依赖项是否已安装 → 查看构建日志以获取具体错误信息
"Publish directory not found" → 验证构建命令是否成功运行 → 检查发布目录路径是否正确
如果部署因网络问题(超时、DNS 错误、连接重置)而失败,请使用提升的权限重新运行部署(使用 sandbox_permissions=require_escalated)。当沙盒网络阻止出站请求时,部署需要提升的网络访问权限。
给用户的示例指导:
部署需要提升的网络访问权限才能部署到 Netlify。我可以使用提升的权限重新运行该命令——您希望我继续吗?
对于密钥和配置:
process.env.VARIABLE_NAME 访问netlify deploy(不带 --prod)进行测试netlify open 在 Netlify 仪表板中查看站点netlify logs 查看函数日志(如果使用 Netlify Functions)netlify dev 进行本地开发(配合 Netlify Functions)每周安装量
420
仓库
GitHub 星标数
15.1K
首次出现
2026年2月1日
安全审计
安装于
codex362
opencode357
gemini-cli347
github-copilot330
cursor325
kimi-cli321
Deploy web projects to Netlify using the Netlify CLI with intelligent detection of project configuration and deployment context.
This skill automates Netlify deployments by:
sandbox_permissions=require_escalated.The skill uses the pre-authenticated Netlify CLI approach:
npx netlify statusnpx netlify loginAuthentication uses either:
netlify login opens browser for authenticationNETLIFY_AUTH_TOKEN environment variableCheck if the user is logged into Netlify:
npx netlify status
Expected output patterns :
If not authenticated , guide the user:
npx netlify login
This opens a browser window for OAuth authentication. Wait for user to complete login, then verify with netlify status again.
Alternative: API Key authentication
If browser authentication isn't available, users can set:
export NETLIFY_AUTH_TOKEN=your_token_here
Tokens can be generated at: https://app.netlify.com/user/applications#personal-access-tokens
From netlify status output, determine:
If already linked → Skip to step 4
If not linked , attempt to link by Git remote:
# Check if project is Git-based
git remote show origin
# If Git-based, extract remote URL
# Format: https://github.com/username/repo or git@github.com:username/repo.git
# Try to link by Git remote
npx netlify link --git-remote-url <REMOTE_URL>
If link fails (site doesn't exist on Netlify):
# Create new site interactively
npx netlify init
This guides user through:
Before deploying, ensure project dependencies are installed:
# For npm projects
npm install
# For other package managers, detect and use appropriate command
# yarn install, pnpm install, etc.
Choose deployment type based on context:
Preview/Draft Deploy (default for existing sites):
npx netlify deploy
This creates a deploy preview with a unique URL for testing.
Production Deploy (for new sites or explicit production deployments):
npx netlify deploy --prod
This deploys to the live production URL.
Deployment process :
After deployment, report to user:
netlify open to view site or dashboardIf a netlify.toml file exists, the CLI uses it automatically. If not, the CLI will prompt for:
npm run build, next builddist, build, .nextCommon framework defaults:
npm run build, publish .nextnpm run build, publish distThe skill should detect framework from package.json if possible and suggest appropriate settings.
# 1. Check authentication
npx netlify status
# If not authenticated:
npx netlify login
# 2. Link site (if needed)
# Try Git-based linking first
git remote show origin
npx netlify link --git-remote-url https://github.com/user/repo
# If no site exists, create new one:
npx netlify init
# 3. Install dependencies
npm install
# 4. Deploy (preview for testing)
npx netlify deploy
# 5. Deploy to production (when ready)
npx netlify deploy --prod
Common issues and solutions:
"Not logged in" → Run npx netlify login
"No site linked" → Run npx netlify link or npx netlify init
"Build failed" → Check build command and publish directory in netlify.toml or CLI prompts → Verify dependencies are installed → Review build logs for specific errors
"Publish directory not found" → Verify build command ran successfully → Check publish directory path is correct
If deployment fails due to network issues (timeouts, DNS errors, connection resets), rerun the deploy with escalated permissions (use sandbox_permissions=require_escalated). The deploy requires escalated network access when sandbox networking blocks outbound requests.
Example guidance to the user:
The deploy needs escalated network access to deploy to Netlify. I can rerun the command with escalated permissions—want me to proceed?
For secrets and configuration:
process.env.VARIABLE_NAMEnetlify deploy (no --prod) first to test before productionnetlify open to view site in Netlify dashboardnetlify logs to view function logs (if using Netlify Functions)netlify dev for local development with Netlify FunctionsWeekly Installs
420
Repository
GitHub Stars
15.1K
First Seen
Feb 1, 2026
Security Audits
Gen Agent Trust HubWarnSocketPassSnykPass
Installed on
codex362
opencode357
gemini-cli347
github-copilot330
cursor325
kimi-cli321
Azure Data Explorer (Kusto) 查询技能:KQL数据分析、日志遥测与时间序列处理
100,500 周安装
Rust调用关系图生成器 - 可视化函数调用层次结构,提升代码分析效率
539 周安装
parallel-web-extract:并行网页内容提取工具,高效抓取网页数据
595 周安装
腾讯云CloudBase AI模型Web技能:前端调用混元/DeepSeek模型,实现流式文本生成
560 周安装
Apollo Connectors 模式助手:GraphQL API 连接器开发与集成指南
565 周安装
GitHub Trending 趋势分析工具:实时发现热门项目、技术洞察与开源机会
556 周安装
GSAP React 集成教程:useGSAP Hook 动画库与 React 组件开发指南
546 周安装