cyrus-setup-launch
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCRITICAL: Never use , , or tools on or any file inside . Use only commands (, , etc.) to interact with env files — secrets must never be read into the conversation context.
ReadEditWrite~/.cyrus/.env~/.cyrus/Bashgrepprintf >>重要提示:切勿对或目录下的任何文件使用、或工具。仅使用命令(、等)操作环境文件——密钥绝对不能被读取到对话上下文中。
~/.cyrus/.env~/.cyrus/ReadEditWriteBashgrepprintf >>Setup Launch
安装启动
Prints a summary of the completed setup and offers to start Cyrus.
打印已完成设置的摘要,并提供启动Cyrus的选项。
Step 1: Gather Configuration
步骤1:收集配置信息
Read current state:
bash
undefined读取当前状态:
bash
undefinedBase URL
Base URL
grep '^CYRUS_BASE_URL=' ~/.cyrus/.env 2>/dev/null | cut -d= -f2-
grep '^CYRUS_BASE_URL=' ~/.cyrus/.env 2>/dev/null | cut -d= -f2-
Linear
Linear
grep -c '^LINEAR_CLIENT_ID=' ~/.cyrus/.env 2>/dev/null
grep -c '^LINEAR_CLIENT_ID=' ~/.cyrus/.env 2>/dev/null
GitHub
GitHub
gh auth status 2>&1 | head -1
gh auth status 2>&1 | head -1
Slack
Slack
grep -c '^SLACK_BOT_TOKEN=' ~/.cyrus/.env 2>/dev/null
grep -c '^SLACK_BOT_TOKEN=' ~/.cyrus/.env 2>/dev/null
Repositories
Repositories
cat ~/.cyrus/config.json 2>/dev/null
cat ~/.cyrus/config.json 2>/dev/null
Claude auth
Claude auth
grep -c -E '^(ANTHROPIC_API_KEY|CLAUDE_CODE_OAUTH_TOKEN)=' ~/.cyrus/.env 2>/dev/null
undefinedgrep -c -E '^(ANTHROPIC_API_KEY|CLAUDE_CODE_OAUTH_TOKEN)=' ~/.cyrus/.env 2>/dev/null
undefinedStep 2: Print Summary
步骤2:打印摘要
Print a formatted summary:
┌─────────────────────────────────────┐
│ Cyrus Setup Complete │
├─────────────────────────────────────┤
│ │
│ Endpoint: https://your-url.com │
│ Claude: ✓ API key configured │
│ │
│ Surfaces: │
│ Linear: ✓ Workspace connected │
│ GitHub: ✓ CLI authenticated │
│ Slack: ✓ Bot configured │
│ │
│ Repositories: │
│ • yourorg/yourrepo │
│ • yourorg/another-repo │
│ │
└─────────────────────────────────────┘Use ✓ for configured items and ✗ for skipped/unconfigured items.
打印格式化的摘要:
┌─────────────────────────────────────┐
│ Cyrus设置已完成 │
├─────────────────────────────────────┤
│ │
│ 访问地址: https://your-url.com │
│ Claude: ✓ API密钥已配置 │
│ │
│ 接入平台: │
│ Linear: ✓ 工作区已连接 │
│ GitHub: ✓ CLI已认证 │
│ Slack: ✓ 机器人已配置 │
│ │
│ 代码仓库: │
│ • yourorg/yourrepo │
│ • yourorg/another-repo │
│ │
└─────────────────────────────────────┘已配置项使用✓标记,未配置/跳过项使用✗标记。
Step 3: Make Cyrus Persistent
步骤3:让Cyrus持久运行
Cyrus needs to run as a background process so it stays alive and restarts after reboots. Use the tool if available to ask:
AskUserQuestionHow would you like to keep Cyrus running in the background?
- pm2 (recommended) — Node.js process manager. Simple to set up, auto-restarts on crash, log management built in. Best for most users.
- systemd (Linux only) — OS-level service manager. Starts on boot automatically, managed with
. Best for dedicated Linux servers.systemctl- Neither — just run
in the foreground for now (you can set up persistence later).cyrus
Cyrus需要作为后台进程运行,才能保持在线,并且重启后自动启动。如果有工具,请使用它询问用户:
AskUserQuestion你希望如何让Cyrus在后台运行?
- pm2(推荐)—— Node.js进程管理器。设置简单,崩溃后自动重启,内置日志管理。适合大多数用户。
- systemd(仅Linux)—— 操作系统级服务管理器。开机自动启动,通过
管理。适合专用Linux服务器。systemctl- 都不选—— 暂时在前台运行
(后续可以再设置持久化)。cyrus
Option 1: pm2
选项1:pm2
The agent should run all of these commands directly:
- Check if pm2 is installed (). If not, install it (
which pm2).npm install -g pm2 - Start Cyrus:
pm2 start cyrus --name cyrus - Save the process list:
pm2 save - Run — this prints a system-specific command. The agent should run that output command too (it typically requires
pm2 startup).sudo
After setup, inform the user of useful commands:
- — view logs
pm2 logs cyrus - — restart
pm2 restart cyrus - — stop
pm2 stop cyrus
Agent应直接运行以下所有命令:
- 检查pm2是否已安装()。如果未安装,执行安装(
which pm2)。npm install -g pm2 - 启动Cyrus:
pm2 start cyrus --name cyrus - 保存进程列表:
pm2 save - 运行—— 该命令会输出一个系统专属的命令。Agent也需要运行这个输出的命令(通常需要
pm2 startup权限)。sudo
设置完成后,告知用户常用命令:
- —— 查看日志
pm2 logs cyrus - —— 重启
pm2 restart cyrus - —— 停止
pm2 stop cyrus
Option 2: systemd (Linux only)
选项2:systemd(仅Linux)
The agent should run all of these commands directly:
-
Resolve the actual values for the service file:bash
CYRUS_BIN=$(which cyrus) CYRUS_USER=$(whoami) -
Write the service file:bash
sudo tee /etc/systemd/system/cyrus.service > /dev/null << EOF [Unit] Description=Cyrus AI Agent After=network.target [Service] Type=simple User=$CYRUS_USER EnvironmentFile=/home/$CYRUS_USER/.cyrus/.env ExecStart=$CYRUS_BIN Restart=always RestartSec=10 [Install] WantedBy=multi-user.target EOF -
Enable and start:bash
sudo systemctl daemon-reload sudo systemctl enable cyrus sudo systemctl start cyrus
After setup, inform the user of useful commands:
- — check status
sudo systemctl status cyrus - — view logs
sudo journalctl -u cyrus -f - — restart
sudo systemctl restart cyrus
Agent应直接运行以下所有命令:
-
解析服务文件所需的实际值:bash
CYRUS_BIN=$(which cyrus) CYRUS_USER=$(whoami) -
写入服务文件:bash
sudo tee /etc/systemd/system/cyrus.service > /dev/null << EOF [Unit] Description=Cyrus AI Agent After=network.target [Service] Type=simple User=$CYRUS_USER EnvironmentFile=/home/$CYRUS_USER/.cyrus/.env ExecStart=$CYRUS_BIN Restart=always RestartSec=10 [Install] WantedBy=multi-user.target EOF -
启用并启动:bash
sudo systemctl daemon-reload sudo systemctl enable cyrus sudo systemctl start cyrus
设置完成后,告知用户常用命令:
- —— 检查状态
sudo systemctl status cyrus - —— 查看日志
sudo journalctl -u cyrus -f - —— 重启
sudo systemctl restart cyrus
Option 3: Foreground
选项3:前台运行
Run directly:
bash
cyrus直接执行:
bash
cyrusStep 4: Start ngrok (if applicable)
步骤4:启动ngrok(如果适用)
If the user configured ngrok in the endpoint step, the agent should start it:
bash
ngrok start cyrusIf using pm2, also make ngrok persistent:
bash
pm2 start "ngrok start cyrus" --name ngrok
pm2 save如果用户在端点配置步骤中设置了ngrok,Agent应启动它:
bash
ngrok start cyrus如果使用pm2,还需要设置ngrok持久运行:
bash
pm2 start "ngrok start cyrus" --name ngrok
pm2 saveStep 5: Verify Running
步骤5:验证运行状态
Once Cyrus starts, verify it's listening:
bash
curl -s http://localhost:3456/statusShould return or similar.
{"status":"idle"}Then try assigning a Linear issue to Cyrus, or @mentioning it in Slack, to verify the full pipeline works!
Cyrus启动后,验证它是否在监听请求:
bash
curl -s http://localhost:3456/status应该返回或类似结果。
{"status":"idle"}之后可以尝试将一个Linear issue分配给Cyrus,或者在Slack中@它,验证整个流程运行正常!
Completion
完成
✓ Cyrus is running and ready. Assign a Linear issue or @mention in Slack to test it out!
✓ Cyrus已启动并就绪。分配一个Linear issue或者在Slack中@它来测试吧!