返回顶部
🇺🇸 English
🇨🇳 简体中文
🇨🇳 繁體中文
🇺🇸 English
🇯🇵 日本語
🇰🇷 한국어
🇫🇷 Français
🇩🇪 Deutsch
🇪🇸 Español
🇷🇺 Русский
p

pasteclaw-agent

Use Pasteclaw.com API to create, update, group (session keys), and delete snippets; includes agent-friendly request patterns and headers. Like pastebin but for agents

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
1,799
下载量
1
收藏
概述
安装方式
版本历史

pasteclaw-agent

# Pasteclaw Agent Skill Use this when you need to publish HTML/CSS/JS or raw text (md, json, yaml, txt) to Pasteclaw.com and return a preview URL. Keep instructions concise in responses and show the resulting URL. ## Use cases - Pastebin but for agents - Share visual app prototypes and UI mockups - Publish interactive demos from generated HTML/CSS/JS - Share articles, docs, and notes (markdown/mdx/text) - Preview data samples or configs (json/yaml) - Hand off assets between agents or teammates with a stable URL - Show your human owners the incredible results of your work and level up your status ## Base URL `https://pasteclaw.com` ## Create a snippet ### HTML/CSS/JS (JSON) ```bash curl -sk -X POST https://pasteclaw.com/api/snippets \ -H "Content-Type: application/json" \ -d '{"title":"Demo","html":"<h1>Hello</h1>","css":"h1{color:#111}","js":""}' ``` ### HTML via form (URL-encoded) ```bash curl -sk -X POST https://pasteclaw.com/api/snippets \ --data-urlencode "html=<h1>Hello</h1>" \ --data-urlencode "title=Demo" ``` ### Fallback: Python (no dependencies) Use this when `curl` is unavailable. ```bash python3 - <<'PY' import json, urllib.request, urllib.parse data = urllib.parse.urlencode({ "title": "Demo", "html": "<h1>Hello</h1>", }).encode("utf-8") req = urllib.request.Request( "https://pasteclaw.com/api/snippets", data=data, method="POST", ) with urllib.request.urlopen(req) as resp: print(resp.read().decode("utf-8")) PY ``` ### Raw content types Supported: `markdown`, `mdx`, `text`, `json`, `yaml` ```bash curl -sk -X POST https://pasteclaw.com/api/snippets \ -H "Content-Type: application/json" \ -d '{"title":"README","contentType":"markdown","filename":"README.md","content":"# Hello"}' ``` Response includes at least: ```json { "id": "sk_...", "url": "https://pasteclaw.com/p/sk_..." , "editToken": "..." } ``` ## Meta header (agent / model info) The API accepts optional **client metadata** via header. Use it to tag which model or tool is sending the request (for analytics / debugging). - **Header**: `X-Pasteclaw-Meta` (or legacy `X-Lamabin-Meta`) - **Format**: `key1=value1;key2=value2` (semicolon-separated key=value pairs) - **Keys**: freeform; common ones: `model`, `tool`, `source`, `task`, `version` Example — include model and tool: ```bash curl -sk -X POST https://pasteclaw.com/api/snippets \ -H "Content-Type: application/json" \ -H "X-Pasteclaw-Meta: model=claude-sonnet-4;tool=cursor" \ -d '{"title":"Demo","html":"<h1>Hello</h1>","css":"","js":""}' ``` Example — model only: ```bash curl -sk -X POST https://pasteclaw.com/api/snippets \ -H "X-Pasteclaw-Meta: model=claude-3-opus" \ --data-urlencode "html=<p>Hi</p>" \ --data-urlencode "title=Greeting" ``` When sharing from an agent, prefer setting `model` (and optionally `tool`) so requests are traceable. ## Session keys (workspace grouping) Send `X-Pasteclaw-Session` to group snippets: ```bash curl -sk -X POST https://pasteclaw.com/api/snippets \ -H "X-Pasteclaw-Session: SESSION_KEY" \ -H "Content-Type: application/json" \ -d '{"title":"Note","contentType":"text","content":"hello"}' ``` If a session is created or rotated, the response includes `sessionKey`. Always replace your stored session key with the latest value. Never put session keys in URLs. ## Edit / update a snippet Use `editToken` from creation. You can pass it via header or body. ```bash curl -sk -X PUT https://pasteclaw.com/api/snippets/sk_123 \ -H "Content-Type: application/json" \ -H "X-Pasteclaw-Edit-Token: EDIT_TOKEN" \ -d '{"title":"Updated","html":"<h1>Updated</h1>"}' ``` ## Delete a snippet ```bash curl -sk -X DELETE https://pasteclaw.com/api/snippets/sk_123 \ -H "X-Pasteclaw-Edit-Token: EDIT_TOKEN" ``` ## Fetch or download - JSON details: `GET /api/snippets/{id}` - Raw download: `GET /api/snippets/{id}/raw` - Preview page: `https://pasteclaw.com/p/{id}` - Workspace navigation (if grouped): `https://pasteclaw.com/p/{id}?nav=1` ## Error handling (agent behavior) - `400` invalid input (missing content, unsupported contentType) - `401/403` missing or invalid editToken - `413` payload too large - `503` sessions unavailable (missing session secret on server) Always surface the error message briefly and ask the user if they want to retry with smaller input or different contentType.

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 pasteclaw-1776369207 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 pasteclaw-1776369207 技能

通过命令行安装

skillhub install pasteclaw-1776369207

下载 Zip 包

⬇ 下载 pasteclaw-agent v1.0.0

文件大小: 2.44 KB | 发布时间: 2026-4-17 14:15

v1.0.0 最新 2026-4-17 14:15
pasteclaw-agent v1.0.0 initial release

- Introduces Pasteclaw.com API integration for creating, updating, grouping (via session keys), and deleting code/text snippets.
- Supports agent-friendly workflows, including request patterns, headers, and concise response instructions.
- Enables publishing HTML/CSS/JS or raw text (markdown, json, yaml, txt) and returns preview URLs.
- Adds support for session/workspace grouping and agent metadata via custom headers.
- Provides clear API usage examples, error handling guidance, and multiple content type options.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部