Skip to content

fix: bad settings file errors and config list showing api key#19

Open
mooncitydev wants to merge 1 commit intojup-ag:mainfrom
mooncitydev:fix-config-json-and-list
Open

fix: bad settings file errors and config list showing api key#19
mooncitydev wants to merge 1 commit intojup-ag:mainfrom
mooncitydev:fix-config-json-and-list

Conversation

@mooncitydev
Copy link
Copy Markdown

@mooncitydev mooncitydev commented Apr 26, 2026

hey jup team, its mooncitydev, looked at the config path for a bit and had two things that felt worth a pr

bad settings.json

if the file is corrupt or only half edited, JSON.parse was throwing a raw SyntaxError and every jup subcommand would die with a stack and no file path, so it wasnt obvious you could just delete the file and get defaults again. load() now catches parse errors and throws a short message with the real path and that you can remove the file to reset

jup config list and the portal api key

config list was printing the full jup api key in both table and json, which is rough for screen shares, logs, or when pasting output somewhere. the key is still in ~/.config/jup/settings.json for anything that needs to read the file, but the list output now uses the string when a key is present so the secret does not get echoed

also added src/lib/Config.test.ts for the parse failure and a root json edge case. cheers

hey jup team, mooncitydev here, did a pass on the config path and found two things worth fixing

first is settings.json: if the file is corrupt or only half edited, JSON.parse threw a raw SyntaxError and every subcommand failed with a stack dump and no file path, so it was not obvious to delete the file and reset. load() now wraps parse in try/catch and throws a short message with the real path and option to remove the file for defaults

second is jup config list: it printed the full portal api key in both table and json, which is easy to leak in screen shares, logs, or when pasting output. the key is still in ~/.config/jup/settings.json for tools that need it, but list now shows a token is set using the literal <set> instead of the real string

adds config.test for the parse failure and a couple edge cases. cheers

Made-with: Cursor
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.

1 participant