名称: mastodon-scout
描述: 只读 Mastodon 命令行工具。输出人类可读的时间线摘要或原始 JSON 数据。
元数据:
{
"openclaw":
{
"emoji": "🦣",
"requires": { "anyBins": ["{baseDir}/bin/mastodon-scout", "mastodon-scout"] },
"envVars": [{ "name": "MASTODON_TOKEN", "required": true }],
"install":
[
{
"id": "download-darwin-arm64",
"kind": "download",
"os": ["darwin"],
"url": "https://github.com/patelhiren/mastodon-scout/releases/download/v1.0.4/mastodon-scout-darwin-arm64.zip",
"archive": "zip",
"bins": ["mastodon-scout"],
"targetDir": "{baseDir}/bin",
"label": "安装 Mastodon Scout (macOS Apple Silicon)",
},
{
"id": "download-darwin-amd64",
"kind": "download",
"os": ["darwin"],
"url": "https://github.com/patelhiren/mastodon-scout/releases/download/v1.0.4/mastodon-scout-darwin-amd64.zip",
"archive": "zip",
"bins": ["mastodon-scout"],
"targetDir": "{baseDir}/bin",
"label": "安装 Mastodon Scout (macOS Intel)",
},
{
"id": "download-linux-amd64",
"kind": "download",
"os": ["linux"],
"url": "https://github.com/patelhiren/mastodon-scout/releases/download/v1.0.4/mastodon-scout-linux-amd64.zip",
"archive": "zip",
"bins": ["mastodon-scout"],
"targetDir": "{baseDir}/bin",
"label": "安装 Mastodon Scout (Linux)",
},
{
"id": "download-windows-amd64",
"kind": "download",
"os": ["win32"],
"url": "https://github.com/patelhiren/mastodon-scout/releases/download/v1.0.4/mastodon-scout-windows-amd64.zip",
"archive": "zip",
"bins": ["mastodon-scout.exe"],
"targetDir": "{baseDir}/bin",
"label": "安装 Mastodon Scout (Windows)",
},
],
},
}
这是一个只读的 Mastodon 命令行工具,用于从 Mastodon API 获取数据。默认返回人类可读的摘要,或通过 --json 标志返回原始 JSON 数据。
{baseDir}/bin/mastodon-scout{baseDir}/bin/mastodon-scout{baseDir}/bin/mastodon-scout home
获取已认证用户的首页时间线。
{baseDir}/bin/mastodon-scout user-tweets
获取已认证用户自己发布的嘟文。
{baseDir}/bin/mastodon-scout mentions
获取提及已认证用户的嘟文。
{baseDir}/bin/mastodon-scout search <查询内容>
搜索匹配查询内容的嘟文。
--instance <url> # Mastodon 实例 URL (默认: https://mastodon.social)
--limit <int> # 返回的条目数量 (默认: 20)
--timeout <int> # 超时时间(秒)(默认: 30)
--json # 输出原始 JSON 而非人类可读文本
MASTODON_TOKEN # 用于身份验证的 OAuth Bearer Token
mastodon-scout home
返回时间线数据的人类可读摘要。
助手可以对时间线结果进行总结和解释,使其对用户更易理解。
mastodon-scout --json home
返回来自 Mastodon API 的原始 JSON 数据。
当使用 JSON 模式时,直接返回输出,无需解释。
不要重试
如果未设置 MASTODON_TOKEN:
mastodon-scout home显示我的 Mastodon 时间线检查 Mastodon 提及在 Mastodon 上搜索 "golang"获取我的 Mastodon 帖子严格模式例外:如果用户需要帮助获取令牌,助手可以在执行技能前提供指导。
该工具需要在 MASTODON_TOKEN 环境变量中设置一个 Mastodon OAuth Bearer Token。
步骤 1:访问开发设置
- 用户应登录其 Mastodon 实例(例如:mastodon.social, fosstodon.org)
- 导航至:设置 → 开发 (或 偏好设置 → 开发)
- 直接 URL 格式:https://[实例域名]/settings/applications
步骤 2:创建应用
- 点击“新建应用”
- 填写详细信息:
- 应用名称:mastodon-scout (或任意名称)
- 应用网站:可留空或使用任意 URL
- 重定向 URI:urn:ietf:wg:oauth:2.0:oob (适用于 CLI 应用)
- 权限范围:关键 - 仅选择 read (取消勾选 write, follow, push)
步骤 3:获取访问令牌
- 点击“提交”
- 点击已创建的应用以查看详情
- 复制 "Your access token" 字段的值
步骤 4:设置环境变量
export MASTODON_TOKEN="在此粘贴令牌"
步骤 5:验证令牌是否有效
{baseDir}/bin/mastodon-scout home
mastodon.social - 通用 (默认)fosstodon.org - FOSS/技术社区mas.to - 技术导向hachyderm.io - 技术/信息安全社区对于非默认实例,请使用 --instance https://你的实例.com 标志。
人类可读的帖子摘要,格式便于阅读。助手决定如何呈现信息。
--json 标志)所有命令返回以下格式的 JSON:
{
"success": true,
"data": [ /* Mastodon API 响应 */ ]
}
或出错时:
{
"success": false,
"error": "错误信息"
}
data 字段包含未经任何修改的原始 Mastodon API 响应。