Skip to content

feat: claudely setup — interactive configuration wizard #14

Description

@mforce

Summary

Add a claudely setup subcommand that walks the user through configuring their provider, base URL, auth token, and default model via an interactive wizard. Values persist to a platform-native config file and load on every subsequent claudely invocation.

Design spec

See docs/superpowers/specs/2026-05-03-setup-wizard-design.md for the full design.

Key decisions

  • Config location: XDG on Linux (~/.config/claudely/config.json), ~/Library/Application Support/ on macOS, %APPDATA% on Windows
  • Precedence: CLI flag > env var > config file > provider default
  • loadSettings decoupling: moves from compat.ts to new config.ts — all config I/O in one module, compat.ts keeps only business logic
  • Re-run behavior: shows current saved values as editable defaults (no "overwrite?" prompt)

New files

  • src/config.ts — configDir(), configPath(), loadConfig(), saveConfig(), loadSettings() (moved from compat.ts)
  • src/setup.ts — runSetup() (interactive wizard flow)
  • src/config.test.ts — unit tests for config persistence

Changes to existing files

  • src/compat.ts — remove loadSettings() and fs import (pure business logic only)
  • src/cli.ts — subcommand dispatch for setup, import loadSettings from config.ts, thread config into resolution chain

Wizard flow

  1. Pick provider (select from registry)
  2. Base URL (pre-filled with provider default or saved value)
  3. Auth token (pre-filled)
  4. Test connection (/v1/models with 5s timeout, non-blocking)
  5. Pick default model (from discovered models, or manual entry)
  6. Confirm & save

Acceptance

  • claudely setup walks through all 6 wizard steps
  • Config persists to platform-native path
  • Saved config loads on subsequent claudely runs
  • Precedence: CLI flag > env var > config > provider default
  • Re-running setup pre-fills with saved values
  • loadSettings moved from compat.ts to config.ts
  • src/config.test.ts covers round-trip, missing file, corrupt JSON, directory creation
  • Existing tests still pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions