mcpField
E
eve-new-project-setup

eve-new-project-setup

github.com/incept5云与 DevOps0316 次安装17 周前更新
代码仓库

关于 eve-new-project-setup

eve-new-project-setup 是为已运行 eve init 的开发者提供的 Eve Horizon 项目配置技能。它引导完成身份验证、组织与项目注册、清单设置及 Git 远程仓库配置。

主要功能

  1. 01创建并选择 CLI 配置档
  2. 02检查登录状态并完成认证
  3. 03注册组织与项目
  4. 04配置 Harness 凭据与密钥
  5. 05自定义项目清单
  6. 06设置 Git 远程仓库并验证

适用场景

  1. 01为新项目配置 staging 环境
  2. 02登记组织、项目和代码仓库
  3. 03导入 Harness 所需 API 密钥
  4. 04检查 Eve 项目初始化设置

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/incept5/eve-skillpacks --skill eve-new-project-setup

安装后在 Claude Code 中输入/eve-new-project-setup确认已加载。

详细介绍

Eve 新建项目设置

开发者运行 eve init 后,如果需要为 Eve Horizon 配置项目,请使用此流程。

背景

用户已运行:

npm install -g @eve-horizon/cli
eve init my-project
cd my-project

此技能负责完成剩余设置:配置文件、身份验证、组织/项目注册、清单自定义和 Git 远程配置。

步骤 1:验证 CLI

eve --version

如果失败,说明尚未安装 CLI。请让用户运行:

npm install -g @eve-horizon/cli

步骤 2:配置文件设置

为暂存环境创建配置文件:

eve profile create staging --api-url https://api.eve.example.com
eve profile use staging

询问用户的电子邮件地址并设置默认值:

eve profile set --default-email [email protected]

步骤 3:身份验证

检查当前身份验证状态:

eve auth status

如果尚未通过身份验证,请登录:

eve auth login

CLI 会引导用户查找 SSH 密钥(如有需要,可从 GitHub 获取)。

我们会在创建项目后设置 harness 凭据。

步骤 4:组织 + 项目

询问用户以下信息:

  • 组织名称(例如,“my-company”)
  • 项目名称(例如,“My App”)
  • 项目 slug(例如,“my-app”)
  • 仓库 URL(例如,“[email protected]:me/my-app.git”)

创建或确认这些项目已存在:

eve org ensure my-company --slug myco
eve project ensure --name "My App" --slug my-app --repo-url [email protected]:me/my-app.git --branch main

**对 URL 的影响:**组织和项目 slug 会直接构成部署 URL 和 K8s 命名空间:

  • URL:{service}.{orgSlug}-{projectSlug}-{env}.{domain}(例如,api.myco-my-app-staging.eve.example.com)
  • 命名空间:eve-{orgSlug}-{projectSlug}-{env}(例如,eve-myco-my-app-staging)
  • ${ORG_SLUG} 可用于清单值的插值

Slug 创建后不可更改,请选择简短且有意义的值。

在配置文件中将其设为默认值:

eve profile set --org org_xxx --project proj_xxx

步骤 5:选择 Harness + 设置 API 密钥

询问用户要使用哪些 harness(可以选择多个):

  • mclaude / claude(Anthropic)
  • code / codex(OpenAI)
  • zai(Z.ai)
  • gemini(Google)

将 harness 映射到所需密钥:

  • mclaude/claude:ANTHROPIC_API_KEY(首选),或通过 eve auth sync 使用 Claude OAuth
  • code/codex:OPENAI_API_KEY(首选)或 CODEX_AUTH_JSON_B64
  • zai:Z_AI_API_KEY
  • gemini:GEMINI_API_KEY(或 GOOGLE_API_KEY)

选择存储密钥的位置:

  • 组织(推荐),用于在多个项目间共享密钥
  • 项目,用于特定应用的密钥
  • 用户,用于个人密钥

使用密钥文件批量设置(入门仓库包含 secrets.env.example):

cp secrets.env.example secrets.env
eve secrets import --org org_xxx --file ./secrets.env

对于主机上的 Claude/Codex OAuth 令牌:

# Store OAuth tokens in the project scope (or add --system if admin)
eve auth sync --project proj_xxx

步骤 6:清单配置

入门模板包含 .eve/manifest.yaml。请根据项目详情更新:

schema: eve/compose/v2
project: my-app

services:
  api:
    build:
      context: apps/api
    ports: [3000]
    x-eve:
      ingress:
        public: true
        port: 3000

environments:
  staging:
    pipeline: deploy

pipelines:
  deploy:
    steps:
      - name: deploy
        action: { type: deploy }

需要自定义的关键字段:

  • project:与项目 slug 保持一致
  • services:定义应用的服务
  • x-eve.ingress:配置公共访问

步骤 7:Git 远程配置

项目初始没有远程仓库。请帮助设置:

git remote -v
git remote add origin [email protected]:user/my-app.git
git push -u origin main

步骤 8:验证

运行以下检查以确认设置:

eve system health
eve auth status
eve profile show

后续步骤

设置完成后,建议用户:

  1. 本地运行:docker compose up --build
  2. 设置密钥:eve secrets set MY_KEY "value" 或 eve secrets import --file ./secrets.env
  3. 部署到暂存环境:eve env deploy staging --ref main --repo-dir .
  4. 创建任务:eve job create --prompt "Review the codebase"

注意:如果清单中为环境配置了 pipeline,eve env deploy <env> --ref <sha> 会触发该流水线。使用 --direct 可绕过流水线并直接部署。--ref 必须是 40 个字符的 SHA,或是可通过 --repo-dir/当前工作目录解析的引用。

故障排除

“eve: command not found”
npm install -g @eve-horizon/cli
“Not authenticated”
eve auth login
“No profile”
eve profile create staging --api-url https://api.eve.example.com

评论

支持 Markdown