本文へスキップ
Skillpedia
デプロイとクラウド(DevOps)16k · #10896

interactive-login

できること

このスキルは、開発者向けコマンドラインツールのサインインを開始し、その結果をシステムのキーチェーンに保存します。ツールにログインしておく必要がある開発者向けです。

使う場面

  • ✓AWSやGitHubなどのコマンドラインツールが、まずあなたにサインインを求めているとき。
  • ✓後のコマンドで安全に使えるように、ログインを保存したいとき。
  • ✓セットアップを完了するために、デバイスコードやブラウザでのサインインが必要なとき。

スキルのリンク

https://github.com/yc-software/qm/blob/main/skills-seed/interactive-login/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/yc-software/qm/blob/main/skills-seed/interactive-login/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“AWSのコマンドラインツールにログインして、私のデプロイ状況を確認できるようにしてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

アシスタントは、新しい一時フォルダーでツールのログインを開始し、入力するためのWebアドレスとコードを表示します。結果はキーチェーンに保存されます。普段のホームフォルダーは使われません。

技術的な内容(元の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.

  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.

よくある質問

アシスタントはパスワードを見ますか?

サインインはあなたがブラウザで、ツールが表示したコードを使って完了します。アシスタントはリンクとコードを伝えるだけです。

一時フォルダーを使うのはなぜですか?

新しいログインを普段のコンピューターの設定から切り離すため、既存のトークンが誤って再利用されることを防ぐためです。

サインインが完了しなかったら?

ログインはサインインが完了した後にのみ保存されるため、途中で止まった場合はもう一度試せます。

詳細

作者による元の説明

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

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル