Skill: pearjelly/cliany-site (version 0.1.1)

--- name: cliany-site description: Use when the user wants to automate web workflows into CLI commands via Chrome CDP and LLM. Supports exploring pages, generating adapters, and replaying actions through the cliany-site tool. license: Apache-2.0 compatibility: opencode, claude-code, openclaw, codex homepage: https://github.com/pearjelly/cliany.site metadata: clawdbot: emoji: "🌐" requires: env: ["CLIANY_ANTHROPIC_API_KEY"] primaryEnv: "CLIANY_ANTHROPIC_API_KEY" files: ["scripts/*"] --- # 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 2. **Chrome** with CDP enabled (auto-managed or manual `--remote-debugging-port=9222`) 3. **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: ```bash cliany-site doctor --json ``` Expected output on success: ```json { "success": true, "data": {"cdp": true, "llm": true, "adapters_dir": "/Users/you/.cliany-site/adapters"}, "error": null } ``` ## Installation ```bash # Clone and install git clone https://github.com/pearjelly/cliany.site.git cd cliany.site pip install -e . # Verify cliany-site --version cliany-site doctor --json ``` ### LLM Configuration Set up via environment variables or `.env` file: ```bash # Anthropic (recommended) export CLIANY_LLM_PROVIDER=anthropic export CLIANY_ANTHROPIC_API_KEY="sk-ant-..." # OpenAI alternative export CLIANY_LLM_PROVIDER=openai export CLIANY_OPENAI_API_KEY="sk-..." ``` Configuration file locations (priority low to high): 1. `~/.config/cliany-site/.env` 2. `~/.cliany-site/.env` 3. Project `.env` 4. System environment variables ## Commands Reference ### doctor — Environment Check ```bash cliany-site doctor [--json] ``` Checks all prerequisites: CDP connection, LLM key, adapter directory structure. **Output fields:** - `cdp` (bool): Chrome CDP available - `llm` (bool): LLM API key configured - `adapters_dir` (str): adapter storage path **Always run doctor first** before any other operation to ensure the environment is ready. ### login — Website Login ```bash cliany-site login <url> [--json] ``` 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 ```bash cliany-site explore <url> <workflow_description> [--json] ``` This is the core command. It: 1. Connects to Chrome via CDP 2. Captures the page AXTree 3. Sends the tree to the LLM with the workflow description 4. LLM plans and executes actions step by step 5. Generates a Click CLI adapter at `~/.cliany-site/adapters/<domain>/` **Parameters:** - `url`: Target web page URL - `workflow_description`: Natural language description of the workflow **Example:** ```bash cliany-site explore "https://github.com" "Search for cliany.site repository and view README" --json ``` After success, a `github.com` adapter is auto-registered as a subcommand. ### list — List Adapters ```bash cliany-site list [--json] ``` Lists all generated adapters by domain name. ### Execute Adapter Commands ```bash cliany-site <domain> <command> [args...] [--json] ``` Runs a specific command from a generated adapter. **Example:** ```bash cliany-site github.com search --query "browser-use" --json ``` ### tui — Terminal UI Manager ```bash cliany-site tui ``` Visual terminal interface for managing adapters, viewing logs, and configuration. ## Output Format All commands output a standard JSON envelope when `--json` is passed: ```json { "success": true, "data": { "..." }, "error": null } ``` On failure: ```json { "success": false, "data": null, "error": { "code": "ERROR_CODE", "message": "Error description" } } ``` **Error codes:** | Code | Meaning | |------|---------| | `CDP_UNAVAILABLE` | Chrome not running or port 9222 not open | | `LLM_KEY_MISSING` | No LLM API key configured | | `COMMAND_NOT_FOUND` | Unknown command or adapter not found | | `EXPLORE_FAILED` | Workflow exploration failed | **Exit codes:** - `0`: success - `1`: failure (details in JSON `error` field) ## Typical Workflow Follow this sequence when automating a new website: ### Step 1: Verify Environment ```bash 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) ```bash cliany-site login "https://target-site.com" --json ``` Wait for the user to complete manual login in the browser. ### Step 3: Explore Workflow ```bash 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 ```bash cliany-site list --json cliany-site target-site.com <generated-command> [args] --json ``` ### 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 ```bash #!/bin/bash set -e # Check environment 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 "Environment not ready" exit 1 fi # Explore workflow cliany-site explore "https://example.com" "submit the contact form" --json # Execute generated command cliany-site example.com submit --name "Test" --email "[REDACTED_SECRET]" --json ``` ## Architecture Notes - **Adapter storage**: `~/.cliany-site/adapters/<domain>/` (commands.py + metadata.json) - **Session storage**: `~/.cliany-site/sessions/` - **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 `localhost:9222` - LLM API calls send page AXTree (accessibility structure, no visual content) to the configured provider - Session cookies are stored locally under `~/.cliany-site/sessions/` - 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 | | `localhost:9222` | 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 | |-------|----------| | `CDP_UNAVAILABLE` | Run `cliany-site doctor` to auto-start Chrome, or manually start with `--remote-debugging-port=9222` | | `LLM_KEY_MISSING` | 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>` |

