Skip to content

快速开始

从零开始,5 分钟写出你的第一个 eyai 实验协议。

1. 安装

下载对应平台的 CLI 可执行文件,放到 PATH 目录下:

bash
eyai --version
# eyai 1.0.0-rc5

2. 创建协议

bash
eyai init my-first-experiment

这会生成一个协议模板 my-first-experiment.eyai.yaml

yaml
format: "eyai/1.0"
schema: "https://schemas.eyai.top/core/v1.0"

metadata:
  id: "my-first-experiment"
  title: "My First Experiment"
  version: "0.1.0"
  language: "zh-CN"

workflow:
  - type: "log"
    id: "hello"
    parameters:
      message: "Hello, eyai!"

3. 编写实验

来看一个真实的 PCR 实验:

yaml
format: "eyai/1.0"
schema: "https://schemas.eyai.top/core/v1.0"

metadata:
  id: "pcr-basic"
  title: "基础 PCR 扩增"
  version: "1.0.0"
  language: "zh-CN"
  author: "Erian"

variables:
  - name: "annealing_temp"
    value: 55
    unit: "°C"
  - name: "cycle_count"
    value: 30

workflow:
  - type: "temperature"
    id: "initial_denaturation"
    title: "初始变性"
    parameters:
      target: 95
      duration: "3min"

  - type: "for"
    id: "pcr_cycles"
    variable: "i"
    in: "1..$cycle_count"
    do:
      - type: "temperature"
        id: "denaturation"
        parameters:
          target: 95
          duration: "30s"
        title: "变性"

      - type: "temperature"
        id: "annealing"
        parameters:
          target: "$annealing_temp"
          duration: "30s"
        title: "退火"

      - type: "temperature"
        id: "extension"
        parameters:
          target: 72
          duration: "1min"
        title: "延伸"

  - type: "temperature"
    id: "final_extension"
    title: "终延伸"
    parameters:
      target: 72
      duration: "5min"

  - type: "temperature"
    id: "hold"
    title: "保存"
    parameters:
      target: 4
      duration: "∞"

4. 验证协议

bash
eyai validate my-first-experiment.eyai.yaml
# ✓ Syntax    PASSED
# ✓ Structure PASSED
# ✓ Semantic  PASSED
# ✓ Domain    PASSED
# ✓ Chain     PASSED
# ✓ Result: PASSED (5/5)

5. 下一步

eyai — 让实验协议精确、可执行、可被 AI 理解