手动配置指南

详细的手动配置说明,按需查看。

目录


安装 hicli

一键安装

curl -fsSL https://www.yinbin.ink/install.sh | bash

手动安装

平台 下载
macOS ARM64 hicli-darwin-arm64
macOS x86_64 hicli-darwin-amd64
Linux ARM64 hicli-linux-arm64
Linux x86_64 hicli-linux-amd64
# 解压并安装
chmod +x hicli-*
mv hicli-* ~/.local/bin/hicli

登录账号

hicli login

自动打开浏览器,完成 OAuth 登录后配置自动保存到 ~/.hiterm/config.json


启动服务

hicli serve

前台运行,输出如下:

hicli service started
[serve] SSH key service started: http://100.x.x.x:2222

Ctrl+C 停止服务。


安装 mosh

mosh 提供更好的弱网体验,推荐安装。

macOS

# Homebrew
brew install mosh

# 或 MacPorts
sudo port install mosh

Ubuntu/Debian

sudo apt update
sudo apt install mosh

CentOS/RHEL/Fedora

# Fedora
sudo dnf install mosh

# CentOS 7
sudo yum install mosh

验证安装

mosh --version
mosh-server --version

配置通知

启用通知

hicli notify on

这会:

  • 启用云端推送通知
  • 启用本地桌面通知
  • 自动安装 AI 工具钩子

测试通知

hicli notify test

查看状态

hicli notify status

开机自启

用户需要自行配置系统服务。

macOS (launchd)

创建 ~/Library/LaunchAgents/com.wsyb.hicli.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.wsyb.hicli</string>
    <key>ProgramArguments</key>
    <array>
        <string>/Users/你的用户名/.local/bin/hicli</string>
        <string>serve</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>KeepAlive</key>
    <true/>
</dict>
</plist>

加载服务:

launchctl load ~/Library/LaunchAgents/com.wsyb.hicli.plist

Linux (systemd)

创建 /etc/systemd/system/hicli.service:

[Unit]
Description=HiTerm CLI Service
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=你的用户名
ExecStart=/home/你的用户名/.local/bin/hicli serve
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

启用服务:

sudo systemctl daemon-reload
sudo systemctl enable hicli
sudo systemctl start hicli

配置文件位置

  • 配置: ~/.hiterm/config.json
  • 日志: ~/.hiterm/logs/hicli.log(如启用)

常见问题

服务启动失败

检查 Tailscale 是否运行:

tailscale status

无法登录

确认网络能访问云端服务。

查看日志

tail -f ~/.hiterm/logs/hicli.log