К основному содержанию
команда CX Codex GP ChatGPT официальный · OpenAI

deploy — команда для Codex: деплой проекта на Vercel

Слэш-команда для Codex, которая собирает и выкладывает текущий проект на Vercel: сначала проверки, потом деплой и разбор логов.

Установить в Codex · Вручную: положить файлы Все способы и платформы ↓
~/.codex/prompts/deploy.md
Открыть на GitHub

Что делает deploy

Команда deploy проводит проект через деплой на Vercel по шагам. Сначала преflight: проверяет, что vercel есть в PATH, что проект связан с Vercel (.vercel/project.json в текущей папке или ближайшей родительской), нет ли незакоммиченных изменений. Если CLI не установлен, команда подскажет npm i -g vercel или аналоги для pnpm и bun. Без привязки проекта она предложит выполнить vercel link и запустить /deploy заново.

По умолчанию это превью-деплой: vercel создаёт сборку на отдельном URL и продакшен не трогает. Аргумент prod или production переключает на vercel --prod, и тогда команда сначала спросит явное подтверждение — без чёткого «да» продакшен-деплой не пойдёт. Для монорепозиториев она ищет turbo.json или pnpm-workspace.yaml в корне и уточняет, какой пакет деплоить; если непонятно, спросит вас.

После сборки команда вытаскивает URL из вывода, запоминает короткий SHA коммита и проверяет статус через vercel inspect. Если статус ERROR, покажет последние строки логов сборки. Для продакшена дополнительно ждёт 60 секунд и сканирует рантайм-ошибки через vercel logs --level error --since 1h. Проверка drains и мониторинга ошибок — только предупреждения, деплой они не блокируют. Учтите: незакоммиченные изменения в деплой не попадут, о чём команда предупредит перед стартом.

Какие задачи решает

  • выложить текущий проект на Vercel одной командой
  • сделать превью-сборку на отдельном URL перед мержем
  • защитить продакшен от случайного деплоя через подтверждение
  • разобрать логи сборки, когда деплой упал в ERROR
  • проверить рантайм-ошибки сразу после продакшен-релиза

Примеры запросов агенту

  • /deploy
  • /deploy prod
  • сделай превью-деплой и покажи URL

Как установить deploy

Вручную: положить файлы

~/.codex/prompts/deploy.md

Вызов — /prompts:deploy. В Codex этот формат помечен устаревшим, замена — скиллы

Вопросы о deploy

Как установить deploy в Codex?

Положите файл команды по пути ~/.codex/prompts/deploy.md. После этого она доступна как /deploy.

Что делает deploy?

Проверяет готовность проекта, выкладывает его на Vercel и разбирает результат. Без аргументов это превью-деплой, с prod — продакшен с подтверждением.

Что нужно для работы deploy?

Установленный CLI vercel и связанный проект (.vercel/project.json). Если чего-то нет, команда подскажет команду для установки или vercel link.

Исходный текст

deploy.md · Apache-2.0
---
description: Deploy the current project to Vercel. Pass "prod" or "production" as argument to deploy to production. Default is preview deployment.
---

# Deploy to Vercel

Deploy the current project to Vercel using the CLI, with preflight safety checks, explicit production confirmation, and post-deploy verification.

## Preflight

Run these checks before any deployment. Stop on failure and print actionable guidance.

1. **CLI available?** — Confirm `vercel` is on PATH.
   - If missing: `npm i -g vercel` (or `pnpm add -g vercel` / `bun add -g vercel`).
2. **Project linked?** — Check for `.vercel/project.json` in the current directory or nearest parent.
   - If not found: run `vercel link` interactively, then re-run `/deploy`.
3. **Monorepo detection** — Look for `turbo.json` or `pnpm-workspace.yaml` at the repo root.
   - If detected: confirm which package is targeted. If ambiguous, ask the user before proceeding.
4. **Uncommitted changes** — Run `git status --porcelain`.
   - If output is non-empty: warn the user that uncommitted changes will **not** be included in the deploy. Ask whether to continue or commit first.
   - If not a git repo, skip this check.
5. **Observability preflight** (production deploys only) —

<!-- Sourced from observability skill: Drains > Deploy Preflight Observability -->
Before promoting to production, verify observability readiness:

- **Drains check**: Query configured drains via MCP `list_drains` or REST API. If no drains are configured on a Pro/Enterprise plan, warn:
  > ⚠️ No drains configured. Production errors won't be forwarded to external monitoring.
  > Configure drains via Dashboard or REST API before promoting. See `⤳ skill: observability`.
