Skip to content

fix: add config-only credential setup#116

Closed
Terminal Chai (terminalchai) wants to merge 1 commit into
langchain-ai:mainfrom
terminalchai:fix-config-reconfigure
Closed

fix: add config-only credential setup#116
Terminal Chai (terminalchai) wants to merge 1 commit into
langchain-ai:mainfrom
terminalchai:fix-config-reconfigure

Conversation

@terminalchai

Copy link
Copy Markdown

Adds a config-only CLI entry point for re-running provider, API key, model, and optional LangSmith setup without starting an agent run. This gives users a recovery path when saved credentials are expired, exhausted, or otherwise need to be replaced.\n\nFixes #23.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a focused, user-facing improvement that introduces a proper --config mode instead of overloading the initial setup flow. The behavior is consistent, the CLI UX is clearer, and the documentation is updated alongside the implementation.

What's good
✅ Introduces a dedicated --config command instead of piggybacking on normal startup.
✅ Prevents accidental agent execution after configuration.
✅ Rejects invalid usage like combining --config with other arguments.
✅ Handles non-interactive terminals with a clear error.
✅ Updates README and CLI usage documentation.
✅ forceReconfigure cleanly reuses the existing setup UI rather than duplicating logic.
Minor suggestion

The implementation now has several branches like:

if (forceReconfigure) {
return "provider";
}

inside helper functions (getInitialStep, getNextStepAfterProvider, getNextStepAfterApiKey). Since the reconfigure flow is becoming a distinct mode, you could consider centralizing this behavior in a small state machine or a dedicated flow function. It would reduce repeated forceReconfigure checks and make future setup changes easier to maintain.

@colifran

Copy link
Copy Markdown
Contributor

This is going to be superseded by #374 which makes init idempotent so you can re-run to reconfigure things.

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.

3 participants