Skip to content

feat: Interactive CLI Wizard for Zero-Config Onboarding#360

Open
mrbeandev wants to merge 1 commit intosipeed:mainfrom
mrbeandev:feat/zero-config-wizard
Open

feat: Interactive CLI Wizard for Zero-Config Onboarding#360
mrbeandev wants to merge 1 commit intosipeed:mainfrom
mrbeandev:feat/zero-config-wizard

Conversation

@mrbeandev
Copy link

Summary

Closes #350

I implemented an interactive TUI setup wizard that launches automatically when no configuration file is detected. Running ./picoclaw without a config now guides users through the entire setup in about a minute instead of erroring out.

What it does

Step 1: Environment Detection

  • Auto-detects Ollama, network connectivity, and NPU hardware (/dev/apex_0, /dev/npu, /dev/rknn)
  • Uses results to suggest smart defaults (e.g., defaults to OpenRouter if no Ollama but online)

Step 2: AI Provider Setup

  • Arrow-key selection menu for 7 providers: Ollama/vLLM, OpenRouter, OpenAI, Anthropic, Gemini, Zhipu, Groq
  • Masked API key input (characters shown as *)
  • Dynamic model list fetching from each provider's API with interactive selection
  • Searchable type-to-filter selector for large model lists (>20 items, e.g., OpenRouter has 340+)
  • Graceful fallback to manual text input if API fetch fails

Step 3: Channel Selection

  • Arrow-key selection: Terminal (CLI), Telegram, Discord, Slack
  • Prompts for required tokens per channel
  • Optional user allowlist configuration

Step 4: Review & Save

  • Summary screen showing all choices
  • Saves valid config.json to ~/.picoclaw/
  • Creates workspace template files
  • Option to immediately start the agent

Technical details

  • Raw terminal I/O via golang.org/x/sys/unix (TCGETS/TCSETS) for arrow-key menus
  • Vim keybindings (j/k) alongside arrow keys
  • Fallback mode: number-based selection when raw terminal mode isn't available
  • 10 unit tests covering config paths, CSV parsing, visible length calculation, environment detection, and all JSON model parsers
  • Provider API endpoints tested against live services before implementation

Files changed

  • cmd/picoclaw/main.go — 3-line trigger: if no args + no config → run wizard
  • cmd/picoclaw/wizard.go — Full wizard implementation (1271 lines)
  • cmd/picoclaw/wizard_test.go — 10 tests, all passing

Testing

go build -o build/picoclaw ./cmd/picoclaw/   # ✅ builds clean
go test ./cmd/picoclaw/ -v                     # ✅ 10/10 tests pass
mv ~/.picoclaw/config.json ~/.picoclaw/config.json.bak
./build/picoclaw                               # launches wizard

Implement an interactive TUI setup wizard that launches automatically when
no config file is found. Guides users through provider, model, and channel
setup in ~1 minute.

Features:
- Auto-detect environment (Ollama, network, NPU hardware)
- Arrow-key interactive menus with vim j/k support
- Masked API key input via readline
- Dynamic model list fetching from provider APIs:
  OpenRouter, OpenAI, Anthropic, Gemini, Groq, Zhipu, Ollama/vLLM
- Searchable model selector (type-to-filter) for large lists (>20 models)
- Smart defaults based on detected environment
- Progress bar and info boxes for guided experience
- Graceful fallback for non-interactive terminals
- Generates valid config.json and offers to auto-start the agent

Closes sipeed#350
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.

[Feature] Interactive CLI Wizard for Zero-Config Onboarding

1 participant