What
When a user runs kbot for the first time without any API key configured, show a friendly, actionable setup guide instead of a raw error or stack trace.
Why
New users who install kbot via npm i -g @kernel.chat/kbot and immediately run kbot "hello" hit an authentication error. The current message points them to kbot auth but does not explain what they need (an API key from a provider) or give them options (free local models vs. cloud providers). A better first-run experience reduces friction and drop-off.
Suggested approach
- In the main chat entry point in
cli.ts (around line 3123 where the BYOK/auth check happens), detect when no provider is configured.
- Instead of a one-line error, print a multi-line guide:
No API key configured yet. Let's fix that!
Quick start (pick one):
Cloud (needs API key):
kbot auth Interactive setup — walks you through it
kbot byok Bring Your Own Key for 15+ providers
Local (free, no key needed):
kbot local Use Ollama, LM Studio, or Jan
kbot doctor Check what's already installed
Docs: https://github.com/isaacsight/kernel
- Use the existing
printInfo / printWarn helpers from ui.ts for consistent styling.
- Exit cleanly (no stack trace).
Files to look at
packages/kbot/src/cli.ts — Main entry point; the auth check before starting a chat session (~line 3123)
packages/kbot/src/auth.ts — loadConfig(), isByokEnabled(), provider detection logic
packages/kbot/src/ui.ts — printInfo, printWarn, printError helpers for styled output
What
When a user runs kbot for the first time without any API key configured, show a friendly, actionable setup guide instead of a raw error or stack trace.
Why
New users who install kbot via
npm i -g @kernel.chat/kbotand immediately runkbot "hello"hit an authentication error. The current message points them tokbot authbut does not explain what they need (an API key from a provider) or give them options (free local models vs. cloud providers). A better first-run experience reduces friction and drop-off.Suggested approach
cli.ts(around line 3123 where the BYOK/auth check happens), detect when no provider is configured.printInfo/printWarnhelpers fromui.tsfor consistent styling.Files to look at
packages/kbot/src/cli.ts— Main entry point; the auth check before starting a chat session (~line 3123)packages/kbot/src/auth.ts—loadConfig(),isByokEnabled(), provider detection logicpackages/kbot/src/ui.ts—printInfo,printWarn,printErrorhelpers for styled output