interactive-login
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.
- License 许可
- MIT
- 所属仓库
- yc-software/qm
- 最近更新
- 2026-11-15
- Stars
- ★ 1.6w
- Forks
- 2.0k
01 前言 Front Matter
- 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.
02 资源文件 1
- 脚本scripts/save-login.mjs2.1 KB
03 SKILL.md 正文
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.
04 同仓库更多 Skills
zoom
Find, create, reschedule, and cancel the user's Zoom meetings through their own Zoom connection.
use-shared-credential
When you need to call a service the org has a SHARED credential for (a SERP/search key, a paid-API key, a data-vendor feed, a Git remote) — and the platform has told you that credential is available to this conversation — make the call BY PROXY through the credential broker. You never see the secret; the core stamps it onto the outbound request for you.
ui-state
See what the person is looking at in the QM web UI right now — the whole page (sidebar, every multiview pane, open dialogs) as raw HTML, the app's state as JSON, optionally the CSS and a screenshot. Use when they ask about something on their screen, want help with the UI, or you need to check what a canvas you wrote actually rendered.
ui-canvas
Draw your own HTML/CSS/JS as a full-window overlay on top of the QM web UI — a dashboard, a form, a visualization, controls that message you back. Write, update, replace, pin or dismiss it. Use when an interactive or visual result beats a chat reply.
taste-skill
Design taste and process for anything a person will look at in a browser — landing page, dashboard, prototype, deck. The default design driver for a browsable artifact, with an anti-slop playbook for the visual language.
slack-drafts
Create Slack message drafts in the user's own composer, as the user, through their per-user Slack OAuth. Drafting only — the user reviews and sends from Slack.