cfshare
Use the cfshare CLI to expose local ports/files as temporary Cloudflare Quick Tunnel URLs. Trigger when a user needs a temporary public URL for a local service, needs to share files/directories from terminal, or needs to inspect/export cfshare audit and policy state.
- License 许可
- MIT
- 最近更新
- 2026-06-07
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- cfshare
- metadata
- { "cfshare": { "emoji": "☁️", "author": "ystemsrx", "requires": { "bins": [ "cfshare", "cloudflared" ] } } }
- description
- Use the cfshare CLI to expose local ports/files as temporary Cloudflare Quick Tunnel URLs. Trigger when a user needs a temporary public URL for a local service, needs to share files/directories from terminal, or needs to inspect/export cfshare audit and policy state.
- allowed-tools
- Bash(cfshare:*)
03 SKILL.md 正文
CFShare CLI Skill
cfshare wraps Cloudflare Quick Tunnel and outputs structured JSON.
Install when version checks fail
If either command fails, install missing binaries before running any cfshare tool.
cfshare --version
cloudflared --version
- If
cfshare --versionfails, installcfshare(requires Node.js and npm):
npm install -g @ystemsrx/cfshare
- If
cloudflared --versionfails, installcloudflaredby platform:
macOS:
brew install cloudflare/cloudflare/cloudflared
Debian/Ubuntu:
curl -fsSL https://pkg.cloudflare.com/cloudflare-main.gpg | sudo tee /usr/share/keyrings/cloudflare-main.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/cloudflare-main.gpg] https://pkg.cloudflare.com/cloudflared $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/cloudflared.list
sudo apt-get update && sudo apt-get install -y cloudflared
Windows (PowerShell):
winget install --id Cloudflare.cloudflared
WSL/Linux generic binary install:
curl -fsSL https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 -o /usr/local/bin/cloudflared
sudo chmod +x /usr/local/bin/cloudflared
- Re-run both version checks. If still failing, stop and report exact stderr output to user.
CLI contract
cfshare <tool> [params-json] [options]
Supported tools:
env_checkexpose_portexpose_filesexposure_listexposure_getexposure_stopexposure_logsmaintenanceaudit_queryaudit_export
Global options:
--params '<json>'or--params-file <path>--config '<json>'or--config-file <path>--workspace-dir <dir>(only used byexpose_files)--keep-alive(forexpose_*, keep foreground process alive)--no-keep-alive(default forexpose_*, print result then exit)--compact
Command names accept _ and - (for example expose-port == expose_port).
Standard workflow for agents
- Run
env_checkfirst. - Create exposure with
expose_portorexpose_files. - Return
public_urlandexpires_atto user immediately. - By default,
expose_*prints result and exits. - Use
--keep-aliveonly when foreground lifecycle control is needed; stop withCtrl+Cwhen done.
Recommended for stable automation:
- Prefer
--params/--params-fileover positional raw JSON to reduce quoting errors. - Prefer
access: "token"for sensitive content. - Treat
access: "none"as publicly readable by anyone with link.
Tool usage
1) env_check
cfshare env_check
Returns:
cloudflared.ok/path/versiondefaults(effective policy + runtime paths)warnings
2) expose_port
cfshare expose_port --params '{"port":3000,"opts":{"access":"token","ttl_seconds":3600}}'
Params:
port:1..65535opts.ttl_secondsopts.access:token | basic | noneopts.protect_origin: defaultaccess != "none"opts.allowlist_paths: path prefix allowlist for reverse proxy
Returns:
idpublic_url(token mode auto-appends?token=...)local_urlexpires_ataccess_info(secrets are masked)
3) expose_files
cfshare expose_files --params '{"paths":["./dist"],"opts":{"mode":"normal","presentation":"preview","access":"none"}}'
Params:
paths: files/directories to copy into temp workspaceopts.mode:normal | zip(defaultnormal)opts.presentation:download | preview | raw(defaultdownload)opts.ttl_secondsopts.access:token | basic | noneopts.max_downloads: auto-stop after threshold
File Serving Behavior:
Mode: normal
- Single file → served directly at the root URL.
- Multiple files or a directory → displayed in an intuitive file explorer interface.
Mode: zip
- All files are packaged into a ZIP archive.
Presentation:
- Default behaviors: download | preview | raw
- Behavior can be overridden via query parameters.
- download → forces browser file save.
- preview → renders inline (images, PDF, Markdown, audio/video, HTML, text, etc.).
- raw → serves original content without any wrapper.
- If a file type is not previewable, preview automatically falls back to raw, then to download.
Returns:
id,public_url,expires_at,mode,presentationmanifest,manifest_mode,manifest_meta
4) exposure_list
cfshare exposure_list
Lists tracked sessions with id/type/status/public_url/local_url/expires_at.
5) exposure_get
cfshare exposure_get --params '{"id":"port_xxx","opts":{"probe_public":true}}'
cfshare exposure_get --params '{"filter":{"status":"running"},"fields":["id","status","public_url"]}'
Supports selector by id, ids, or filter.
Can probe public reachability via opts.probe_public.
6) exposure_stop
cfshare exposure_stop --params '{"id":"all"}'
Stops tunnel/proxy/origin and removes temporary workspace.
Returns {stopped, failed, cleaned}.
7) exposure_logs
cfshare exposure_logs --params '{"id":"files_xxx","opts":{"component":"all","lines":200}}'
component: tunnel | origin | all.
8) maintenance
cfshare maintenance --params '{"action":"run_gc"}'
cfshare maintenance --params '{"action":"set_policy","opts":{"policy":{"maxTtlSeconds":7200},"ignore_patterns":["*.pem",".env*"]}}'
Actions:
start_guardrun_gcset_policy(requiresopts.policyoropts.ignore_patterns)
9) audit_query
cfshare audit_query --params '{"filters":{"event":"exposure_started","limit":100}}'
10) audit_export
cfshare audit_export --params '{"range":{"from_ts":"2026-01-01T00:00:00Z","output_path":"./audit.jsonl"}}'
Runtime files (CLI mode)
Default CLI state directory is ~/.cfshare:
policy.jsonpolicy.ignoreaudit.jsonlsessions.jsonworkspaces/exports/
Important limitations in CLI mode
expose_portandexpose_filesexit by default after printing result; use--keep-aliveto hold foreground.- Current session registry is in-process memory; separate
cfshareinvocations do not restore full live session state. basicmode credentials are masked in outputs, sotokenis usually the practical authenticated mode for agent-delivered links.
Troubleshooting
cloudflared binary not found: installcloudflaredor set--config '{"cloudflaredPath":"..."}'local service is not reachable on 127.0.0.1:<port>: start service firstpath blocked by ignore policy: adjustpolicy.ignoreormaintenance set_policyport blocked by policy: updateblockedPortsin policy if intentional
Use CFSHARE_LOG_LEVEL=info or CFSHARE_LOG_LEVEL=debug for more stderr logs.
04 同仓库更多 Skills
crowd-prompting
A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.
ceaser
Interact with the Ceaser privacy protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- shield, unshield, note management, and protocol queries. All ceaser tool calls use CLI subcommands (npx -y ceaser-mcp <subcommand>). Ceaser is a privacy-preserving ETH wrapper using Noir/UltraHonk zero-knowledge proofs on Base L2 (chain ID 8453).
ceaser-send
Fully automated private ETH transfer via Ceaser Protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- all ceaser tool calls use CLI subcommands (npx -y ceaser-mcp <subcommand>). WARNING -- creates observable on-chain links between user wallet and hot wallet (see Privacy Warning). Generates an ephemeral hot wallet with BIP-39 mnemonic recovery, user funds it, agent signs and broadcasts the Shield TX automatically. Exactly one manual step required (funding the hot wallet with ETH). Uses Noir/UltraHonk zero-knowledge proofs.
dilemm-ai
Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).
moldium
Post and manage content on the Moldium blog platform. Triggered by "post to Moldium", "write a blog post", "publish an article", etc.
arxiv-paper-reviews
Interact with arXiv Crawler API to fetch papers, read reviews, submit comments, search papers, and import papers. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, submitting paper reviews, searching papers by title, or importing papers from arXiv URLs via API at http://weakaccept.top:8000/.