{"id":47736013,"url":"https://github.com/pearjelly/cliany.site","last_synced_at":"2026-04-14T05:00:30.500Z","repository":{"id":346799973,"uuid":"1191519875","full_name":"pearjelly/cliany.site","owner":"pearjelly","description":"将任意网页操作自动化为可调用的 CLI 命令。基于 browser-use 和 LLM，通过 CDP 协议实现从网页探索到代码生成、回放的全流程自动化。","archived":false,"fork":false,"pushed_at":"2026-04-11T02:49:33.000Z","size":14369,"stargazers_count":7,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-11T04:27:46.103Z","etag":null,"topics":["accessibility-tree","axtree","browser-automation","chrome-cdp","cli","code-generation","devtools","llm","python","workflow-automation"],"latest_commit_sha":null,"homepage":"https://www.cliany.site","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pearjelly.png","metadata":{"files":{"readme":"README.en.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-03-25T10:23:52.000Z","updated_at":"2026-04-11T02:49:41.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pearjelly/cliany.site","commit_stats":null,"previous_names":["pearjelly/cliany.site"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/pearjelly/cliany.site","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pearjelly%2Fcliany.site","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pearjelly%2Fcliany.site/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pearjelly%2Fcliany.site/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pearjelly%2Fcliany.site/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pearjelly","download_url":"https://codeload.github.com/pearjelly/cliany.site/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pearjelly%2Fcliany.site/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31782740,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["accessibility-tree","axtree","browser-automation","chrome-cdp","cli","code-generation","devtools","llm","python","workflow-automation"],"created_at":"2026-04-02T22:38:11.135Z","updated_at":"2026-04-14T05:00:30.479Z","avatar_url":"https://github.com/pearjelly.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cliany-site\n\n[![PyPI version](https://img.shields.io/pypi/v/cliany-site)](https://pypi.org/project/cliany-site/)\n[![Python](https://img.shields.io/pypi/pyversions/cliany-site)](https://pypi.org/project/cliany-site/)\n[![CI](https://github.com/pearjelly/cliany.site/actions/workflows/ci.yml/badge.svg)](https://github.com/pearjelly/cliany.site/actions/workflows/ci.yml)\n[![License](https://img.shields.io/github/license/pearjelly/cliany.site)](LICENSE)\n\n\u003e Turn any web interaction into callable CLI commands\n\ncliany-site uses browser-use and Large Language Models (LLM) to automate the full workflow from web exploration to code generation and replay via Chrome CDP protocol. One command to explore, one command to execute — turning complex web workflows into reusable CLI tools.\n\n## Features\n\n### Core\n\n- **Zero-intrusion Exploration** — Captures page AXTree via Chrome CDP, no script injection needed\n- **LLM-driven Code Generation** — Claude / GPT-4o understands page semantics, auto-generates Python CLI commands\n- **Standard JSON Output** — All commands support `--json`, outputting unified `{success, data, error}` envelopes\n- **Persistent Sessions** — Maintains Cookie / LocalStorage login state across commands\n- **Dynamic Adapter Loading** — Auto-registers CLI subcommands by domain, extensible at any time\n- **Chrome Auto-management** — Automatically detects and launches Chrome debugging instances\n\n### Developer Experience\n\n- **Incremental Adapter Merging** — Re-exploring the same site intelligently merges adapters, preserving existing commands\n- **Atomic Command System** — Auto-extracts reusable atomic operations, shareable across adapters\n- **Real-time Progress Feedback** — Rich progress bars and NDJSON streaming events during explore/execute\n- **Smart Self-healing** — AXTree snapshot diffing, selector hot-fixing without re-exploration\n- **Checkpoint Resume** — Records breakpoints on failure, `--resume` from last checkpoint\n\n### Enterprise Features\n\n- **Headless \u0026 Remote Browser** — Supports `--headless` and `--cdp-url ws://host:port`, runs on servers/Docker\n- **YAML Workflow Orchestration** — Declarative multi-step workflows with inter-step data passing, conditionals, and retry policies\n- **Data-driven Batch Execution** — CSV/JSON parameter lists, concurrency control, summary reports\n- **Encrypted Session Storage** — Fernet symmetric encryption + system Keychain key management\n- **Sandbox Execution Mode** — `--sandbox` restricts cross-domain navigation and dangerous operations\n- **Generated Code Security Audit** — AST static analysis detects eval/exec/os.system and other dangerous patterns\n\n### Ecosystem Integration\n\n- **Python SDK** — `from cliany_site import explore, execute`, programmatic access\n- **HTTP API** — `cliany-site serve --port 8080` launches a REST API server\n- **Adapter Marketplace** — Package, install, uninstall, and rollback adapters for team sharing\n- **TUI Management** — Textual-based terminal UI for visual adapter management\n- **iframe/Shadow DOM** — Recursive AXTree capture with cross-origin iframe and Shadow DOM piercing\n\n## Quick Start\n\n### Installation\n\n```bash\n# From PyPI\npip install cliany-site\n\n# Or from source\ngit clone https://github.com/pearjelly/cliany.site.git\ncd cliany.site\npip install -e .\n```\n\n### Configuration\n\n```bash\n# LLM Provider (choose one)\nexport CLIANY_LLM_PROVIDER=anthropic\nexport CLIANY_ANTHROPIC_API_KEY=\"sk-ant-...\"\n\n# Or OpenAI\nexport CLIANY_LLM_PROVIDER=openai\nexport CLIANY_OPENAI_API_KEY=\"sk-...\"\n```\n\nAlso supports `.env` file configuration. Lookup order: `~/.config/cliany-site/.env` → `~/.cliany-site/.env` → project `.env` → environment variables.\n\n### Verify Environment\n\n```bash\ncliany-site doctor --json\n```\n\n## Usage Examples\n\n### Basic Flow\n\n```bash\n# 1. Explore a workflow\ncliany-site explore \"https://github.com\" \"Search repositories and view README\" --json\n\n# 2. List generated commands\ncliany-site list --json\n\n# 3. Execute a generated command\ncliany-site github.com search --query \"browser-use\" --json\n```\n\n### Python SDK\n\n```python\nfrom cliany_site.sdk import ClanySite\n\nasync with ClanySite() as cs:\n    result = await cs.explore(\"https://github.com\", \"Search repositories\")\n    adapters = await cs.list_adapters()\n```\n\n### HTTP API\n\n```bash\n# Start server\ncliany-site serve --port 8080\n\n# Call API\ncurl http://localhost:8080/doctor\ncurl http://localhost:8080/adapters\ncurl -X POST http://localhost:8080/explore \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"url\": \"https://github.com\", \"workflow\": \"Search repositories\"}'\n```\n\n### YAML Workflow Orchestration\n\n```yaml\n# workflow.yaml\nname: GitHub Search Flow\nsteps:\n  - name: Search repositories\n    adapter: github.com\n    command: search\n    params:\n      query: \"cliany-site\"\n  - name: View details\n    adapter: github.com\n    command: view\n    params:\n      repo: \"$prev.data.results[0].name\"\n```\n\n```bash\ncliany-site workflow run workflow.yaml --json\ncliany-site workflow validate workflow.yaml --json\n```\n\n### Batch Execution\n\n```bash\n# Batch execute from CSV\ncliany-site workflow batch github.com search data.csv --concurrency 3 --json\n```\n\n### Adapter Marketplace\n\n```bash\n# Package adapter\ncliany-site market publish github.com --version 1.0.0\n\n# Install adapter\ncliany-site market install ./github.com.cliany-adapter.tar.gz\n\n# Rollback\ncliany-site market rollback github.com\n```\n\n## Command Reference\n\n| Command | Parameters | Description |\n|---------|------------|-------------|\n| `doctor` | `[--json]` | Check environment (CDP, LLM Key, directories) |\n| `login \u003curl\u003e` | `[--json]` | Open URL for login, save session |\n| `explore \u003curl\u003e \u003cworkflow\u003e` | `[--json]` | Explore workflow, generate adapter |\n| `list` | `[--json]` | List generated adapters |\n| `check \u003cdomain\u003e` | `[--json] [--fix]` | Check adapter health |\n| `tui` | | Launch TUI management interface |\n| `serve` | `[--host] [--port]` | Start HTTP API server |\n| `market publish \u003cdomain\u003e` | `[--version] [--json]` | Package and export adapter |\n| `market install \u003cpath\u003e` | `[--force] [--json]` | Install adapter package |\n| `market uninstall \u003cdomain\u003e` | `[--json]` | Uninstall adapter |\n| `market rollback \u003cdomain\u003e` | `[--index] [--json]` | Rollback to backup version |\n| `workflow run \u003cfile\u003e` | `[--json] [--dry-run]` | Execute YAML workflow |\n| `workflow validate \u003cfile\u003e` | `[--json]` | Validate workflow file |\n| `workflow batch \u003cadapter\u003e \u003ccmd\u003e \u003cdata\u003e` | `[--concurrency] [--json]` | Batch execution |\n| `report list` | `[--domain] [--json]` | List execution reports |\n| `report show \u003cid\u003e` | `[--json]` | View report details |\n| `\u003cdomain\u003e \u003ccommand\u003e` | `[--json] [args...]` | Execute adapter command |\n\n**Global options:** `--json` `--verbose` `--debug` `--cdp-url \u003cws://host:port\u003e` `--headless` `--sandbox`\n\n## Architecture\n\n```\ncliany-site/src/cliany_site/\n├── cli.py              # Entry point, SafeGroup global exception handling\n├── config.py           # Unified config (env vars + .env)\n├── errors.py           # Exception hierarchy + error codes\n├── response.py         # JSON envelope {success, data, error}\n├── logging_config.py   # Structured logging (JSON format + sanitization)\n├── sdk.py              # Python SDK (sync + async)\n├── server.py           # HTTP API server (aiohttp)\n├── security.py         # Session encryption (Fernet + Keychain)\n├── sandbox.py          # Sandbox policy enforcement\n├── audit.py            # Code security audit (AST analysis)\n├── marketplace.py      # Adapter marketplace (pack/install/rollback)\n├── browser/            # CDP connection + AXTree + Chrome launcher + iframe\n├── explorer/           # LLM workflow exploration + atom extraction + validation\n├── codegen/            # Code generation (templates/param inference/dedup/merge)\n├── workflow/           # YAML orchestration + batch execution\n├── commands/           # Built-in CLI commands\n└── tui/                # Textual terminal UI\n```\n\n## Security\n\n- **Session Encryption**: Fernet symmetric encryption with keys stored in system Keychain (macOS Keychain / Linux Secret Service), falling back to file-based keys\n- **Sandbox Mode**: `--sandbox` restricts navigation to same domain, blocks `javascript:` / `file://` / `data:` URLs and file downloads\n- **Code Audit**: Generated code is automatically AST-scanned for `eval` / `exec` / `os.system` / `subprocess` and other dangerous calls\n\n## Contributing\n\n```bash\n# Development setup\ngit clone https://github.com/pearjelly/cliany.site.git\ncd cliany.site\npip install -e \".[dev,test]\"\n\n# Quality checks\nruff check src/\nmypy src/cliany_site/\npytest tests/ -v\n```\n\n## Limitations\n\n- Requires Chrome/Chromium (auto-launched or manual `--remote-debugging-port=9222`)\n- Requires a valid LLM API Key (Anthropic or OpenAI)\n- Generated commands depend on page DOM structure; major page redesigns may require re-exploration (minor changes are handled by fuzzy matching and self-healing)\n- Sessions are not shared across browser profiles\n- Cross-origin iframes enabled by default for recursive capture (configurable via `CLIANY_CROSS_ORIGIN_IFRAMES`)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpearjelly%2Fcliany.site","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpearjelly%2Fcliany.site","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpearjelly%2Fcliany.site/lists"}