Skip to main content

A high-performance CLI for Google Cloud Context & ADC Switching

Project description

🌙 Gloom

High-performance CLI for Google Cloud Context & ADC Switching

CI Python 3.10+ License: MIT

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:

  1. Caches your ADC file to ~/.gloom/cache/<project>/adc.json
  2. Symlinks ~/.config/gcloud/application_default_credentials.json to the cached file
  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gloom_cli-0.2.0.tar.gz (80.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gloom_cli-0.2.0-py3-none-any.whl (25.8 kB view details)

Uploaded Python 3

File details

Details for the file gloom_cli-0.2.0.tar.gz.

File metadata

  • Download URL: gloom_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 80.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gloom_cli-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e4007e8c9e97c54fd552f085930569a4da41a81010ec13cba4083d2a49c222ed
MD5 dbd4aee237bd0292539a178e472e4ee3
BLAKE2b-256 f9c38a59d602160c3c1f9e3ebbd343c01dcb5c77587f366383387e696693d395

See more details on using hashes here.

Provenance

The following attestation bundles were made for gloom_cli-0.2.0.tar.gz:

Publisher: release.yml on hilmanmustofaa/gloom

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gloom_cli-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: gloom_cli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 25.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gloom_cli-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2bed5bf51a55ac96f95241c6a8fcda9523ab52e7478b6a0351af3e7a174223d7
MD5 5e1cbe3af965757b4a3040280e608ee5
BLAKE2b-256 6551288dab9609962296700cdab328898c3a0edef29d255cc93a239c9fe37048

See more details on using hashes here.

Provenance

The following attestation bundles were made for gloom_cli-0.2.0-py3-none-any.whl:

Publisher: release.yml on hilmanmustofaa/gloom

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page