interactive-login
它能做什么
让助手为开发者命令行工具启动登录,并将结果保存到系统钥匙串中。适合需要为工具完成登录的开发者。
适用场景
- ✓当 AWS 或 GitHub 等命令行工具需要你先登录时。
- ✓当你希望保存登录信息,以便之后的命令可以安全地使用时。
- ✓当需要通过设备代码或浏览器登录来完成设置时。
技能链接
https://github.com/yc-software/qm/blob/main/skills-seed/interactive-login/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我登录 AWS 命令行工具,以便你检查我的部署情况。”
每周 5 个新技能,1 分钟读完。
工作原理
助手会在一个全新的临时文件夹中启动该工具的登录,向你显示网址和需要输入的代码,并将结果保存到钥匙串中。你平时的主文件夹永远不会被使用。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Interactive login
Nothing captures logins for you. Every login runs in a fresh temporary home and is saved
to the keychain with the script shipped with this skill. Never log in against the real
$HOME, and never treat a token or config already in $HOME as a usable login: only a
keychain handle is. Use the same explicit sandbox_id for the skill read, login,
and save-login commands so the temporary home and save script stay on one computer.
Make a fresh directory and start the login with
execute(background:true)with every config location pointed into it. Copy in any config the CLI needs first (for AWS, the[profile …]/[sso-session …]blocks in.aws/config); everything under that directory becomes the saved login.d=$(mktemp -d) && echo "$d" in_d() { env HOME="$d" XDG_CONFIG_HOME="$d/.config" XDG_DATA_HOME="$d/.local/share" XDG_STATE_HOME="$d/.local/state" XDG_CACHE_HOME="$d/.cache" "$@"; } in_d aws sso login --profile work --use-device-code --no-browser in_d gh auth login --hostname github.com --git-protocol https --web in_d glab auth login --hostname gitlab.com --web in_d gcloud auth login --no-launch-browserUse the CLI's device-code mode (AWS needs
--use-device-code); a browser flow only completes on the same machine.Relay the verification URL and code from the job output. Answer any prompt with
backgroundactionsend_input. Use itswatchorpollaction with the returnedprocess_id; never stop the job while the person is approving.When it exits successfully, save the directory with the script under the absolute directory the skill read reported:
node <skill dir>/scripts/save-login.mjs aws "$d" --label "work (123456789012)"The script uploads only the files under that directory, removes the directory, and prints the credential handle. It also removes a directory that holds no usable login. Never remove the directory yourself; if the save fails, run the script again. Saving the same service again replaces that entry in place: its id, handle, owner and grants stay the same.
Use the login only by naming the handle in
credentialsonexecute(includingbackground:true), including to check that it works. The files are staged in a private home for that command or job, and refreshes the CLI writes are saved back when it ends.
Never print token files or paste their contents into the conversation. If the login fails or expires, start again from step 1 with a new directory.
常见问题
助手会看到我的密码吗?
你在浏览器中使用工具显示的代码自行完成登录。助手只转达链接和代码。
为什么要使用临时文件夹?
这样新的登录与你平常的电脑设置分开,避免意外复用已有的令牌。
如果登录没有完成怎么办?
只有在登录完成后才会保存登录信息,因此如果中途停止,你可以重新尝试。
详情
作者的原始描述
Log a CLI in with a browser/device-code flow (aws sso, gh, glab, gcloud, …) and save the result to the keychain so later commands can request it through execute.credentials.
repo: yc-software/qm
热度
- GitHub 星标
- 16k
- 排名
- #10896
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
deploy-qm
16k按照完整的部署清单,将 QM 软件包部署到 Fly.io、AWS 或 Render,然后设置管理员、连接器,并可选择连接 Slack。
onboarding
16k在一段简短的对话中,引导新用户连接账户、说明自己的工作方式、选择语音,并设置最初的帮助内容。
admin
16k让经过验证的组织管理员在聊天中查看或更改全组织范围的设置及其他范围,并在每项更改前进行确认。
browse
16k从你的 shell 驱动真实的隐身浏览器,在网站上执行操作,例如登录或填写表单,并按人保存登录状态。仅用于操作,不用于阅读。