latchkey
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLatchkey
Latchkey
Instructions
使用说明
Latchkey is a CLI tool that automatically injects credentials into curl commands for supported public APIs. Credentials (mostly API tokens) can be either manually managed or, for some services, Latchkey can open a browser login pop-up window and extract API credentials from the session.
Use this skill when the user asks you to work with third-party services like Slack, Discord, Dropbox, GitHub, Linear and others on their behalf.
Usage:
- Use instead of regular
latchkey curlfor supported services.curl - Pass through all regular curl arguments - latchkey is a transparent wrapper.
- Use to get a list of supported services.
latchkey services list - Use to get information about a specific service (auth options, credentials status, API docs links, special requirements, etc.).
latchkey services info <service_name> - If necessary, get or renew credentials first. Run to open a browser login pop-up window if supported.
latchkey auth browser <service_name> - Look for the newest documentation of the desired public API online. If using the auth command, avoid bot-only endpoints.
browser - Do not initiate a new login if the credentials status is - the user might just not have the necessary permissions for the action you're trying to do.
valid
Latchkey是一款CLI工具,可自动将凭证注入到针对受支持公开API的curl命令中。凭证(主要是API令牌)既可以手动管理,对于部分服务,Latchkey还可以打开浏览器登录弹窗并从会话中提取API凭证。
当用户要求你代表他们处理Slack、Discord、Dropbox、GitHub、Linear等第三方服务时,请使用此技能。
使用方法:
- 使用替代常规的
latchkey curl来调用受支持的服务。curl - 传递所有常规curl参数 - Latchkey是一个透明的封装工具。
- 使用获取受支持服务的列表。
latchkey services list - 使用获取特定服务的相关信息(身份验证选项、凭证状态、API文档链接、特殊要求等)。
latchkey services info <service_name> - 如有必要,先获取或更新凭证。如果服务支持,运行打开浏览器登录弹窗。
latchkey auth browser <service_name> - 在线查找目标公开API的最新文档。如果使用身份验证命令,请避免使用仅机器人可访问的端点。
browser - 如果凭证状态为,请勿发起新的登录 - 用户可能只是没有执行你尝试操作的必要权限。
valid
Examples
示例
Make an authenticated curl request
发起经过身份验证的curl请求
bash
latchkey curl [curl arguments]bash
latchkey curl [curl arguments]Creating a Slack channel
创建Slack频道
bash
latchkey curl -X POST 'https://slack.com/api/conversations.create' \
-H 'Content-Type: application/json' \
-d '{"name":"my-channel"}'(Notice that is not present in the invocation.)
-H 'Authorization: Bearerbash
latchkey curl -X POST 'https://slack.com/api/conversations.create' \
-H 'Content-Type: application/json' \
-d '{"name":"my-channel"}'(注意调用命令中没有这一部分。)
-H 'Authorization: BearerGetting Discord user info
获取Discord用户信息
bash
latchkey curl 'https://discord.com/api/v10/users/@me'bash
latchkey curl 'https://discord.com/api/v10/users/@me'Detect expired credentials and force a new login to Discord
检测过期凭证并强制重新登录Discord
bash
latchkey services info discord # Check the "credentialStatus" field - shows "invalid"
latchkey auth browser discord
latchkey curl 'https://discord.com/api/v10/users/@me'Only do this when you notice that your previous call ended up not being authenticated (HTTP 401 or 403).
bash
latchkey services info discord # 查看"credentialStatus"字段 - 显示"invalid"
latchkey auth browser discord
latchkey curl 'https://discord.com/api/v10/users/@me'仅当你发现之前的调用未通过身份验证(HTTP 401或403错误)时,才执行此操作。
List available services
列出可用服务
bash
latchkey services listLists all services that latchkey knows about.
bash
latchkey services list列出Latchkey支持的所有服务。
Get service-specific info
获取特定服务信息
bash
latchkey services info slackReturns auth options, credentials status, and developer notes
about the service. If is not present in the
field, the service requires the user to directly
set API credentials via or before making requests.
browserauthOptionslatchkey auth setlatchkey auth set-nocurlbash
latchkey services info slack返回服务的身份验证选项、凭证状态和开发者说明。如果字段中没有,则该服务要求用户在发起请求前通过或直接设置API凭证。
authOptionsbrowserlatchkey auth setlatchkey auth set-nocurlNotes
注意事项
- All curl arguments are passed through unchanged
- Return code, stdout and stderr are passed back from curl
- 所有curl参数将原封不动地传递
- 返回码、标准输出和标准错误将从curl返回
Currently supported services
当前支持的服务
Latchkey currently offers varying levels of support for the
following services: AWS, Calendly, Discord, Dropbox, Figma, GitHub, GitLab,
Gmail, Google Analytics, Google Calendar, Google Docs, Google Drive, Google Sheets,
Linear, Mailchimp, Notion, Sentry, Slack, Stripe, Telegram, Yelp, Zoom, and more.
Latchkey目前对以下服务提供不同程度的支持:AWS、Calendly、Discord、Dropbox、Figma、GitHub、GitLab、Gmail、Google Analytics、Google Calendar、Google Docs、Google Drive、Google Sheets、Linear、Mailchimp、Notion、Sentry、Slack、Stripe、Telegram、Yelp、Zoom等。