cyrus-setup-launch

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
CRITICAL: Never use
Read
,
Edit
, or
Write
tools on
~/.cyrus/.env
or any file inside
~/.cyrus/
. Use only
Bash
commands (
grep
,
printf >>
, etc.) to interact with env files — secrets must never be read into the conversation context.
重要提示:切勿对
~/.cyrus/.env
~/.cyrus/
内的任何文件使用
Read
Edit
Write
工具。仅使用
Bash
命令(如
grep
printf >>
等)与环境文件交互——机密信息绝不能被读取到对话上下文当中。

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
undefined

Base 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
undefined
grep -c -E '^(ANTHROPIC_API_KEY|CLAUDE_CODE_OAUTH_TOKEN)=' ~/.cyrus/.env 2>/dev/null
undefined

Step 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 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           │
│                                     │
└─────────────────────────────────────┘
已配置项使用✓,未配置/跳过项使用✗。

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
AskUserQuestion
tool if available
to ask:
How would you like to keep Cyrus running in the background?
  1. pm2 (recommended) — Node.js process manager. Simple to set up, auto-restarts on crash, log management built in. Best for most users.
  2. systemd (Linux only) — OS-level service manager. Starts on boot automatically, managed with
    systemctl
    . Best for dedicated Linux servers.
  3. Neither — just run
    cyrus
    in the foreground for now (you can set up persistence later).
Cyrus需要作为后台进程运行,以保持活跃状态并在重启后自动启动。如果
AskUserQuestion
工具可用,请使用它询问:
您希望如何让Cyrus在后台保持运行?
  1. pm2(推荐)——Node.js进程管理器。设置简单,崩溃后自动重启,内置日志管理功能。适合大多数用户。
  2. systemd(仅Linux)——系统级服务管理器。开机自动启动,通过
    systemctl
    管理。适合专用Linux服务器。
  3. 都不选——暂时直接在前台运行
    cyrus
    (后续可再配置持久化)。

Option 1: pm2

选项1:pm2

The agent should run all of these commands directly:
  1. Check if pm2 is installed (
    which pm2
    ). If not, install it (
    npm install -g pm2
    ).
  2. Start Cyrus:
    pm2 start cyrus --name cyrus
  3. Save the process list:
    pm2 save
  4. Run
    pm2 startup
    — this prints a system-specific command. The agent should run that output command too (it typically requires
    sudo
    ).
After setup, inform the user of useful commands:
  • pm2 logs cyrus
    — view logs
  • pm2 restart cyrus
    — restart
  • pm2 stop cyrus
    — stop