path: README.md
content: # cliany-site Skill

将任意网页工作流自动化为可调用 CLI 命令的 AI Agent Skill。

[![OpenCode](https://img.shields.io/badge/OpenCode-skill-blue?style=flat)](https://opencode.ai/docs/skills/)
[![Claude Code](https://img.shields.io/badge/Claude_Code-skill-purple?style=flat)](https://code.claude.com/docs/en/skills)
[![OpenClaw](https://img.shields.io/badge/OpenClaw-skill-orange?style=flat)](https://clawhub.ai)
[![License](https://img.shields.io/badge/License-Apache_2.0-green?style=flat)](/LICENSE)

## 概述

cliany-site 通过 Chrome CDP 协议捕获页面可访问性树（AXTree），借助 LLM（Claude/GPT-4o）将网页操作转化为可执行的 Python/Click CLI 命令。此 Skill 让 AI 编程助手能够直接调用 cliany-site 来自动化任意网页工作流。

**核心能力：**
- 零侵入式网页探索（基于 AXTree，非 DOM 注入）
- LLM 驱动的工作流分析与代码生成
- 标准 JSON 信封输出，适合 agent 解析
- 跨命令 Session 持久化
- 按域名动态加载生成的 adapter 子命令
- 增量合并：重复 explore 不破坏已有命令

## 安装

### OpenCode

```bash
# 全局安装（所有项目可用）
mkdir -p ~/.config/opencode/skills/cliany-site
cp SKILL.md ~/.config/opencode/skills/cliany-site/SKILL.md

# 或项目级安装
mkdir -p .opencode/skills/cliany-site
cp SKILL.md .opencode/skills/cliany-site/SKILL.md
```

### Claude Code / OpenClaw

```bash
# 全局安装
mkdir -p ~/.claude/skills/cliany-site
cp SKILL.md ~/.claude/skills/cliany-site/SKILL.md

# 或 OpenClaw 专用路径
mkdir -p ~/.openclaw/skills/cliany-site
cp SKILL.md ~/.openclaw/skills/cliany-site/SKILL.md
```

### Codex

```bash
mkdir -p ~/.codex/skills/cliany-site
cp SKILL.md ~/.codex/skills/cliany-site/SKILL.md
```

### 一键安装（推荐）

```bash
bash scripts/install.sh
```

自动检测已安装的 AI 编程工具并安装到对应目录。

## 前置条件

1. Python 3.11+，已安装 `cliany-site`（`pip install -e .`）
2. Chrome 浏览器（cliany-site 可自动启动 CDP 调试实例）
3. LLM API Key：`CLIANY_ANTHROPIC_API_KEY` 或 `CLIANY_OPENAI_API_KEY`

## 使用示例

安装 Skill 后，直接在 AI 编程助手中描述需求：

```
帮我自动化 GitHub 上的仓库搜索工作流
```

```
用 cliany-site 检查一下环境是否准备好了
```

```
登录 https://example.com 然后探索提交表单的工作流
```

AI 助手会自动调用 cliany-site 的相关命令完成操作。

## 项目主页

- GitHub: https://github.com/pearjelly/cliany.site
- 文档: https://cliany.site

## 许可证

Apache License 2.0


path: clawhub.json
content: {
  "name": "cliany-site",
  "tagline": "Turn any web workflow into a callable CLI command via Chrome CDP and LLM",
  "description": "cliany-site converts browser workflows into executable CLI commands. It connects to Chrome via CDP, captures page accessibility trees, uses LLM to plan actions, and generates Python/Click adapters. This skill enables AI agents to drive the full automation cycle: environment check, login, workflow exploration, adapter generation, and command replay.",
  "category": "tools",
  "tags": ["automation", "browser", "cdp", "web", "cli", "workflow"],
  "version": "0.1.1",
  "license": "Apache-2.0",
  "pricing": "free",
  "support_url": "https://github.com/pearjelly/cliany.site/issues",
  "homepage": "https://github.com/pearjelly/cliany.site"
}


path: scripts/install.sh
content: #!/bin/bash
# SECURITY MANIFEST:
#   Environment variables accessed: none
#   External endpoints called: none
#   Local files read: SKILL.md (from script directory)
#   Local files written: SKILL.md to skill directories of detected AI tools
set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
SKILL_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
SKILL_FILE="$SKILL_DIR/SKILL.md"

if [ ! -f "$SKILL_FILE" ]; then
  echo "错误: 找不到 SKILL.md 文件: $SKILL_FILE"
  exit 1
fi

installed=0

# --- OpenCode (全局) ---
OPENCODE_DIR="$HOME/.config/opencode/skills/cliany-site"
if command -v opencode >/dev/null 2>&1 || [ -d "$HOME/.config/opencode" ]; then
  mkdir -p "$OPENCODE_DIR"
  cp "$SKILL_FILE" "$OPENCODE_DIR/SKILL.md"
  echo "[OK] OpenCode (全局): $OPENCODE_DIR/SKILL.md"
  installed=$((installed + 1))
fi

# --- Claude Code / OpenClaw ---
CLAUDE_DIR="$HOME/.claude/skills/cliany-site"
if [ -d "$HOME/.claude" ] || command -v claude >/dev/null 2>&1; then
  mkdir -p "$CLAUDE_DIR"
  cp "$SKILL_FILE" "$CLAUDE_DIR/SKILL.md"
  echo "[OK] Claude Code: $CLAUDE_DIR/SKILL.md"
  installed=$((installed + 1))
fi

OPENCLAW_DIR="$HOME/.openclaw/skills/cliany-site"
if [ -d "$HOME/.openclaw" ] || command -v openclaw >/dev/null 2>&1; then
  mkdir -p "$OPENCLAW_DIR"
  cp "$SKILL_FILE" "$OPENCLAW_DIR/SKILL.md"
  echo "[OK] OpenClaw: $OPENCLAW_DIR/SKILL.md"
  installed=$((installed + 1))
fi

# --- Codex ---
CODEX_HOME="${CODEX_HOME:-$HOME/.codex}"
CODEX_DIR="$CODEX_HOME/skills/cliany-site"
if [ -d "$CODEX_HOME" ] || command -v codex >/dev/null 2>&1; then
  mkdir -p "$CODEX_DIR"
  cp "$SKILL_FILE" "$CODEX_DIR/SKILL.md"
  echo "[OK] Codex: $CODEX_DIR/SKILL.md"
  installed=$((installed + 1))
fi

# --- .agents 通用路径 ---
AGENTS_DIR="$HOME/.agents/skills/cliany-site"
if [ -d "$HOME/.agents" ]; then
  mkdir -p "$AGENTS_DIR"
  cp "$SKILL_FILE" "$AGENTS_DIR/SKILL.md"
  echo "[OK] .agents (通用): $AGENTS_DIR/SKILL.md"
  installed=$((installed + 1))
fi

# --- 结果 ---
echo ""
if [ "$installed" -eq 0 ]; then
  echo "未检测到已安装的 AI 编程工具。"
  echo ""
  echo "手动安装方法："
  echo "  OpenCode:   mkdir -p ~/.config/opencode/skills/cliany-site && cp SKILL.md ~/.config/opencode/skills/cliany-site/"
  echo "  Claude Code: mkdir -p ~/.claude/skills/cliany-site && cp SKILL.md ~/.claude/skills/cliany-site/"
  echo "  OpenClaw:   mkdir -p ~/.openclaw/skills/cliany-site && cp SKILL.md ~/.openclaw/skills/cliany-site/"
  echo "  Codex:      mkdir -p ~/.codex/skills/cliany-site && cp SKILL.md ~/.codex/skills/cliany-site/"
  exit 1
else
  echo "安装完成！共安装到 $installed 个工具。"
  echo "重启 AI 编程助手后即可使用 cliany-site skill。"
fi


Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (MEDIUM)