- **Errored drains**: If any drain is in error state, warn and suggest remediation before deploying:
  > ⚠️ Drain "<url>" is errored. Fix or recreate before production deploy to avoid monitoring gaps.
- **Error monitoring**: Check that at least one of these is in place: configured drains, an error tracking integration (e.g., Sentry, Datadog via `vercel integration ls`), or `@vercel/analytics` in the project.
- These are warnings, not blockers — the user may proceed after acknowledgment.

## Plan

State the intended action before executing:

- **Preview deploy** (default): `vercel` — creates a preview deployment on a unique URL.
- **Production deploy**: `vercel --prod` — deploys to production domains.

If "$ARGUMENTS" contains "prod" or "production":

> ⚠️ **Production deployment requested.**
> This will deploy to your live production URL and affect real users.
> **Ask the user for explicit confirmation before proceeding.** Do not deploy to production without a clear "yes."

If "$ARGUMENTS" does not indicate production:

> Deploying a **preview** build. This creates an isolated URL and does not affect production.

## Commands

### Preview Deployment

<!-- Sourced from deployments-cicd skill: Deployment Commands > Preview Deployment -->
```bash
# Deploy from project root (creates preview URL)
vercel

# Equivalent explicit form
vercel deploy
```

Preview deployments are created automatically for every push to a non-production branch when using Git integration. They provide a unique URL for testing.

### Production Deployment (requires confirmation)

<!-- Sourced from deployments-cicd skill: Deployment Commands > Production Deployment -->
```bash
# Deploy directly to production
vercel --prod
vercel deploy --prod

# Force a new deployment (skip cache)
vercel --prod --force
```

Capture the full command output. Extract the **deployment URL** from the output (the line containing the `.vercel.app` URL or custom domain URL).

Record the current git commit SHA for the summary:

```bash
git rev-parse --short HEAD
```

## Verification

After deployment completes, verify the result:

### 1. Inspect the Deployment

<!-- Sourced from deployments-cicd skill: Deployment Commands > Inspect Deployments -->
```bash
# View deployment details (build info, functions, metadata)
vercel inspect <deployment-url>

# List recent deployments
vercel ls

# View logs for a deployment
vercel logs <deployment-url>
vercel logs <deployment-url> --follow
```

Extract: deployment state (READY / ERROR / QUEUED / BUILDING), build duration, framework, Node.js version, function count.

### 2. On Failure — Fetch Build Logs

If the deployment state is **ERROR** or the deploy command exited non-zero:

```bash
vercel logs <deployment-url>
```

Present the last 50 lines of build logs to help diagnose the failure. Highlight any lines containing `error`, `Error`, `ERR!`, or `FATAL`.

### 3. On Success — Quick Smoke Check

If the deployment state is **READY**, note the URL is live and accessible.

### 4. Post-Deploy Error Scan (production deploys)

<!-- Sourced from observability skill: Drains > Post-Deploy Error Scan -->
For production deployments, wait 60 seconds after READY state, then scan for early runtime errors:

```bash
vercel logs <deployment-url> --level error --since 1h
```

Or via MCP if available: use `get_runtime_logs` with level filter `error`.

**Interpret results:**

| Finding | Action |
|---------|--------|
| No errors | ✓ Clean deploy — no runtime errors in first hour |
| Errors detected | List error count and first 5 unique error messages. Suggest: check drain payloads for correlated traces, review function logs in Dashboard |
| 500 status codes in logs | Correlate timestamps with drain data (if configured) or `vercel logs <url> --json` for structured output. Flag for immediate investigation |
| Timeout errors | Check function duration limits in `vercel.json` or project settings. Consider increasing `maxDuration` |

**Fallback (no drains):**

If no drains are configured, the error scan relies on CLI and Dashboard:

```bash
# Stream live errors
vercel logs <deployment-url> --level error --follow

# JSON output for parsing
vercel logs <deployment-url> --level error --since 1h --json
```

> For richer post-deploy monitoring, configure drains to forward logs/traces to an external platform. See `⤳ skill: observability`.

## Summary

<!-- Sourced from deployments-cicd skill: Deploy Summary Format -->
Present a structured deploy result block:

```
## Deploy Result
- **URL**: <deployment-url>
- **Target**: production | preview
- **Status**: READY | ERROR | BUILDING | QUEUED
- **Commit**: <short-sha>
- **Framework**: <detected-framework>
- **Build Duration**: <duration>
```

If the deployment failed, append:

```
- **Error**: <summary of failure from logs>
```