Agent应直接运行以下所有命令:
  1. 检查pm2是否已安装(
    which pm2
    )。若未安装,则执行安装(
    npm install -g pm2
    )。
  2. 启动Cyrus:
    pm2 start cyrus --name cyrus
  3. 保存进程列表:
    pm2 save
  4. 执行
    pm2 startup
    ——该命令会输出一条系统专属命令。Agent也应运行这条输出的命令(通常需要
    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:
  1. Resolve the actual values for the service file:
    bash
    CYRUS_BIN=$(which cyrus)
    CYRUS_USER=$(whoami)
  2. 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
  3. Enable and start:
    bash
    sudo systemctl daemon-reload
    sudo systemctl enable cyrus
    sudo systemctl start cyrus
After setup, inform the user of useful commands:
  • sudo systemctl status cyrus
    — check status
  • sudo journalctl -u cyrus -f
    — view logs
  • sudo systemctl restart cyrus
    — restart
Agent应直接运行以下所有命令:
  1. 解析服务文件所需的实际值:
    bash
    CYRUS_BIN=$(which cyrus)
    CYRUS_USER=$(whoami)
  2. 写入服务文件:
    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
  3. 启用并启动服务:
    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
cyrus

Step 4: Start ngrok (if applicable)

步骤4:启动ngrok(如适用)

If the user configured ngrok in the endpoint step, the agent should start it:
bash
ngrok start cyrus
If 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 save

Step 5: Sandbox CA Certificate Trust (if sandbox enabled)

步骤5:沙箱CA证书信任(如启用沙箱)

If the user's
~/.cyrus/config.json
has
sandbox.enabled: true
, check whether the egress proxy CA certificate is trusted in the system keychain.
Check if sandbox is enabled:
bash
grep -o '"enabled":\s*true' ~/.cyrus/config.json 2>/dev/null | head -1
If sandbox is enabled, check trust status:
bash
undefined
如果用户的
~/.cyrus/config.json
sandbox.enabled
设为
true
,则检查出口代理CA证书是否已在系统钥匙串中被信任。
检查沙箱是否启用:
bash
grep -o '"enabled":\s*true' ~/.cyrus/config.json 2>/dev/null | head -1
如果沙箱已启用,检查信任状态:
bash
undefined

macOS — check System keychain for the Cyrus CA

macOS — 检查系统钥匙串中的Cyrus CA证书

security find-certificate -c "Cyrus Egress Proxy CA" /Library/Keychains/System.keychain 2>&1

- If the cert is found (exit code 0): report ✓ trusted. Offer to set `sandbox.systemWideCert: true` in config.json to skip per-session cert env vars.
- If not found (exit code 44): inform the user and offer to run the trust command:

```bash
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ~/.cyrus/certs/cyrus-egress-ca.pem
On Linux, check with
test -f /usr/local/share/ca-certificates/cyrus-egress-ca.crt
. If not present:
bash
sudo cp ~/.cyrus/certs/cyrus-egress-ca.pem /usr/local/share/ca-certificates/cyrus-egress-ca.crt
sudo update-ca-certificates
After trusting system-wide, offer to set
sandbox.systemWideCert: true
in config.json. This skips per-session cert env vars (
NODE_EXTRA_CA_CERTS
,
GIT_SSL_CAINFO
, etc.) since the OS cert store handles trust for all tools.
If the user declines system-wide trust, Cyrus still works — it sets cert env vars per-session. But some tools (Bun, .NET, curl on macOS with SecureTransport) will only work with system-wide trust.
security find-certificate -c "Cyrus Egress Proxy CA" /Library/Keychains/System.keychain 2>&1

- 如果找到证书(退出码0):报告✓已信任。提议在config.json中设置`sandbox.systemWideCert: true`,以跳过会话级证书环境变量。
- 如果未找到证书(退出码44):告知用户并提议运行信任命令:

```bash
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ~/.cyrus/certs/cyrus-egress-ca.pem
在Linux系统上,通过
test -f /usr/local/share/ca-certificates/cyrus-egress-ca.crt
检查。如果证书不存在:
bash
sudo cp ~/.cyrus/certs/cyrus-egress-ca.pem /usr/local/share/ca-certificates/cyrus-egress-ca.crt
sudo update-ca-certificates
完成系统级信任配置后,提议在config.json中设置
sandbox.systemWideCert: true
。这样就无需设置会话级证书环境变量(如
NODE_EXTRA_CA_CERTS
GIT_SSL_CAINFO
等),因为所有工具的信任都由操作系统证书存储处理。
如果用户拒绝系统级信任,Cyrus仍可正常工作——它会在会话中设置证书环境变量。但部分工具(如Bun、.NET、macOS上使用SecureTransport的curl)仅支持系统级信任。

Step 6: Verify Running

步骤6:验证运行状态

Once Cyrus starts, verify it's listening:
bash
curl -s http://localhost:3456/status
Should return
{"status":"idle"}
or similar.
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任务分配给Cyrus,或在Slack中@提及它,以验证整个流程是否正常工作!

Completion

完成

✓ Cyrus is running and ready. Assign a Linear issue or @mention in Slack to test it out!
✓ Cyrus已运行并准备就绪。分配Linear任务或在Slack中@提及它进行测试吧!