feat: add --config CLI flag for interactive provider/model setup#97
feat: add --config CLI flag for interactive provider/model setup#97Hridoy Ahmed (hrid0yyy) wants to merge 2 commits into
Conversation
PRATHAM KUMAR (rajpratham1)
left a comment
There was a problem hiding this comment.
This is a useful UX improvement with a relatively small, well-contained implementation.
Pros
✅ Adds a dedicated --config command for updating provider, model, and API keys without triggering a normal run.
✅ Reuses the existing InitSetup flow instead of duplicating logic.
✅ Keeps backward compatibility (--init, --update, normal runs unchanged).
✅ Updates CLI help and examples.
✅ forceConfig cleanly starts at the provider selection screen.
Things to verify before merge
Ensure --config cannot be combined with incompatible flags like --init, --update, or a prompt. If it can, the parser should reject conflicting combinations.
Confirm the new summary screen exits correctly on all terminals (auto-exit after 3s and key press both work).
Add CLI tests for:
openwiki --config
openwiki --config --modelId ...
invalid combinations (--config --update, --config "prompt" if unsupported).
|
I've addressed the review feedback and pushed the requested changes. I'd appreciate another review when you have time. Thank you! |
|
Thanks for the PR! This is going to be superseded by #374 which makes init idempotent so re-running it allows you to reconfigure things. |
Summary
Add
--configCLI flag that opens an interactive wizard to change provider, model, and API key settings without running the main wiki session.Changes
src/commands.ts— Addedconfigcommand kind; parses--configflag; updated help textsrc/credentials.tsx— AddedforceConfigprop toInitSetupso it always starts from provider selection stepsrc/cli.tsx— AddedConfigViewcomponent that runs the wizard withforceConfig, shows a summary on completion, then auto-exits; wired up entry point to load env for config runs; fixedcommand.dryRuntype guardWhat
--configdoesRunning
openwiki --configlaunches an interactive wizard that walks you through configuring OpenWiki:Each step is skipped if already configured. Changes are saved to
~/.openwiki/.envand persist across sessions.Usage