Chuyển đến nội dung
Skillpedia
Triển khai và đám mây (DevOps)16k · #10896

interactive-login

Skill này làm gì

Cho phép trợ lý bắt đầu đăng nhập cho các công cụ dòng lệnh của lập trình viên và lưu kết quả vào keychain. Dành cho lập trình viên cần công cụ của họ đã đăng nhập.

Khi nào nên dùng

  • ✓Khi một công cụ dòng lệnh như AWS hoặc GitHub yêu cầu bạn đăng nhập trước.
  • ✓Khi bạn muốn lưu một đăng nhập để các lệnh sau dùng an toàn.
  • ✓Khi cần đăng nhập bằng device code hoặc trình duyệt để hoàn tất thiết lập.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/yc-software/qm/blob/main/skills-seed/interactive-login/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Đăng nhập tôi vào công cụ dòng lệnh AWS để bạn kiểm tra các lần triển khai của tôi.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Trợ lý khởi động đăng nhập của công cụ trong một thư mục tạm mới, hiển thị địa chỉ web và mã để bạn nhập, rồi lưu kết quả vào keychain. Thư mục nhà thông thường của bạn không bao giờ được dùng.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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.

Câu hỏi thường gặp

Trợ lý có thấy mật khẩu của tôi không?

Bạn tự hoàn tất đăng nhập trong trình duyệt bằng mã công cụ hiển thị. Trợ lý chỉ chuyển tiếp liên kết và mã.

Vì sao dùng thư mục tạm?

Điều này giữ đăng nhập mới tách biệt với cài đặt máy tính thông thường của bạn, nên các token hiện có không bị dùng lại nhầm.

Nếu đăng nhập chưa hoàn tất thì sao?

Đăng nhập chỉ được lưu sau khi quá trình đăng nhập hoàn tất, nên bạn có thể thử lại nếu nó bị dừng.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
16k
Vị trí xếp hạng
#10896
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự