返回命令列表
配置管理hermes auth

hermes auth 命令 — 完整参考与示例

hermes auth 完整参考:add、list、remove、reset、status、logout 与 spotify。使用真实 CLI 标志管理提供商凭据池与示例。

2026年7月27日

概述

hermes auth 管理 LLM 与服务提供商的凭据池。每个提供商可保存多个凭据,以便在某个凭据达到速率限制或耗尽时自动轮换。

hermes auth <子命>

子命令

add <provider>

添加一个凭据到池中。

hermes auth add openrouter
hermes auth add openrouter --api-key $OPENROUTER_API_KEY
hermes auth add anthropic --type oauth
hermes auth add nous --type oauth --label team-key

标志:

  • --type {oauth,api-key} — 凭据类型。
  • --label LABEL — 可选显示标签。
  • --api-key API_KEY — API 密钥值(否则安全提示输入)。
  • --portal-url--inference-url — Nous portal/推理基础 URL。
  • --client-id CLIENT_ID — OAuth 客户端 ID。
  • --scope SCOPE — OAuth 作用域覆盖。
  • --no-browser — OAuth 登录时不自动打开浏览器。
  • --timeout TIMEOUT — OAuth/网络超时秒数。
  • --insecure — OAuth 登录时禁用 TLS 验证。
  • --ca-bundle CA_BUNDLE — OAuth 登录自定义 CA 包。

list [provider]

列出凭据池。

hermes auth list
hermes auth list openrouter

remove <provider> <target>

按索引、条目 ID 或精确标签移除凭据。

hermes auth remove openrouter 1

reset <provider>

清除某提供商所有凭据的耗尽状态。

hermes auth reset openrouter

status <provider>

显示某提供商的认证状态。

hermes auth status anthropic

logout <provider>

登出提供商并清除已存储的认证状态。

hermes auth logout anthropic

spotify [login|status|logout]

通过 PKCE 认证 Spotify。

hermes auth spotify login
hermes auth spotify status
hermes auth spotify logout

标志:

  • --client-id CLIENT_ID — Spotify 应用客户端 ID(或设置 HERMES_SPOTIFY_CLIENT_ID)。
  • --redirect-uri REDIRECT_URI — 已加入白名单的本地回调 URI。
  • --scope SCOPE — 覆盖请求的 Spotify 作用域。
  • --no-browser — 不自动打开浏览器。
  • --timeout TIMEOUT — 回调/令牌交换超时秒数。

示例

# 从环境变量添加 API key
hermes auth add openrouter --api-key $OPENROUTER_API_KEY

# 添加多个 key 用于轮换
hermes auth add openrouter --api-key $KEY1 --label key-1
hermes auth add openrouter --api-key $KEY2 --label key-2
hermes auth add openrouter --api-key $KEY3 --label key-3

# 添加 OAuth 提供商
hermes auth add anthropic --type oauth

# 达到速率限制后检查并重置
hermes auth status openrouter
hermes auth reset openrouter

# 列出并移除凭据
hermes auth list openrouter
hermes auth remove openrouter 1

技巧

  • 对高吞吐量提供商添加 3–5 个 key,让 Hermes 在命中限流时自动轮换。
  • --api-key 可安全地从环境变量读取;省略时会安全提示输入。
  • hermes auth reset 只清除耗尽/冷却状态,不会删除凭据。
  • Spotify 使用 PKCE;设置 HERMES_SPOTIFY_CLIENT_ID 可免去每次传递 --client-id

Explore All Commands

Browse the full command reference with search and category filters.

返回命令列表