Configure infisical API URL in .infisical.json#242
Open
gee-forr wants to merge 6 commits into
Open
Conversation
added 6 commits
May 21, 2026 11:41
…cal.json when needed
…al.json apiUr option
Author
|
@saifsmailbox98 - apologies on @'ing you out of the blue. Please could you request a review from the Claude Bot? I'd like to address any changes it might raise. |
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.
Description 📣
This PR resolves #206
I've always found it strange that I have to configure part of a project's infisical setup in
.infiscal.json, and then another part with the$INFISICAL_API_URLenvironment variable. It makes complete sense that this static piece of data could live in the.infisical.jsonfile and not feel out of place.I've updated the CLI so that if
apiUrlis defined in the.infiscal.jsonfile, it's used, like so:{ "workspaceId": "ea1b0a5f-xxxx-xxxx-xxxx-a1ef1c323cc1", "defaultEnvironment": "dev", "gitBranchToEnvironmentMapping": null, "apiUrl": "https://my.infisical.instance.com/api" }I've also ensured that precedence is preserved and makes sense. Precedence for specifying this value is as follows:
--domainflag →$INFISICAL_API_URLenv var →.infisical.json→ default valueNOTE If this PR is accepted and merged in, I'll issue another PR to update the CLI docs here to include documentation for these changes.
Type ✨
Tests 🛠️
I've added tests to
packages/util/config_test.go. Please let me know if this is the correct location for tests? There seem to be tests in a few different places.(disclosure: I was assisted by AI when authoring this contribution, as go is not a language I am fully proficient in)