feat(auth): default :AILogin to Hanzo ID; menu order Hanzo/ChatGPT/Claude/API-key

Enter (no selection) defaults to Hanzo ID (hanzo.id device-code). Reordered the
:AILogin menu so Hanzo ID is first/default, then ChatGPT, Claude, API key, Cancel.
This commit is contained in:
hanzo-dev
2026-06-27 21:44:07 +00:00
parent 334a0941ce
commit 6454595b0c
2 changed files with 11 additions and 9 deletions
+8 -6
View File
@@ -727,20 +727,22 @@ function! hanzo#Login(...) abort
if empty(l:vendor)
let l:choice = inputlist([
\ 'Select AI login:',
\ '1) Claude (Anthropic API key)',
\ 'Select AI login (Enter = Hanzo ID):',
\ '1) Hanzo ID (hanzo.id OAuth, device-code) [default]',
\ '2) ChatGPT (OpenAI OAuth, device-code)',
\ '3) Hanzo (hanzo.id OAuth, device-code)',
\ '3) Claude (Anthropic API key)',
\ '4) API key (active provider)',
\ '5) Cancel',
\])
echo "\n"
if l:choice == 1
let l:vendor = 'claude'
if l:choice == 0 || l:choice == 1
" Enter / no selection defaults to Hanzo ID.
let l:vendor = 'hanzo'
elseif l:choice == 2
let l:vendor = 'chatgpt'
elseif l:choice == 3
let l:vendor = 'hanzo'
let l:vendor = 'claude'
elseif l:choice == 4
let l:vendor = 'apikey'
else
+3 -3
View File
@@ -17,7 +17,7 @@ CONTENTS *hanzo-contents*
1. AI Login *hanzo-ailogin*
`:AILogin` is a unified, multi-vendor login. It is NOT vendor-locked: you can
log in with Claude, ChatGPT, or Hanzo, or just paste an API key.
log in with Hanzo ID, ChatGPT, or Claude, or just paste an API key.
It does NOT reimplement OAuth. The OAuth/device-code flows are delegated to the
already-installed `dev` CLI (Hanzo Dev), and the AI provider reads the SAME
@@ -29,8 +29,8 @@ authenticated.
`:AILogin` [{vendor}] *:AILogin*
With no argument, shows a menu:
1) Claude 2) ChatGPT 3) Hanzo 4) API key
With no argument, shows a menu (Enter defaults to Hanzo ID):
1) Hanzo ID 2) ChatGPT 3) Claude 4) API key 5) Cancel
With an argument, logs in directly. {vendor} is one of:
claude | chatgpt | hanzo | apikey