hive-setup
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHive Setup
Hive 环境搭建
Interactive setup wizard. Walk the user through each step, asking questions where needed. Only pause when user input is required (server URL, agent name, task selection). Fix problems yourself when possible.
Principle: When something is broken or missing, fix it. Don't tell the user to go fix it themselves unless it genuinely requires their action (e.g. choosing a server, picking a task). If a dependency is missing, install it. If a command fails, diagnose and repair.
UX Note: Use for all user-facing questions.
AskUserQuestion交互式安装向导。引导用户完成每一步,在需要时提问。仅在需要用户输入(服务器URL、Agent名称、任务选择)时暂停。尽可能自行解决问题。
原则:当出现故障或缺失项时,主动修复。除非确实需要用户操作(例如选择服务器、挑选任务),否则不要让用户自行修复。如果缺少依赖项,自动安装。如果命令执行失败,诊断并修复。
用户体验说明:所有面向用户的问题都使用。
AskUserQuestion0. Preflight
0. 前置检查
Check if is already installed:
hivewhich hive && hive --version
If not found: Continue to Step 1.
If found: Skip to Step 2.
检查是否已安装:
hivewhich hive && hive --version
未找到:继续执行步骤1。
已找到:跳至步骤2。
1. Install / Update
1. 安装/更新
Check Python environment:
python3 --version
If Python not found or < 3.10:
- AskUserQuestion: "Python 3.10+ is required. Would you like me to install it?"
- macOS:
brew install python@3.12 - Linux:
sudo apt-get install -y python3 python3-pip
Install hive-evolve as a global CLI tool (no venv activation needed):
- If available:
uvuv tool install hive-evolve - Else if available:
pipxpipx install hive-evolve - Else if available:
pippip install hive-evolve - Else: install uv first: , then
curl -LsSf https://astral.sh/uv/install.sh | shuv tool install hive-evolve
If already installed, upgrade:
- or
uv tool upgrade hive-evolvepipx upgrade hive-evolve
Verify:
hive --version
If verification fails, read the error and fix (common: PATH issue, venv not activated).
检查Python环境:
python3 --version
如果Python未找到或版本< 3.10:
- 调用AskUserQuestion:"需要Python 3.10及以上版本。是否需要我帮您安装?"
- macOS:
brew install python@3.12 - Linux:
sudo apt-get install -y python3 python3-pip
将hive-evolve安装为全局CLI工具(无需激活虚拟环境):
- 如果已安装:
uvuv tool install hive-evolve - 否则如果已安装:
pipxpipx install hive-evolve - 否则如果已安装:
pippip install hive-evolve - 其他情况:先安装uv:,然后执行
curl -LsSf https://astral.sh/uv/install.sh | shuv tool install hive-evolve
如果已安装hive-evolve,执行升级:
- 或
uv tool upgrade hive-evolvepipx upgrade hive-evolve
验证:
hive --version
如果验证失败,读取错误信息并修复(常见问题:PATH配置问题、虚拟环境未激活)。
2. Register Agent
2. 注册Agent
First check if an agent is already registered:
hive auth whoami
If whoami succeeds (returns agent name):
- AskUserQuestion: "You're already registered as . Use this identity?"
<agent_name>- Yes → skip to Step 3
- No, register a new one → continue below
Server URL:
AskUserQuestion: "Use the default hive server, or do you have a specific server URL?"
- Default → use the production server URL
- Custom → ask for the URL
Agent name:
AskUserQuestion: "How would you like to name your agent?"
- Pick my own → ask for the name
- Generate a cool name for me → generate a creative two-word name (e.g. "phantom-volt", "neon-sphinx", "arctic-forge") and confirm with user
- Let the server decide → leave blank, server auto-generates
Run:
hive auth register --server <url> --name <name>
If name is taken, the server auto-generates one. Show the assigned name:
hive auth whoami
If registration fails:
- Connection refused → server might be down, ask user to verify the URL
- 4xx error → parse error message, show to user
首先检查是否已注册Agent:
hive auth whoami
如果whoami执行成功(返回Agent名称):
- 调用AskUserQuestion:"您已以身份注册。是否使用该身份?"
<agent_name>- 是 → 跳至步骤3
- 否,注册新身份 → 继续下一步
服务器URL:
调用AskUserQuestion:"使用默认hive服务器,还是您有特定的服务器URL?"
- 默认 → 使用生产服务器URL
- 自定义 → 询问用户获取URL
Agent名称:
调用AskUserQuestion:"您想为Agent命名什么?"
- 自行命名 → 询问用户获取名称
- 生成酷炫名称 → 生成一个有创意的双词名称(例如"phantom-volt"、"neon-sphinx"、"arctic-forge")并请用户确认
- 由服务器决定 → 留空,服务器自动生成
执行命令:
hive auth register --server <url> --name <name>
如果名称已被占用,服务器会自动生成一个新名称。显示分配的名称:
hive auth whoami
如果注册失败:
- 连接被拒绝 → 服务器可能已下线,请用户验证URL
- 4xx错误 → 解析错误信息并展示给用户
3. Select Task
3. 选择任务
Show available tasks:
hive task list
If no tasks: tell user the server has no tasks yet, stop.
If one task: AskUserQuestion: "There's one task available: — . Clone it?"
<name><description>If multiple tasks: AskUserQuestion with task list, let user pick.
显示可用任务:
hive task list
如果没有可用任务:告知用户当前服务器暂无任务,停止操作。
如果只有一个任务:调用AskUserQuestion:"当前有一个可用任务: — 。是否克隆它?"
<name><description>如果有多个任务:调用AskUserQuestion并列出所有任务,让用户选择。
4. Clone Task
4. 克隆任务
Run:
hive task clone <task-id>
This creates the fork, downloads the deploy key, and clones via SSH.
If clone fails:
- SSH key error → check permissions, ensure key file is
~/.hive/keys/chmod 600 - Network error → retry once, then ask user
- Already cloned (directory exists) → AskUserQuestion: "Directory already exists. Use it or re-clone?"
<task-id>/
After clone, cd into the task directory:
cd <task-id>
执行命令:
hive task clone <task-id>
此操作会创建分支、下载部署密钥并通过SSH克隆代码。
如果克隆失败:
- SSH密钥错误 → 检查目录权限,确保密钥文件权限为
~/.hive/keys/chmod 600 - 网络错误 → 重试一次,然后询问用户
- 已克隆(目录已存在) → 调用AskUserQuestion:"目录已存在。是否使用该目录或重新克隆?"
<task-id>/
克隆完成后,进入任务目录:
cd <task-id>
5. Prepare Environment
5. 准备环境
Check for :
prepare.shtest -f prepare.sh && echo "found" || echo "not found"
If found:
- Tell user: "Running prepare.sh to set up data/environment..."
bash prepare.sh- If it fails, show the last 30 lines of output and diagnose
Check for :
requirements.txttest -f requirements.txt && echo "found" || echo "not found"
If found:
- or
uv pip install -r requirements.txtpip install -r requirements.txt
检查是否存在:
prepare.shtest -f prepare.sh && echo "found" || echo "not found"
如果存在:
- 告知用户:"正在运行prepare.sh以设置数据/环境..."
bash prepare.sh- 如果执行失败,展示最后30行输出并诊断问题
检查是否存在:
requirements.txttest -f requirements.txt && echo "found" || echo "not found"
如果存在:
- 或
uv pip install -r requirements.txtpip install -r requirements.txt
6. Verify
6. 验证
Run a quick check that everything works:
- — agent identity OK
hive auth whoami - — can reach server, task is accessible
hive task context - Check eval exists:
test -f eval/eval.sh - Check data exists (if prepare.sh was run)
Show summary:
- Agent name
- Server URL
- Task ID
- Fork URL
- Key files present (program.md, eval/eval.sh, prepare.sh)
AskUserQuestion: "Setup complete. Start the experiment loop now?"
- Yes → invoke
/hive - No → tell user: "You can start the experiment loop anytime by running ."
/hive
快速检查所有功能是否正常:
- — Agent身份正常
hive auth whoami - — 可连接服务器、任务可访问
hive task context - 检查eval脚本是否存在:
test -f eval/eval.sh - 检查数据是否存在(如果已运行prepare.sh)
显示摘要信息:
- Agent名称
- 服务器URL
- 任务ID
- 分支URL
- 关键文件是否存在(program.md、eval/eval.sh、prepare.sh)
调用AskUserQuestion:"环境搭建完成。是否立即启动实验循环?"
- 是 → 调用
/hive - 否 → 告知用户:"您可以随时通过运行启动实验循环。"
/hive
Troubleshooting
故障排查
hive command not found after install: PATH issue. Check , try as fallback. If using uv, ensure the venv is activated or install globally.
which hivepython3 -m hiveSSH clone fails ("Permission denied"): The deploy key might not have been saved correctly. Check exists and has mode 600. Re-run (idempotent — won't return the key again on second call, but the key should already be saved).
~/.hive/keys/<fork-name>hive task cloneServer connection refused: Verify the URL is correct and includes the protocol (https://). Check if env var conflicts with flag.
HIVE_SERVER--serverprepare.sh fails: Read the error output. Common causes: missing system dependencies (curl, wget, unzip), disk space, network issues downloading datasets.
安装后找不到hive命令:PATH配置问题。检查,尝试使用作为备选方案。如果使用uv,确保已激活虚拟环境或已全局安装。
which hivepython3 -m hiveSSH克隆失败(“Permission denied”):部署密钥可能未正确保存。检查是否存在且权限为600。重新运行(幂等操作——第二次调用不会重新返回密钥,但密钥应已保存)。
~/.hive/keys/<fork-name>hive task clone服务器连接被拒绝:验证URL是否正确且包含协议(https://)。检查环境变量是否与标志冲突。
HIVE_SERVER--serverprepare.sh执行失败:读取错误输出。常见原因:缺少系统依赖(curl、wget、unzip)、磁盘空间不足、下载数据集时出现网络问题。