larksuite/cli · warning
please select at least one domain
Error message
please select at least one domain
What it means
During interactive `lark-cli auth login`, the domain-selection multi-select (huh form) validates with a callback that rejects an empty selection with msg.ErrNoDomain ("please select at least one domain"). The form cannot advance to the permission-level step until at least one API domain is chosen.
Source
Thrown at cmd/auth/login_interactive.go:105
}
options[i] = huh.NewOption(label, dm.Name)
}
var selectedDomains []string
var permLevel string
// Phase 1a: domain selection
// Phase 1b: permission level (shown after domain selection completes)
form1 := huh.NewForm(
huh.NewGroup(
huh.NewMultiSelect[string]().
Title(msg.SelectDomains).
Description(msg.DomainHint).
Options(options...).
Value(&selectedDomains).
Validate(func(s []string) error {
if len(s) == 0 {
return fmt.Errorf(msg.ErrNoDomain)
}
return nil
}),
),
huh.NewGroup(
huh.NewSelect[string]().
Title(msg.PermLevel).
Options(
huh.NewOption(msg.PermCommon, "common"),
huh.NewOption(msg.PermAll, "all"),
).
Value(&permLevel),
),
).WithTheme(cmdutil.ThemeFeishu())
if err := form1.Run(); err != nil {
if err == huh.ErrUserAborted {
return nil, output.ErrBare(1)View on GitHub (pinned to 7fd6ef3c07)
Solutions
- In the form, move with arrow keys and press space to select at least one domain option before pressing enter.
- Select all domains if unsure which are needed; scopes can be tightened later via the Lark developer console.
- Use the non-interactive path (flags or `config init --new` guidance) if TTY interaction is not possible.
Example fix
// before (empty selection confirmed) Domains: (enter) -> error: please select at least one domain // after Domains: (arrow to domain, SPACE to mark, then enter) -> proceeds to permission level prompt
Defensive patterns
Strategy: validation
Validate before calling
// Scripted pre-check: ensure the selection payload has at least one domain
func validateDomainSelection(sel []string) error {
if len(sel) == 0 {
return errors.New("please select at least one domain")
}
return nil
} Type guard
func hasSelection(s []string) bool { return len(s) > 0 } Prevention
- Press space (not just enter) to mark options in huh multi-selects.
- Select all domains when unsure; scopes can be tightened later.
- Prefer non-interactive flags when automating login.
- Read the form hint text (DomainHint) before confirming.
When it happens
Trigger: Running the interactive login flow (requires a TTY) and confirming the domain multi-select without marking any option with space, then pressing enter.
Common situations: New users pressing enter immediately on the form; terminals where huh keybindings are unclear; scripted input that skips selection.
Related errors
- failed to read input: %w
- input terminated unexpectedly (EOF)
- %s must contain at most %d characters
- %s must be one of: %s
- %s must be a boolean
AI-assisted analysis of larksuite/cli@7fd6ef3c07 (2026-09-04).
Data as JSON: /api/errors/e2b7cff8aba7d507.
Report an issue: GitHub.