cliany-site Skill
Use this skill when the user wants to automate web workflows into callable CLI commands using cliany-site.
cliany-site converts any web workflow into an executable CLI command. It connects to Chrome via CDP, captures page accessibility trees (AXTree), uses an LLM to plan actions, and generates Python/Click command-line adapters.
When to Use
- - User wants to automate a web workflow (form submission, search, navigation, etc.)
- User wants to turn a web operation into a repeatable CLI command
- User wants to check if cliany-site environment is ready
- User wants to manage web sessions or login states
- User wants to list or run previously generated adapters
- User mentions "cliany-site", "web automation", "CDP", "browser CLI", or "web CLI"
Prerequisites
Before using cliany-site, verify the environment:
- 1. Python 3.11+ with
cliany-site installed - Chrome with CDP enabled (auto-managed or manual
--remote-debugging-port=9222) - LLM API Key — at least one of:
-
CLIANY_ANTHROPIC_API_KEY (recommended)
-
CLIANY_OPENAI_API_KEY
- Legacy
ANTHROPIC_API_KEY (still supported)
Run the doctor command to verify all prerequisites:
CODEBLOCK0
Expected output on success:
CODEBLOCK1
Installation
CODEBLOCK2
LLM Configuration
Set up via environment variables or .env file:
CODEBLOCK3
Configuration file locations (priority low to high):
- 1. INLINECODE6
- INLINECODE7
- Project INLINECODE8
- System environment variables
Commands Reference
doctor — Environment Check
CODEBLOCK4
Checks all prerequisites: CDP connection, LLM key, adapter directory structure.
Output fields:
- -
cdp (bool): Chrome CDP available - INLINECODE10 (bool): LLM API key configured
- INLINECODE11 (str): adapter storage path
Always run doctor first before any other operation to ensure the environment is ready.
login — Website Login
CODEBLOCK5
Opens the specified URL, waits for the user to complete manual login, then saves the session to ~/.cliany-site/sessions/.
When to use: Before exploring workflows that require authentication.
explore — Explore and Generate Workflow
CODEBLOCK6
This is the core command. It:
- 1. Connects to Chrome via CDP
- Captures the page AXTree
- Sends the tree to the LLM with the workflow description
- LLM plans and executes actions step by step
- Generates a Click CLI adapter at INLINECODE13
Parameters:
- -
url: Target web page URL - INLINECODE15 : Natural language description of the workflow
Example:
CODEBLOCK7
After success, a github.com adapter is auto-registered as a subcommand.
list — List Adapters
CODEBLOCK8
Lists all generated adapters by domain name.
Execute Adapter Commands
CODEBLOCK9
Runs a specific command from a generated adapter.
Example:
CODEBLOCK10
tui — Terminal UI Manager
CODEBLOCK11
Visual terminal interface for managing adapters, viewing logs, and configuration.
Output Format
All commands output a standard JSON envelope when --json is passed:
CODEBLOCK12
On failure:
CODEBLOCK13
Error codes:
| Code | Meaning |
|---|
| INLINECODE18 | Chrome not running or port 9222 not open |
| INLINECODE19 |
No LLM API key configured |
|
COMMAND_NOT_FOUND | Unknown command or adapter not found |
|
EXPLORE_FAILED | Workflow exploration failed |
Exit codes:
- -
0: success - INLINECODE23 : failure (details in JSON
error field)
Typical Workflow
Follow this sequence when automating a new website:
Step 1: Verify Environment
cliany-site doctor --json
If
cdp is false, Chrome will be auto-started. If
llm is false, configure API keys first.
Step 2: Login (if needed)
cliany-site login "https://target-site.com" --json
Wait for the user to complete manual login in the browser.
Step 3: Explore Workflow
cliany-site explore "https://target-site.com" "describe the workflow here" --json
The LLM analyzes the page and generates adapter commands.
Step 4: Use Generated Commands
CODEBLOCK17
Step 5: Re-explore if Needed
Run explore again on the same domain to add more commands. Existing adapters are merged incrementally — existing commands are preserved.
Automation Script Example
CODEBLOCK18
Architecture Notes
- - Adapter storage:
~/.cliany-site/adapters/<domain>/ (commands.py + metadata.json) - Session storage: INLINECODE28
- AXTree-based selectors: Fuzzy element matching survives minor UI changes
- Incremental merging: Re-exploring the same domain adds new commands without breaking existing ones
- Atomic commands: Reusable operations (login, search) extracted and shared across adapters
Security & Privacy
- - cliany-site connects to a local Chrome instance via CDP on INLINECODE29
- LLM API calls send page AXTree (accessibility structure, no visual content) to the configured provider
- Session cookies are stored locally under INLINECODE30
- Generated adapters contain only Click CLI code and metadata — no credentials are embedded
- No data is sent to external endpoints other than the configured LLM API
External Endpoints
| Endpoint | Purpose | Data Sent |
|---|
| Configured LLM API (Anthropic/OpenAI) | Workflow analysis and action planning | Page AXTree structure, workflow description |
| INLINECODE31 |
Chrome CDP connection | CDP protocol commands |
Trust Statement
By using this skill, page accessibility tree data is sent to your configured LLM provider (Anthropic or OpenAI) for workflow analysis. Only install and use if you trust your LLM provider with the structural content of pages you browse.
Model Invocation Note
This skill is designed for autonomous invocation by AI agents. When installed, the agent may automatically call cliany-site commands (doctor, login, explore, list) based on user intent without explicit per-command confirmation. This is standard behavior for agent skills. To disable autonomous invocation, remove the skill from the agent's skill directory.
Troubleshooting
| Issue | Solution |
|---|
| INLINECODE32 | Run cliany-site doctor to auto-start Chrome, or manually start with INLINECODE34 |
| INLINECODE35 |
Set
CLIANY_ANTHROPIC_API_KEY or
CLIANY_OPENAI_API_KEY |
| Explore produces no commands | Provide more specific workflow description; ensure the page has loaded fully |
| Adapter command fails | Page structure may have changed; re-run explore to regenerate |
| Login session expired | Re-run
cliany-site login <url> |
cliany-site 技能
当用户想要使用 cliany-site 将网页工作流自动化成可调用的 CLI 命令时,使用此技能。
cliany-site 可将任何网页工作流转换为可执行的 CLI 命令。它通过 CDP 连接到 Chrome,捕获页面无障碍树(AXTree),使用 LLM 规划操作,并生成 Python/Click 命令行适配器。
使用场景
- - 用户想要自动化网页工作流(表单提交、搜索、导航等)
- 用户想要将网页操作转换为可重复执行的 CLI 命令
- 用户想要检查 cliany-site 环境是否就绪
- 用户想要管理网页会话或登录状态
- 用户想要列出或运行之前生成的适配器
- 用户提到cliany-site、网页自动化、CDP、浏览器 CLI或网页 CLI
前置条件
使用 cliany-site 前,请验证环境:
- 1. Python 3.11+ 并已安装 cliany-site
- Chrome 已启用 CDP(自动管理或手动 --remote-debugging-port=9222)
- LLM API 密钥 — 至少配置以下之一:
- CLIANY
ANTHROPICAPI_KEY(推荐)
- CLIANY
OPENAIAPI_KEY
- 旧版 ANTHROPIC
APIKEY(仍支持)
运行诊断命令验证所有前置条件:
bash
cliany-site doctor --json
成功时的预期输出:
json
{
success: true,
data: {cdp: true, llm: true, adapters_dir: /Users/you/.cliany-site/adapters},
error: null
}
安装
bash
克隆并安装
git clone https://github.com/pearjelly/cliany.site.git
cd cliany.site
pip install -e .
验证
cliany-site --version
cliany-site doctor --json
LLM 配置
通过环境变量或 .env 文件配置:
bash
Anthropic(推荐)
export CLIANY
LLMPROVIDER=anthropic
export CLIANY
ANTHROPICAPI_KEY=sk-ant-...
OpenAI 备选
export CLIANY
LLMPROVIDER=openai
export CLIANY
OPENAIAPI_KEY=sk-...
配置文件位置(优先级从低到高):
- 1. ~/.config/cliany-site/.env
- ~/.cliany-site/.env
- 项目 .env
- 系统环境变量
命令参考
doctor — 环境检查
bash
cliany-site doctor [--json]
检查所有前置条件:CDP 连接、LLM 密钥、适配器目录结构。
输出字段:
- - cdp(布尔值):Chrome CDP 是否可用
- llm(布尔值):LLM API 密钥是否已配置
- adapters_dir(字符串):适配器存储路径
在任何其他操作之前始终先运行 doctor,以确保环境就绪。
login — 网站登录
bash
cliany-site login [--json]
打开指定 URL,等待用户完成手动登录,然后将会话保存到 ~/.cliany-site/sessions/。
使用场景: 在探索需要身份验证的工作流之前使用。
explore — 探索并生成工作流
bash
cliany-site explore [--json]
这是核心命令。它会:
- 1. 通过 CDP 连接到 Chrome
- 捕获页面 AXTree
- 将树结构和工作流描述发送给 LLM
- LLM 逐步规划并执行操作
- 在 ~/.cliany-site/adapters// 生成 Click CLI 适配器
参数:
- - url:目标网页 URL
- workflow_description:工作流的自然语言描述
示例:
bash
cliany-site explore https://github.com 搜索 cliany.site 仓库并查看 README --json
成功后,github.com 适配器会自动注册为子命令。
list — 列出适配器
bash
cliany-site list [--json]
按域名列出所有已生成的适配器。
执行适配器命令
bash
cliany-site [args...] [--json]
运行生成适配器中的特定命令。
示例:
bash
cliany-site github.com search --query browser-use --json
tui — 终端 UI 管理器
bash
cliany-site tui
用于管理适配器、查看日志和配置的可视化终端界面。
输出格式
所有命令在传递 --json 参数时输出标准 JSON 信封:
json
{
success: true,
data: { ... },
error: null
}
失败时:
json
{
success: false,
data: null,
error: {
code: ERROR_CODE,
message: 错误描述
}
}
错误码:
| 错误码 | 含义 |
|---|
| CDPUNAVAILABLE | Chrome 未运行或端口 9222 未开放 |
| LLMKEY_MISSING |
未配置 LLM API 密钥 |
| COMMAND
NOTFOUND | 未知命令或未找到适配器 |
| EXPLORE_FAILED | 工作流探索失败 |
退出码:
- - 0:成功
- 1:失败(详情见 JSON error 字段)
典型工作流
自动化新网站时请按以下顺序操作:
步骤 1:验证环境
bash
cliany-site doctor --json
如果 cdp 为 false,Chrome 将自动启动。如果 llm 为 false,请先配置 API 密钥。
步骤 2:登录(如需)
bash
cliany-site login https://target-site.com --json
等待用户在浏览器中完成手动登录。
步骤 3:探索工作流
bash
cliany-site explore https://target-site.com 在此描述工作流 --json
LLM 分析页面并生成适配器命令。
步骤 4:使用生成的命令
bash
cliany-site list --json
cliany-site target-site.com
[args] --json
步骤 5:如需重新探索
在同一域名上再次运行 explore 以添加更多命令。现有适配器会增量合并——已有命令会被保留。
自动化脚本示例
bash
#!/bin/bash
set -e
检查环境
result=$(cliany-site doctor --json)
if ! echo $result | python3 -c import sys,json; d=json.loads(sys.stdin.read()); exit(0 if d[success] else 1); then
echo 环境未就绪
exit 1
fi
探索工作流
cliany-site explore https://example.com 提交联系表单 --json
执行生成的命令
cliany-site example.com submit --name 测试 --email test@test.com --json
架构说明
- - 适配器存储:~/.cliany-site/adapters//(commands.py + metadata.json)
- 会话存储:~/.cliany-site/sessions/
- 基于 AXTree 的选择器:模糊元素匹配可应对轻微 UI 变化
- 增量合并:重新探索同一域名会添加新命令,不会破坏现有命令
- 原子命令:可复用的操作(登录、搜索)会被提取并在适配器间共享
安全与隐私
- - cliany-site 通过 CDP 在 localhost:9222 连接到本地 Chrome 实例
- LLM API 调用将页面 AXTree(无障碍结构,不含视觉内容)发送到已配置的提供商
- 会话 Cookie 本地存储在 ~/.cliany-site/sessions/ 下
- 生成的适配器仅包含 Click CLI 代码和元数据——不嵌入任何凭据
- 除已配置的 LLM API 外,不会向外部端点发送任何数据
外部端点
| 端点 | 用途 | 发送的数据 |
|---|
| 已配置的 LLM API(Anthropic/OpenAI) | 工作流分析和操作规划 | 页面 AXTree 结构、工作流描述 |
| localhost:9222 |
Chrome CDP 连接 | CDP 协议命令 |
信任声明
使用此技能即表示,页面无障碍树数据将被发送到您配置的 LLM 提供商(Anthropic 或 OpenAI)用于工作流分析。仅当您信任您的 LLM 提供商处理您浏览页面的结构内容时才安装和使用。
模型调用说明
此技能