Skip to content

Instantly share code, notes, and snippets.

@fqdeng
Forked from EvgeniGordeev/datagrip-copy-pwd.py
Created June 11, 2025 07:00
Show Gist options
  • Save fqdeng/fe697fcacb4b4c6fad36defd1e65f0b3 to your computer and use it in GitHub Desktop.
Save fqdeng/fe697fcacb4b4c6fad36defd1e65f0b3 to your computer and use it in GitHub Desktop.
Reveal DataGrip passwords saved in Keychain
import re
import subprocess
if __name__ == '__main__':
# located in project folder .idea/dataSources.xml
with open('dataSources.xml', 'r') as f:
data = f.read()
data_sources = sorted(re.findall(r".*data-source.*name=\"(.*?)\".*uuid=\"(.*?)\".*", data))
for name, uuid in data_sources:
command = f'security find-generic-password -l "IntelliJ Platform DB — {uuid}" -w'
result = subprocess.run(command, shell=True, capture_output=True, text=True)
print(f"{name}={result.stdout.strip()}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment