A high-performance CLI for Google Cloud Context & ADC Switching
Project description
🌙 Gloom
High-performance CLI for Google Cloud Context & ADC Switching
Gloom manages gcloud configurations and Application Default Credentials (ADC) via symlink manipulation, enabling sub-100ms context switching between Google Cloud projects.
✨ Features
- ⚡ Instant Switching - Symlink-based ADC switching in <100ms (vs 5-15s for
gcloud auth) - 🔒 Secure - Cached credentials stored with 0600 permissions
- 🔄 Atomic Operations - Safe symlink switching prevents partial states
- 📦 Zero Re-authentication - Cache ADC per-project, switch without re-login
- 🐚 Shell Integration - Prompt hooks for bash, zsh, fish, PowerShell
🚀 Quick Start
Installation
# With pip
pip install gloom
# With uv (recommended)
uv pip install gloom
# From source
git clone https://github.com/hilmanmustofaa/gloom.git
cd gloom
uv sync --dev
Basic Usage
# Cache your current ADC as a named context
gcloud auth application-default login # authenticate first
gloom cache add production
# Switch to a different project, authenticate, and cache
gcloud auth application-default login --project other-project
gloom cache add staging
# List cached contexts
gloom list
# Switch between contexts instantly
gloom switch production
gloom switch staging
# Show current context
gloom current
📖 Commands
Core Commands
| Command | Description |
|---|---|
gloom list |
List all cached ADC contexts |
gloom switch <name> |
Switch to a cached context |
gloom current |
Show the current ADC context |
Cache Management
| Command | Description |
|---|---|
gloom cache add <name> |
Cache current ADC as named context |
gloom cache add <name> -s <path> |
Cache ADC from specific file |
gloom cache remove <name> |
Remove a cached context |
gloom cache list |
List cached contexts (alias) |
gcloud Configuration
| Command | Description |
|---|---|
gloom config list |
List gcloud named configurations |
gloom config activate <name> |
Activate a gcloud configuration |
🔧 How It Works
Instead of re-authenticating with gcloud auth application-default login each time you switch projects, Gloom:
- Caches your ADC file to
~/.gloom/cache/<project>/adc.json - Symlinks
~/.config/gcloud/application_default_credentials.jsonto the cached file - Switches contexts by atomically updating the symlink
~/.gloom/cache/
├── production/adc.json
├── staging/adc.json
└── development/adc.json
~/.config/gcloud/application_default_credentials.json
→ symlink to → ~/.gloom/cache/production/adc.json
🔐 Security
- Cached credentials are stored with 0600 permissions (owner read/write only)
- Cache directory has 0700 permissions
- Pre-commit hooks prevent accidental secret commits
- Audit logging tracks all context switches
🛠️ Development
# Clone and setup
git clone https://github.com/hilmanmustofaa/gloom.git
cd gloom
uv sync --dev
# Install pre-commit hooks
pre-commit install
# Run tests
uv run pytest
# Run linting
uv run ruff check .
uv run ruff format --check .
# Run type checking
uv run mypy src/gloom/
📄 License
MIT License - see LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gloom_cli-0.1.0.tar.gz.
File metadata
- Download URL: gloom_cli-0.1.0.tar.gz
- Upload date:
- Size: 23.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32c828d4fcd323c3f8d9522de1ca19b61c5657a517cf201de1171091d9689f23
|
|
| MD5 |
1b05dc39559e3d3a1361f67024953c5b
|
|
| BLAKE2b-256 |
385235563bb47284b9d6f4789225b9489a08384d38433858787aea51e1174869
|
Provenance
The following attestation bundles were made for gloom_cli-0.1.0.tar.gz:
Publisher:
release.yml on hilmanmustofaa/gloom
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gloom_cli-0.1.0.tar.gz -
Subject digest:
32c828d4fcd323c3f8d9522de1ca19b61c5657a517cf201de1171091d9689f23 - Sigstore transparency entry: 787803664
- Sigstore integration time:
-
Permalink:
hilmanmustofaa/gloom@cc68b0980fe54c5dacdd45a058e04b6e5e2bb28d -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/hilmanmustofaa
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cc68b0980fe54c5dacdd45a058e04b6e5e2bb28d -
Trigger Event:
push
-
Statement type:
File details
Details for the file gloom_cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gloom_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17f768399c3316d19def4ef973e73dd8e1c563495148c486ae88cedfc0b030d3
|
|
| MD5 |
9ebfb6678a4732c0839108eb2299f668
|
|
| BLAKE2b-256 |
3fafbb8e8ac5923c8bf1ad72725cc43bb86a699000c2c350bd11d789f906fa5e
|
Provenance
The following attestation bundles were made for gloom_cli-0.1.0-py3-none-any.whl:
Publisher:
release.yml on hilmanmustofaa/gloom
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gloom_cli-0.1.0-py3-none-any.whl -
Subject digest:
17f768399c3316d19def4ef973e73dd8e1c563495148c486ae88cedfc0b030d3 - Sigstore transparency entry: 787803666
- Sigstore integration time:
-
Permalink:
hilmanmustofaa/gloom@cc68b0980fe54c5dacdd45a058e04b6e5e2bb28d -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/hilmanmustofaa
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cc68b0980fe54c5dacdd45a058e04b6e5e2bb28d -
Trigger Event:
push
-
Statement type: