{"id":49516349,"url":"https://github.com/hu553in/dbeaver-gcloud-free","last_synced_at":"2026-05-01T22:03:06.690Z","repository":{"id":350103872,"uuid":"1203809082","full_name":"hu553in/dbeaver-gcloud-free","owner":"hu553in","description":"Free local alternative to DBeaver's paid Google Cloud token flow.","archived":false,"fork":false,"pushed_at":"2026-05-01T13:05:29.000Z","size":171,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-01T14:25:54.571Z","etag":null,"topics":["access-token","auth","cli","database","database-tools","dbeaver","developer-tools","gcloud","google-cloud","postgresql","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hu553in.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-04-07T12:01:18.000Z","updated_at":"2026-05-01T13:05:32.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/hu553in/dbeaver-gcloud-free","commit_stats":null,"previous_names":["hu553in/dbeaver-gcloud-free"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hu553in/dbeaver-gcloud-free","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hu553in%2Fdbeaver-gcloud-free","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hu553in%2Fdbeaver-gcloud-free/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hu553in%2Fdbeaver-gcloud-free/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hu553in%2Fdbeaver-gcloud-free/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hu553in","download_url":"https://codeload.github.com/hu553in/dbeaver-gcloud-free/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hu553in%2Fdbeaver-gcloud-free/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32514340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["access-token","auth","cli","database","database-tools","dbeaver","developer-tools","gcloud","google-cloud","postgresql","python"],"created_at":"2026-05-01T22:03:06.133Z","updated_at":"2026-05-01T22:03:06.678Z","avatar_url":"https://github.com/hu553in.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Free Google Cloud token flow for DBeaver Community\n\n[![CI](https://github.com/hu553in/dbeaver-gcloud-free/actions/workflows/ci.yml/badge.svg)](https://github.com/hu553in/dbeaver-gcloud-free/actions/workflows/ci.yml)\n\nA free local alternative to DBeaver's paid Google Cloud token flow. It opens a **temporary DBeaver\nconnection** using a fresh token from `gcloud auth print-access-token`.\n\nIt is meant for setups where a Google Cloud access token can be used as the database password\nand DBeaver does not handle that flow directly.\n\n## What it does\n\n- Reads local YAML config files\n- Prompts for a config, environment, and database\n- Fetches a fresh Google Cloud access token\n- Starts DBeaver with a temporary connection\n\nThe tool does not modify saved DBeaver connections or store tokens in its own config.\n\n## Requirements\n\n- Python 3.13+\n- `uv`\n- DBeaver installed locally\n- `gcloud` available in `PATH`\n- a valid Google Cloud login session\n- network access to the target database host\n\nAdditional requirements for specific workflows:\n\n- `git` - required for `uv tool install git+...` and `uvx --from git+...`\n- `make` - required for `make install-deps` and `make check`\n\n## Configuration\n\nConfig files are discovered from:\n\n```text\n~/.config/dbeaver-gcloud-free/*.y*ml\n```\n\n### Example config\n\n```yaml\ndb-driver: postgresql\ndbeaver-bin: /Applications/DBeaver.app/Contents/MacOS/dbeaver\n\nenvs:\n  - name: dev\n    ip: 10.15.20.25\n    port: 5432\n  - name: test\n    ip: 10.15.20.26\n    port: 5432\n\nuser: awesome.user@gmail.com\n\ndatabases:\n  - some-db\n  - another-db\n\nshow-all-dbs: true\n```\n\n### Config fields\n\n| Name           | Required | Default                                            | Description                                                |\n| -------------- | -------- | -------------------------------------------------- | ---------------------------------------------------------- |\n| `db-driver`    | No       | `postgresql`                                       | DBeaver driver ID                                          |\n| `dbeaver-bin`  | No       | `/Applications/DBeaver.app/Contents/MacOS/dbeaver` | Path to the DBeaver executable                             |\n| `envs`         | Yes      | -                                                  | Non-empty list of environments                             |\n| `user`         | Yes      | -                                                  | Database username passed to DBeaver                        |\n| `databases`    | Yes      | -                                                  | Non-empty list of database names                           |\n| `show-all-dbs` | No       | `false`                                            | Enables DBeaver's PostgreSQL \"show all databases\" property |\n\nEach environment must contain:\n\n- `name`\n- `ip`\n- `port`\n\n## Installation\n\n### `uv tool`\n\nUseful commands:\n\n```bash\nuv tool install .\nuv tool install git+https://github.com/hu553in/dbeaver-gcloud-free.git\ndbgc\nuv tool upgrade dbeaver-gcloud-free\nuv tool uninstall dbeaver-gcloud-free\n```\n\n### `uvx`\n\nUseful commands:\n\n```bash\nuvx --from . dbgc\nuvx --from git+https://github.com/hu553in/dbeaver-gcloud-free.git dbgc\n```\n\n### Development checkout\n\nUseful commands:\n\n```bash\nmake install-deps\nuv run python3 main.py\nmake check\n```\n\nOr with plain `python3` and `pip`:\n\n```bash\npython3 -m venv .venv\nsource .venv/bin/activate\npython3 -m pip install questionary pyyaml pydantic\npython3 main.py\n```\n\n## Execution flow\n\n1. Find config files in `~/.config/dbeaver-gcloud-free/*.y*ml`\n2. Ask which config to use\n3. Ask which environment to use\n4. Ask which database to use\n5. Run `gcloud auth print-access-token`\n6. Start DBeaver with `-con`\n\n## Runtime behavior\n\n### Temporary connections only\n\nThe launcher always creates a temporary DBeaver connection:\n\n```text\nsave=false\n```\n\nIt does not overwrite saved DBeaver profiles.\n\n### Token source\n\nThe token is taken from:\n\n```bash\ngcloud auth print-access-token\n```\n\nThis requires an active `gcloud` authentication session.\n\n### Validation\n\nThe config schema is validated with Pydantic.\n\nInvalid configs fail early, for example when:\n\n- `envs` is missing or empty\n- `user` is missing or empty\n- `databases` is missing or empty\n- `port` is outside `1..65535`\n\n## Example command\n\nThe script builds a command like this:\n\n```text\ndbeaver -con \"driver=postgresql|host=10.15.20.25|port=5432|database=some-db|user=awesome.user@gmail.com|password=\u003cfresh-token\u003e|name=GCloud: dev / 10.15.20.25:5432 / some-db|save=false|connect=true\"\n```\n\nIf `show-all-dbs: true` is enabled, the corresponding DBeaver connection property is added as well.\n\n## Notes\n\n- The tool assumes the target database auth flow accepts `gcloud auth print-access-token` as the password.\n- It does not verify network reachability before opening DBeaver.\n- It does not manage token refresh after DBeaver starts.\n- It is local and single-user in scope.\n- The token is passed to DBeaver as part of the launch arguments, so treat the local machine\n  and user session as sensitive.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhu553in%2Fdbeaver-gcloud-free","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhu553in%2Fdbeaver-gcloud-free","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhu553in%2Fdbeaver-gcloud-free/lists"}