SuperAPI AI 工具集

eve-new-project-setup

部署与运维

查看项目

更新于 10-16 11:25

技能介绍

用途

Eve New Project Setup 用于在开发者已经执行 eve init 之后,继续把项目配置为可在 Eve Horizon 上运行的状态。它处理初始化之后的剩余设置:profile、认证、组织/项目注册、清单定制以及 git 远程配置。

前置条件是用户已经运行:

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

主要能力与使用方式

第 1 步:验证 CLI

eve --version

如果失败,说明 CLI 未安装,需运行:

npm install -g @eve-horizon/cli

第 2 步:Profile 设置

为 staging 环境创建 profile:

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

询问用户邮箱并设置默认值:

eve profile set --default-email user@example.com

第 3 步:认证

检查当前认证状态:

eve auth status

如果未认证,则登录:

eve auth login

CLI 会引导完成 SSH 密钥发现(如有需要可从 GitHub 获取)。harness 凭据将在项目创建后设置。

第 4 步:组织 + 项目

向用户询问:

  • 组织名称(例如 "my-company")
  • 项目名称(例如 "My App")
  • 项目 slug(例如 "my-app")
  • 仓库 URL(例如 "git@github.com:me/my-app.git")

创建或确保其存在:

eve org ensure my-company --slug myco
eve project ensure --name "My App" --slug my-app --repo-url git@github.com:me/my-app.git --branch main

URL 影响:org 和 project 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 不可变——请选择简短、有意义的取值。

在 profile 中设为默认值:

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)

决定密钥存储位置:

  • Org(推荐)用于跨项目共享密钥
  • Project 用于应用专属密钥
  • User 用于个人密钥

使用密钥文件进行批量设置(起始仓库包含 secrets.env.example):

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

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

# 将 OAuth 令牌存储在项目作用域(或添加 --system 若为管理员)
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 git@github.com:user/my-app.git
git push -u origin main

第 8 步:验证

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

eve system health
eve auth status
eve profile show

后续步骤

设置完成后,建议:

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

注意:如果环境在清单中配置了 pipeline,eve env deploy <env> --ref <sha> 会触发该 pipeline。使用 --direct 可绕过 pipeline 直接部署。--ref 必须是 40 字符的 SHA,或针对 --repo-dir/cwd 解析的 ref。

故障排查

  • "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

适用场景与限制

该技能适用于已经运行 eve init 并需要完成 Eve Horizon 项目配置的开发者。它依赖 Eve Horizon CLI 及相应环境。资料未提供该技能本身的收费、价格或平台支持范围等信息。