feat: read MUX_BASE_URL from env-file and persist to config#66
Merged
feat: read MUX_BASE_URL from env-file and persist to config#66
Conversation
Contributor
Author
|
@cursor review if you would be so kind? |
When logging in with --env-file, MUX_BASE_URL is now parsed and, if nonstandard, saved to the environment's config.json. getMuxBaseUrl() checks env var > config > default, so subsequent commands automatically use the configured base URL without needing the env var set. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
createAuthenticatedMuxClient() was not forwarding the configured base URL to the SDK, so SDK-based commands always hit the default api.mux.com regardless of config. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Prevents stale config baseUrl from being used when logging in without MUX_BASE_URL set. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nfig read - Login now checks env-file > process.env.MUX_BASE_URL > default, so interactive login with MUX_BASE_URL set works correctly. - createAuthenticatedMuxClient reads baseUrl from the already-fetched environment instead of calling getMuxBaseUrl() (which would re-read config from disk). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
d928d0d to
404770f
Compare
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nfig read Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e635ada. Configure here.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… wrapper Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Note
This was authored by @claude, not @jrmann100.
Summary
MUX_BASE_URLfrom--env-fileduringmux loginhttps://api.mux.com), saves it asbaseUrlin the environment's config.jsongetMuxBaseUrl()now checks: env var > config > default, so subsequent commands use the configured base URL without needing the env var setwhoamidisplaysAPI endpointwhen using a nonstandard base URLTest plan
mux login --env-filewith a.envcontainingMUX_BASE_URL=https://api.staging.mux.comsavesbaseUrlto configmux login --env-filewithoutMUX_BASE_URLdoes not addbaseUrlto configmux whoamiuses the storedbaseUrlwithoutMUX_BASE_URLenv var setmux whoamishowsAPI endpointonly when nonstandard🤖 Generated with Claude Code
Note
Medium Risk
Changes how the CLI chooses the API endpoint and persists it to config, which can redirect all subsequent API calls for an environment if misconfigured; scope is contained and covered by new tests.
Overview
Adds support for a configurable Mux API endpoint:
mux login --env-filenow parsesMUX_BASE_URL, validates credentials against that URL, and persists a non-defaultbaseUrlinto the saved environment config.Updates base-URL resolution to prefer
MUX_BASE_URLenv var, then per-environment config, then the default; commands that fetch from the API (whoami, webhooklisten, error permission probing) now use the resolved base URL, andwhoamiprints the active endpoint when non-default. Includes new/updated tests for.envparsing andgetMuxBaseUrlprecedence.Reviewed by Cursor Bugbot for commit 0017213. Bugbot is set up for automated code reviews on this repo. Configure here.