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.1.0.tar.gz (23.0 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.1.0-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

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

Hashes for gloom_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 32c828d4fcd323c3f8d9522de1ca19b61c5657a517cf201de1171091d9689f23
MD5 1b05dc39559e3d3a1361f67024953c5b
BLAKE2b-256 385235563bb47284b9d6f4789225b9489a08384d38433858787aea51e1174869

See more details on using hashes here.

Provenance

The following attestation bundles were made for gloom_cli-0.1.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.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

Hashes for gloom_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 17f768399c3316d19def4ef973e73dd8e1c563495148c486ae88cedfc0b030d3
MD5 9ebfb6678a4732c0839108eb2299f668
BLAKE2b-256 3fafbb8e8ac5923c8bf1ad72725cc43bb86a699000c2c350bd11d789f906fa5e

See more details on using hashes here.

Provenance

The following attestation bundles were made for gloom_cli-0.1.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