feat: adding json flag to config:get command#3464
Merged
Merged
Conversation
michaelmalave
added a commit
that referenced
this pull request
Jan 14, 2026
* chore(deps): bump qs from 6.14.0 to 6.14.1 (#3444) Bumps [qs](https://github.com/ljharb/qs) from 6.14.0 to 6.14.1. - [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md) - [Commits](ljharb/qs@v6.14.0...v6.14.1) --- updated-dependencies: - dependency-name: qs dependency-version: 6.14.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * feat: adding json flag to config:get command (#3464) adding json flag and applicable tests to handle null and empty string config --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.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.
Summary
Adds a
--jsonflag to theconfig:getcommand that outputs structured JSON, allowing users to distinguish between unset config vars (outputsnull) and empty string config vars (outputs""). This addresses the issue where both cases previously returned empty output, making them indistinguishable. The implementation follows existing patterns in the codebase and maintains full backward compatibility.Type of Change
Note: Add a
!after your change type to denote a breaking change.Testing
Add 2 variables to a new app. One to unset and one as an empty string
Expected output:

Additional Context
Previously,
heroku config:get KEYcould not distinguish between:Both scenarios returned empty output, making it impossible to determine the actual state. The new
--jsonflag provides structured output:{"key": "KEY", "value": null}{"key": "KEY", "value": ""}{"key": "KEY", "value": "value"}For multiple keys, the output is an array of objects. The implementation follows the same pattern as
config --jsonand useshux.styledJSON()for consistent formatting. Default behavior remains unchanged for backward compatibility.Related Issue
Closes #3450
W-20875855