docs: extract CLI install steps into references/cli-install.md
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: htsy
|
name: htsy
|
||||||
description: 当用户需要通过海豚私域 htsy-cli 操作账号、用户、登录注册、席位、角色、微号、客户、标签、群、素材、话术库、关键词、SOP、群发、营销计划、客服或知识库接口时使用本 skill。本 skill 面向公开业务使用场景,说明 htsy-cli 从 Gitea release 下载、安装、登录状态保存、接口路径选择和 JSON 请求体字段编写方式。
|
description: 当用户需要通过海豚私域 htsy-cli 操作账号、用户、登录注册、席位、角色、微号、客户、标签、群、素材、话术库、关键词、SOP、群发、营销计划、客服或知识库接口时使用本 skill。本 skill 面向公开业务使用场景,说明 htsy-cli 登录状态检查、接口路径选择和 JSON 请求体字段编写方式。
|
||||||
---
|
---
|
||||||
|
|
||||||
# 海豚私域 Htsy
|
# 海豚私域 Htsy
|
||||||
@@ -8,48 +8,11 @@ description: 当用户需要通过海豚私域 htsy-cli 操作账号、用户、
|
|||||||
## 核心流程
|
## 核心流程
|
||||||
|
|
||||||
1. 确认本机存在 `htsy-cli`:Linux/macOS 用 `command -v htsy-cli && htsy-cli version`,Windows PowerShell 用 `Get-Command htsy-cli.exe -ErrorAction SilentlyContinue` 和 `htsy-cli.exe version`。
|
1. 确认本机存在 `htsy-cli`:Linux/macOS 用 `command -v htsy-cli && htsy-cli version`,Windows PowerShell 用 `Get-Command htsy-cli.exe -ErrorAction SilentlyContinue` 和 `htsy-cli.exe version`。
|
||||||
2. 如果不存在,从 `https://git.ikuban.com/server/htsy-cli/releases` 下载当前系统和架构对应的 release 附件并安装。
|
2. 如果不存在,读取 [cli-install.md](references/cli-install.md) 后按当前系统和架构安装。
|
||||||
3. 执行 `htsy-cli status` 查看登录状态;未登录时执行 `htsy-cli login --username USER --password PASS`。
|
3. 执行 `htsy-cli status` 查看登录状态;未登录时执行 `htsy-cli login --username USER --password PASS`。
|
||||||
4. 根据用户目标读取对应模块参考,从字段表中选择接口路径和 JSON 请求体。
|
4. 根据用户目标读取对应模块参考,从字段表中选择接口路径和 JSON 请求体。
|
||||||
5. 使用 `htsy-cli call 接口路径 -d JSON` 调用接口。空请求体统一使用 `-d '{}'`。
|
5. 使用 `htsy-cli call 接口路径 -d JSON` 调用接口。空请求体统一使用 `-d '{}'`。
|
||||||
|
|
||||||
## 安装 CLI
|
|
||||||
|
|
||||||
Release 页面:`https://git.ikuban.com/server/htsy-cli/releases`。
|
|
||||||
|
|
||||||
附件按 `htsy-cli_<系统>_<架构>` 命名,Windows 带 `.exe`:
|
|
||||||
|
|
||||||
| 系统 | 架构 | 附件名 |
|
|
||||||
| --- | --- | --- |
|
|
||||||
| macOS Intel | x86_64 | `htsy-cli_darwin_amd64` |
|
|
||||||
| macOS Apple Silicon | arm64 | `htsy-cli_darwin_arm64` |
|
|
||||||
| Linux x86_64 | x86_64 | `htsy-cli_linux_amd64` |
|
|
||||||
| Linux arm64 | arm64 | `htsy-cli_linux_arm64` |
|
|
||||||
| Windows x86_64 | x86_64 | `htsy-cli_windows_amd64.exe` |
|
|
||||||
| Windows arm64 | arm64 | `htsy-cli_windows_arm64.exe` |
|
|
||||||
|
|
||||||
Linux/macOS 安装示例:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
ASSET_URL="从 https://git.ikuban.com/server/htsy-cli/releases 复制对应 htsy-cli_* 附件下载链接"
|
|
||||||
mkdir -p "$HOME/.local/bin"
|
|
||||||
curl -fL "$ASSET_URL" -o "$HOME/.local/bin/htsy-cli"
|
|
||||||
chmod +x "$HOME/.local/bin/htsy-cli"
|
|
||||||
"$HOME/.local/bin/htsy-cli" version
|
|
||||||
```
|
|
||||||
|
|
||||||
Windows PowerShell 安装示例:
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
$AssetUrl = "从 https://git.ikuban.com/server/htsy-cli/releases 复制 htsy-cli_windows_amd64.exe 下载链接"
|
|
||||||
New-Item -ItemType Directory -Force "$HOME\bin" | Out-Null
|
|
||||||
Invoke-WebRequest -Uri $AssetUrl -OutFile "$HOME\bin\htsy-cli.exe"
|
|
||||||
$env:Path = "$HOME\bin;$env:Path"
|
|
||||||
htsy-cli.exe version
|
|
||||||
```
|
|
||||||
|
|
||||||
如果当前系统或架构没有匹配附件,不要猜测下载地址或改用其他架构,先让用户提供可用 release 附件。
|
|
||||||
|
|
||||||
## 登录与调用
|
## 登录与调用
|
||||||
|
|
||||||
`login` 会按用户名是否包含 `@` 自动选择登录方式:带 `@` 的用户名走子账号登录,不带 `@` 的用户名走主账号登录。登录成功后,CLI 会把登录信息保存到用户主目录下的 `.htsy/config.json`。
|
`login` 会按用户名是否包含 `@` 自动选择登录方式:带 `@` 的用户名走子账号登录,不带 `@` 的用户名走主账号登录。登录成功后,CLI 会把登录信息保存到用户主目录下的 `.htsy/config.json`。
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
# htsy-cli 安装
|
||||||
|
|
||||||
|
仅在本机缺少 `htsy-cli` 时读取本文件。Release 页面:`https://git.ikuban.com/server/htsy-cli/releases`。
|
||||||
|
|
||||||
|
附件按 `htsy-cli_<系统>_<架构>` 命名,Windows 带 `.exe`:
|
||||||
|
|
||||||
|
| 系统 | 架构 | 附件名 |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| macOS Intel | x86_64 | `htsy-cli_darwin_amd64` |
|
||||||
|
| macOS Apple Silicon | arm64 | `htsy-cli_darwin_arm64` |
|
||||||
|
| Linux x86_64 | x86_64 | `htsy-cli_linux_amd64` |
|
||||||
|
| Linux arm64 | arm64 | `htsy-cli_linux_arm64` |
|
||||||
|
| Windows x86_64 | x86_64 | `htsy-cli_windows_amd64.exe` |
|
||||||
|
| Windows arm64 | arm64 | `htsy-cli_windows_arm64.exe` |
|
||||||
|
|
||||||
|
Linux/macOS 安装示例:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ASSET_URL="从 https://git.ikuban.com/server/htsy-cli/releases 复制对应 htsy-cli_* 附件下载链接"
|
||||||
|
mkdir -p "$HOME/.local/bin"
|
||||||
|
curl -fL "$ASSET_URL" -o "$HOME/.local/bin/htsy-cli"
|
||||||
|
chmod +x "$HOME/.local/bin/htsy-cli"
|
||||||
|
"$HOME/.local/bin/htsy-cli" version
|
||||||
|
```
|
||||||
|
|
||||||
|
Windows PowerShell 安装示例:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
$AssetUrl = "从 https://git.ikuban.com/server/htsy-cli/releases 复制 htsy-cli_windows_amd64.exe 下载链接"
|
||||||
|
New-Item -ItemType Directory -Force "$HOME\bin" | Out-Null
|
||||||
|
Invoke-WebRequest -Uri $AssetUrl -OutFile "$HOME\bin\htsy-cli.exe"
|
||||||
|
$env:Path = "$HOME\bin;$env:Path"
|
||||||
|
htsy-cli.exe version
|
||||||
|
```
|
||||||
|
|
||||||
|
如果当前系统或架构没有匹配附件,不要猜测下载地址或改用其他架构,先让用户提供可用 release 附件。
|
||||||
Reference in New Issue
Block a user