nuwa-skill
alchaincyf
你想蒸馏的下一个员工,何必是同事。蒸馏任何人的思维方式——心智模型、决策启发式、表达DNA。Distill how anyone thinks.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:deng7112/web2cli
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Turn recorded browser requests into login-aware CLI tools.
Web2CLI is a Chrome extension + CLI template that helps you — and your AI coding agent (e.g. DeepSeek Harness) — turn a website's authenticated API calls into a reusable command-line tool, without manually copying cookies.
中文说明见 README.zh-CN.md。
Building a quick CLI on top of an internal web service usually means:
Cookie header by hand (and it silently expires later).curl, guess which parameters matter.Web2CLI automates the painful parts:
httpOnly)
to a fixed local file. Generated CLIs read that file at runtime, so when the login
refreshes, your CLI keeps working with zero edits.curl/Markdown bundle to an AI
agent that writes the CLI for you.DeepSeek Harness (dsh) is a terminal agent harness ("everything is a plugin"). It cannot drive
a browser. Web2CLI covers the browser side and hands the agent everything it needs:
┌───────────┐ record + sync ┌────────────────────┐
│ Browser │ ───────────────▶ │ Web2CLI extension │
└───────────┘ └─────────┬──────────┘
│ cookie file + recorded requests
▼
┌───────────────────────────────────────┐
│ AI agent (dsh / any) + this repo's │
│ AGENTS.md guide + cli-template/ │
└─────────────────────┬─────────────────┘
│ generates
▼
┌──────────────────────────┐
│ your CLI (Python) │
│ reads cookie file at run │
└──────────────────────────┘
Point your agent's workspace at this repo (or reference AGENTS.md) and ask it to
generate a CLI from your recording — it follows the minimal-interface-set rules and the
cookie-alignment contract automatically.
web2cli/
├── README.md # this file
├── README.zh-CN.md # 中文文档
├── AGENTS.md # guide for AI agents: recording → CLI (read this, dsh!)
├── LICENSE # MIT
├── extension/ # Chrome MV3 extension (the browser side)
│ ├── manifest.json
│ ├── background.js # service worker: cookie sync + CDP recording
│ ├── popup.html / popup.js
│ ├── records.html / records.js # result page: select + copy curl/Markdown/JSON
│ └── README.md
└── cli-template/ # what the agent fills in to produce a CLI
├── cli_template.py # CLI skeleton (runtime cookie loading, auth-expiry detection)
└── read_cookie.py # inspect synced cookie files
chrome://extensions.extension/ directory of this repo.After any code change, hit the reload icon on the Web2CLI card in
chrome://extensions.
~/Downloads/web2cli-cookies/{host}.json. The cookie_header field is a
ready-to-use Cookie string.Paste the Markdown into your AI agent together with a one-line description, e.g.:
"Here are the recorded requests. Build me a CLI to query orders."
The agent follows AGENTS.md: it keeps only the minimal interface set
(target action + its parameter-source queries), fills cli-template/cli_template.py, and verifies.
~/Downloads/web2cli-cookies/{host}.json (format: "web2cli-cookie-v1"):
{
"format": "web2cli-cookie-v1",
"host": "example.com",
"base_domain": "example.com",
"updated_at": "2026-08-20T08:00:00.000Z",
"cookie_count": 12,
"cookie_header": "a=1; b=2; ...", // paste-ready Cookie string
"cookies": [ { "name": "a", "value": "1", "domain": ".example.com", "httpOnly": true } ]
}
Generated CLIs read cookie_header at runtime and apply browser-style domain filtering, so a
stale/overly-broad file can't trigger 400 Request Header Or Cookie Too Large.
| Symptom | Fix |
|---|---|
CLI says [cookie not synced] |
Sync cookies for that host first (Usage §1). |
400 Request Header Or Cookie Too Large |
Use the latest extension (host-scoped filtering) and re-sync. |
| Redirected to / served a login page | Login session expired — log in again in the browser, then re-sync. |
| Missing POST body in recording | Wait for the request to finish before stopping the recording. |
| Blue "debugging this browser" bar | Required by Chrome during recording; cannot be removed. |
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: ai-agent。