Agent Skills › yc-software/qm › interactive-login

interactive-login

GitHub

处理CLI交互式登录(如AWS SSO、GitHub),通过设备码流程完成认证,将凭据保存至密钥链并通过execute.credentials供后续命令使用,确保临时环境隔离。

skills-seed/interactive-login/SKILL.md yc-software/qm

Trigger Scenarios

需要执行需要浏览器验证的CLI认证操作 配置或刷新AWS SSO、GitHub CLI等工具的访问凭证

Install

npx skills add yc-software/qm --skill interactive-login -g -y
More Options

Non-standard path

npx skills add https://github.com/yc-software/qm/tree/main/skills-seed/interactive-login -g -y

Use without installing

npx skills use yc-software/qm@interactive-login

指定 Agent (Claude Code)

npx skills add yc-software/qm --skill interactive-login -a claude-code -g -y

安装 repo 全部 skill

npx skills add yc-software/qm --all -g -y

预览 repo 内 skill

npx skills add yc-software/qm --list

SKILL.md

Frontmatter
{
    "name": "interactive-login",
    "description": "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."
}

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.

  1. 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-browser
    

    Use the CLI's device-code mode (AWS needs --use-device-code); a browser flow only completes on the same machine.

  2. Relay the verification URL and code from the job output. Answer any prompt with background action send_input. Use its watch or poll action with the returned process_id; never stop the job while the person is approving.

  3. 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.

  4. Use the login only by naming the handle in credentials on execute (including background: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.

Version History

  • 6803edb Current 2026-10-18 18:21

    重构为基于sandbox的显式凭据管理,移除平台级捕获,统一通过execute.credentials传递和刷新凭据,支持后台作业。

  • 7f2c916 2026-08-02 21:46

Same Skill Collection

.claude/skills/dev-instance/SKILL.md
.claude/skills/update-qm/SKILL.md
.claude/skills/upstream-pr/SKILL.md
.codex/skills/deploy-qm/SKILL.md
.codex/skills/dev-instance/SKILL.md
.codex/skills/update-qm/SKILL.md
.codex/skills/upstream-pr/SKILL.md
cli/templates/deployment/SKILL.md
plugins/onboarding/skills/onboarding/SKILL.md
skills-seed/admin/SKILL.md
skills-seed/browse/SKILL.md
skills-seed/cloud-cli/SKILL.md
skills-seed/composio/SKILL.md
skills-seed/connect-apps/SKILL.md
skills-seed/define-loop/SKILL.md
skills-seed/dropbox/SKILL.md
skills-seed/email-draft-in-voice/SKILL.md
skills-seed/email-voice-profile/SKILL.md
skills-seed/github-gitlab/SKILL.md
skills-seed/google-drive-sheets/SKILL.md
skills-seed/google-workspace/SKILL.md
skills-seed/hand-off/SKILL.md
skills-seed/linear/SKILL.md
skills-seed/memory/SKILL.md
skills-seed/miniapp/SKILL.md
skills-seed/morning-digest/SKILL.md
skills-seed/popular-web-designs/SKILL.md
skills-seed/publish/SKILL.md
skills-seed/request-access/SKILL.md
skills-seed/send/SKILL.md
skills-seed/slack-drafts/SKILL.md
skills-seed/taste-skill/SKILL.md
skills-seed/ui-canvas/SKILL.md
skills-seed/ui-state/SKILL.md
skills-seed/use-shared-credential/SKILL.md

Metadata

Files
0
Version
6803edb
Hash
e0c3a4a0
Indexed
2026-08-02 21:46

홈 - 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-21 00:49
浙ICP备14020137号-1