Skip to content

feat(yida-login): add --check-only and auto-select org#3

Merged
nicky1108 merged 1 commit intomainfrom
feature/check-only-login
Mar 15, 2026
Merged

feat(yida-login): add --check-only and auto-select org#3
nicky1108 merged 1 commit intomainfrom
feature/check-only-login

Conversation

@yize
Copy link
Copy Markdown
Contributor

@yize yize commented Mar 14, 2026

Summary

  • Add --check-only parameter to check login status without triggering login flow
  • Add auto-select org logic: if only 1 organization detected, automatically select and complete login
  • Add can_auto_use field for AI Agent to determine if login is available
  • Add human-readable message output

Changes

  • Modified skills/yida-login/scripts/login-interactive.py:
    • Added check_login_only() function
    • Added --check-only CLI argument support
    • Modified stage2_get_org_list() to auto-select when only 1 org

Usage

Check login status

python3 login-interactive.py --check-only

Returns:

{
  "status": "ok",
  "can_auto_use": true,
  "csrf_token": "xxx",
  "corp_id": "dingxxx",
  "user_id": "195xxx",
  "base_url": "https://ding.aliwork.com",
  "message": "✅ 已有有效登录态,可直接使用"
}

Auto-select org

When user scans QR code and only 1 organization is detected, the login flow automatically completes without requiring user to reply with org number.

User Experience Improvement

Scenario Before After
Already logged in AI asks to continue Use directly (no interaction)
1 org detected User replies with number Auto-select
Multiple orgs User replies with number Still requires selection

Related Issue

Closes #2

- Add --check-only parameter to check login status without triggering login
- Add auto-select org logic: if only 1 org, auto-select and complete login
- Add can_auto_use field for AI Agent
- Add human-readable message output

Closes #2
@nicky1108 nicky1108 merged commit 68def55 into main Mar 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

优化登录体验:添加 --check-only 参数 + 自动选择组织

2 participants