Latchkey
Instructions
Latchkey is a CLI tool that automatically injects credentials into curl commands. Credentials (mostly API tokens) need to be manually managed by the user.
Use this skill when the user asks you to work with services that have HTTP APIs, like AWS, Coolify, GitLab, Google Drive, Discord or others.
Usage:
- 1. Use
latchkey curl instead of regular curl for supported services. - Pass through all regular curl arguments - latchkey is a transparent wrapper.
- Check for
latchkey services list to get a list of supported services. Use --viable to only show the currently configured ones. - Use
latchkey services info <service_name> to get information about a specific service (auth options, credentials status, API docs links, special requirements, etc.). - If necessary, ask the user to configure credentials first. Tell the user to run
latchkey auth set on the machine where latchkey is installed (using the setCredentialsExample from the services info command). - Look for the newest documentation of the desired public API online.
- Do not initiate a new login if the credentials status is
valid or unknown - the user might just not have the necessary permissions for the action you're trying to do.
Examples
Make an authenticated curl request
CODEBLOCK0
Creating a Slack channel
CODEBLOCK1
(Notice that -H 'Authorization: Bearer is not present in the invocation.)
Getting Discord user info
CODEBLOCK2
Detect expired credentials
CODEBLOCK3
List usable services
CODEBLOCK4
Lists services that have stored credentials.
Get service-specific info
CODEBLOCK5
Returns auth options, credentials status, and developer notes
about the service.
Storing credentials
It is the user's responsibility to supply credentials. The user would typically do something like this:
CODEBLOCK6
When credentials cannot be expressed as static curl arguments, the user would use the set-nocurl subcommand. For example:
CODEBLOCK7
If a service doesn't appear with the --viable flag, it may
still be supported; the user just hasn't provided the
credentials yet. latchkey service info <service_name> can be
used to see how to provide credentials for a specific service.
Notes
- - All curl arguments are passed through unchanged
- Return code, stdout and stderr are passed back from curl
- Credentials are always stored encrypted and are never transmitted anywhere beyond the endpoints specified by the actual curl calls.
Currently supported services
Latchkey currently offers varying levels of support for the
following services: AWS, Calendly, Coolify, Discord, Dropbox, Figma, GitHub, GitLab,
Gmail, Google Analytics, Google Calendar, Google Docs, Google Drive, Google Sheets,
Linear, Mailchimp, Notion, Sentry, Slack, Stripe, Telegram, Umami, Yelp, Zoom, and more.
User-registered services
Note for humans: users can also add limited support for new services
at runtime using the latchkey services register command.
Latchkey
使用说明
Latchkey 是一款 CLI 工具,可自动向 curl 命令注入凭据。凭据(主要是 API 令牌)需要由用户手动管理。
当用户要求你使用具有 HTTP API 的服务(如 AWS、Coolify、GitLab、Google Drive、Discord 等)时,请使用此技能。
使用方法:
- 1. 使用 latchkey curl 替代常规 curl 来访问支持的服务。
- 传递所有常规 curl 参数——latchkey 是一个透明包装器。
- 使用 latchkey services list 查看支持的服务列表。使用 --viable 参数仅显示当前已配置的服务。
- 使用 latchkey services info 获取特定服务的信息(认证选项、凭据状态、API 文档链接、特殊要求等)。
- 如有必要,请先要求用户配置凭据。 告知用户在安装 latchkey 的机器上运行 latchkey auth set(使用 services info 命令中的 setCredentialsExample 示例)。
- 在线查找所需公共 API 的最新文档。
- 如果凭据状态为 valid 或 unknown,请勿发起新的登录——用户可能只是没有执行你尝试的操作所需的权限。
示例
发起带认证的 curl 请求
bash
latchkey curl [curl 参数]
创建 Slack 频道
bash
latchkey curl -X POST https://slack.com/api/conversations.create \
-H Content-Type: application/json \
-d {name:my-channel}
(注意:调用中未出现 -H Authorization: Bearer。)
获取 Discord 用户信息
bash
latchkey curl https://discord.com/api/v10/users/@me
检测过期凭据
bash
latchkey services info discord # 查看 credentialStatus 字段——显示 invalid
列出可用服务
bash
latchkey services list --viable
列出已存储凭据的服务。
获取服务特定信息
bash
latchkey services info slack
返回该服务的认证选项、凭据状态和开发者说明。
存储凭据
用户负责提供凭据。用户通常需要执行如下操作:
bash
latchkey auth set my-gitlab-instance -H PRIVATE-TOKEN:
当凭据无法表示为静态 curl 参数时,用户应使用 set-nocurl 子命令。例如:
bash
latchkey auth set-nocurl aws
如果某个服务未出现在 --viable 标志的结果中,该服务可能仍受支持;只是用户尚未提供凭据。可使用 latchkey service info 查看如何为特定服务提供凭据。
注意事项
- - 所有 curl 参数将原样传递
- 返回码、标准输出和标准错误均来自 curl
- 凭据始终以加密方式存储,绝不会传输到实际 curl 调用指定的端点之外
当前支持的服务
Latchkey 目前对以下服务提供不同程度的支持:AWS、Calendly、Coolify、Discord、Dropbox、Figma、GitHub、GitLab、Gmail、Google Analytics、Google Calendar、Google Docs、Google Drive、Google Sheets、Linear、Mailchimp、Notion、Sentry、Slack、Stripe、Telegram、Umami、Yelp、Zoom 等。
用户注册的服务
人工提示:用户还可以在运行时使用 latchkey services register 命令为新服务添加有限支持。