For production deploys, also include:

```
### Post-Deploy Observability
- **Error scan**: <N errors found / clean> (scanned via vercel logs --level error --since 1h)
- **Drains**: <N configured / none>
- **Monitoring**: <active / gaps identified>
```

## Next Steps

<!-- Sourced from deployments-cicd skill: Deploy Next Steps -->
Based on the deployment outcome:

- **Success (preview)** → "Visit the preview URL to verify. When ready, run `/deploy prod` to promote to production."
- **Success (production)** → "Your production site is live. Run `/status` to see the full project overview."
- **Build error** → "Check the build logs above. Common fixes: verify `build` script in package.json, check for missing env vars with `/env list`, ensure dependencies are installed."
- **Missing env vars** → "Run `/env pull` to sync environment variables locally, or `/env list` to review what's configured on Vercel."
- **Monorepo issues** → "Ensure the correct project root is configured in Vercel project settings. Check `vercel.json` for `rootDirectory`."
- **Post-deploy errors detected** → "Review errors above. Check `vercel logs <url> --level error` for details. If drains are configured, correlate with external monitoring."
- **No monitoring configured** → "Set up drains or install an error tracking integration before the next production deploy. Run `/status` for a full observability diagnostic."

© Vercel Labs · Apache-2.0 · openai/plugins

Похожие слэш-команды

Все слэш-команды по теме «DevOps и инфраструктура» →
platform-deploy-validate forcedotcom Прогоняет серверную валидацию метаданных Salesforce до деплоя: ошибки видны, орг не тронут. Для продакшена возвращает job ID для быстрого деплоя. CX Codex +1 3 000установок vercel-cli-with-tokens vercel Агент работает с Vercel CLI по access-токену, без vercel login: находит VERCEL_TOKEN, связывает проект, катит preview-деплой и правит переменные окружения. CX Codex +1 136 400установок netlify-deploy netlify Скилл ведёт агента по деплоям Netlify: настройка Git CD, netlify.toml, Deploy Previews, build hooks и разбор упавших сборок. CX Codex +1 3 400установок convex-deploy-guard convex Скилл проверяет и вслух объявляет целевой деплой Convex перед выполнением команд. Требует прямого согласия для продакшена и блокирует случайные мутации. CX Codex +1 36 000установок deploy-checklist официальный anthropics Собирает чек-лист перед релизом: проверки CI, ревью, миграций, флагов, выката и отката. Пригодится перед изменениями в продакшене. CX Codex +1 5 700установок

Из того же набора304

Весь набор →
build-zoom-phone-integration Команда для Codex, которая проводит агента через преflight-проверку репозитория и сборку интеграции Zoom Phone: API, Smart Embed, звонки, события. CX Codex GP ChatGPT ★ 7 596звёзд репо build-zoom-contact-center-app Проводит агента по шагам: находит существующий код Contact Center, планирует правки, добавляет авторизацию и обработку событий, затем проверяет сборку. CX Codex GP ChatGPT ★ 7 596звёзд репо build-zoom-apps-sdk-app Слэш-команда для Codex и ChatGPT, которая разворачивает приложение на Zoom Apps SDK внутри клиента Zoom. CX Codex GP ChatGPT ★ 7 596звёзд репо zoom-integration-reviewer Субагент разбирает интеграцию с Zoom целиком: архитектуру, авторизацию, вебхуки и работу с SDK. Пригодится перед выкаткой в прод. CX Codex GP ChatGPT ★ 7 596звёзд репо performance-optimizer Субагент, который разбирает медленные страницы Vercel по диагностическим деревьям: LCP, INP, CLS, рендеринг, бандл. Пригодится, когда Lighthouse показывает плохие оценки. CX Codex GP ChatGPT ★ 7 596звёзд репо twilio-voice-twiml Скилл для сборки голосовой логики звонков на TwiML: глаголы Say, Play, Gather, Dial, Record, Conference и пример IVR для входящего вызова. CX Codex GP ChatGPT ★ 7 596звёзд репо twilio-verify-send-otp Скилл учит агента проводить полный цикл одноразовых кодов в Twilio Verify: создать сервис, отправить код, проверить его. CX Codex GP ChatGPT ★ 7 596звёзд репо twilio-isv-sms-best-practices Скилл для тех, кто встраивает SMS в SaaS-платформу и рассылает сообщения от имени клиентов. Разбирает регистрацию A2P 10DLC и toll-free, субаккаунты и биллинг. CX Codex GP ChatGPT ★ 7 596звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой