Token导航 LogoToken导航TokenDH.com
开发敏感数据clawhub未标认证来源可访问clear审计通过

headless-oauthheadless OAuth 命令行

Agent Skill

用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查。它适合让 Agent 梳理敏感配置、检查依赖风险、分析鉴权逻辑或生成安全复核清单。使用时不能把工具输出直接当最终结论,涉及密钥、令牌、用户数据或生产系统时,应先确认最小权限、脱敏方式和操作边界。

总安装

3,678

周安装

158

GitHub Stars

1

下载量

1,289
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:headless-oauth(headless OAuth 命令行)
来源仓库:https://github.com/igorivanter/headless-oauth
安装命令:
openclaw skills install headless-oauth
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install headless-oauth

简介

在无头服务器上为 CLI 工具完成 OAuth 授权流程。

  • 解决远程环境与本地浏览器分离时的身份验证难题。适用宿主包括 OpenClaw,接入前应确认版本、权限和运行环境要求。
  • 适用于 VPS 或 CI/CD 环境中需要登录第三方服务的场景。
  • 需妥善保管客户端 ID 与密钥,避免泄露敏感凭证。
  • headless-oauth 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

name
headless-oauth
description
>
version
1.3.0
metadata
openclaw
emoji
🔐
homepage
https://github.com/IgorIvanter/headless-oauth
requires
bins
[]
env
[]

Headless OAuth

Authorize CLI tools that require OAuth on a headless server — no browser needed on the server side.

⚠️ Agent Context: You Are on a Remote Server

You (the agent) are running on a remote VPS. The user is on a separate local machine with a browser.

This means:

  • You cannot open a browser yourself
  • The server's localhost is NOT accessible from the user's browser
  • The user must open all auth URLs on their own machine
  • When a redirect goes to a local address like http://127.0.0.1:PORT/callback?code=..., it will fail to load in the user's browser — that is expected and normal
  • The user should copy the full URL from the address bar (even if the page shows an error) and send it to you
  • You then forward that URL to the waiting server process via curl

Always make this explicit when asking the user to authorize. Example:

"Open this URL in your browser, log in, and approve. The page will likely fail to load — that's fine. Copy the full URL from the address bar and send it to me."

The Pattern

Split the browser flow across two machines:

SERVER                          LOCAL MACHINE
------                          -------------
1. Generate auth URL    →       2. Open URL in browser
                                3. Log in + grant permissions
                                4. Copy redirect URL or code
5. Exchange for token   ←
6. Store token locally

Most OAuth CLIs support this via flags like:

  • --no-launch-browser — gh (GitHub CLI), gcloud
  • --remote --step 1/2 — gog (Google Workspace CLI)
  • --manual — some generic CLIs
  • Device flow (code + URL, no redirect) — gh, some others

Keyring on Headless Servers

Many CLIs store tokens in a system keyring that requires an interactive terminal session to unlock. Check the CLI's documentation for a flag or environment variable that sets the keyring password non-interactively. Set it only for the duration of the auth step — do not persist it in shell configs or agent-global environment. Prefer injecting it from a secrets manager or an ephemeral shell session.


Google Workspace — gog CLI

gog supports headless auth via --remote --step 1/2. See the official gog docs for setup details.

Important: Use Desktop app OAuth client type in Google Cloud Console — not Web application. gog uses a random port for the callback, which Web clients reject with redirect_uri_mismatch.

GitHub CLI — gh

gh auth login --hostname github.com --git-protocol https --no-launch-browser
# → prints a one-time code and a URL
# Open https://github.com/login/device locally, enter the code
# gh polls and completes automatically once you approve

gcloud (Google Cloud CLI)

gcloud auth login --no-launch-browser
# → prints a URL
# Open in local browser, log in, copy the verification code shown, paste back

Generic Device Flow

If a CLI supports device flow (prints a short code + URL):

  1. Note the code and URL printed by the CLI
  2. Open the URL on any device
  3. Enter the code
  4. CLI polls and completes automatically — no redirect URL to copy

Manual Callback Relay (mcporter, custom OAuth servers)

Some tools (e.g. mcporter) start a local HTTP server on the server to catch the OAuth callback, but the user's browser can't reach that address on the remote server.

How to handle it:

  1. Start the auth command with a longer timeout so it doesn't expire while waiting for the user.

Check the tool's docs for a timeout flag or environment variable.

  1. The tool usually prints a message like:
   If the browser did not open, visit https://... manually.

Send that URL to the user.

  1. Tell the user:

> "Open this URL, log in and approve. The page will fail to load — that's normal. Copy the full URL from the address bar and send it to me."

  1. The user sends back something like:

http://127.0.0.1:PORT/callback?code=...&state=...

  1. Forward it to the waiting server with curl:
   curl -s "http://127.0.0.1:PORT/callback?code=...&state=..."
  1. The tool receives the code, exchanges it for a token, and completes authorization.

Troubleshooting

ErrorFix
redirect_uri_mismatchUse Desktop app OAuth client, not Web application
No TTY / keyring unlock failsCheck the CLI's docs for a non-interactive keyring option
Access blocked (testing mode)Add your email as test user in Google consent screen settings
Commands fail silentlyCheck if the CLI requires an account env var to be set
Token expiredRe-run auth steps; most CLIs handle refresh automatically

Applying This Pattern to Any CLI

  1. Check --help for flags like --no-launch-browser, --remote, --manual, or --headless
  2. Check docs for "device flow" or "offline access"
  3. If the tool starts a local callback server but has no headless flag — use the Manual Callback Relay pattern above
  4. If none of the above work: use ssh -L port forwarding to tunnel the callback to your local machine

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

82.76%
按下载量换算1,067

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills