A CLI tool to make GCP and Kubernetes workflows easy. gcpeasy streamlines working with Google Cloud Platform and Kubernetes infrastructure by providing simple commands for common development workflows. It eliminates the need to remember complex kubectl and gcloud commands and automates environment switching.
- Features
- Prerequisites
- Installation
- Quick Start
- Commands
- Usage Patterns
- How It Works
- Project Structure
- Contributing
- License
- π Authentication: Simple GCP authentication setup
- π Environment Management: Switch between GCP projects with ease
- βοΈ Cluster Management: Manage and switch between GKE clusters
- π³ Pod Operations: Interactive pod selection and management
- π Rails Support: Direct Rails console and log access
- π» Shell Access: Connect to pod shells with automatic fallback
- π Status Overview: View pod status and cluster information
- Google Cloud SDK (gcloud)
- Google Cloud Auth Plugin:
gcloud components install gke-gcloud-auth-plugin - kubectl
- Access to GCP projects and GKE clusters
- Go 1.19+ (for building from source)
Download the latest release for your platform from the releases page.
# AMD64
curl -L https://github.com/your-username/gcpeasy/releases/latest/download/gcpeasy-linux-amd64.tar.gz | tar xz
sudo mv gcpeasy-linux-amd64 /usr/local/bin/gcpeasy
# ARM64
curl -L https://github.com/your-username/gcpeasy/releases/latest/download/gcpeasy-linux-arm64.tar.gz | tar xz
sudo mv gcpeasy-linux-arm64 /usr/local/bin/gcpeasy# Intel Macs
curl -L https://github.com/your-username/gcpeasy/releases/latest/download/gcpeasy-macos-amd64.tar.gz | tar xz
sudo mv gcpeasy-macos-amd64 /usr/local/bin/gcpeasy
# Apple Silicon Macs
curl -L https://github.com/your-username/gcpeasy/releases/latest/download/gcpeasy-macos-arm64.tar.gz | tar xz
sudo mv gcpeasy-macos-arm64 /usr/local/bin/gcpeasyDownload gcpeasy-windows-amd64.zip from the releases page and extract the executable.
# Clone the repository
git clone <repository-url>
cd gcpeasy
# Build the binary
go build -o gcpeasy
# (Optional) Add to PATH
mv gcpeasy /usr/local/bin/gcpeasy --version-
Authenticate with Google Cloud:
gcpeasy login
-
Select your environment (GCP project):
gcpeasy env list gcpeasy env select -
Select your cluster:
gcpeasy cluster list gcpeasy cluster select -
Start using the tools:
gcpeasy pod list --status # List all pods with detailed status gcpeasy logs # View pod logs (shortcut) gcpeasy shell # Get shell access to a pod (shortcut) gcpeasy rails console # Access Rails console
gcpeasy login- Authenticate with Google Cloudgcpeasy logout- Logout from Google Cloud
gcpeasy env list- List available GCP projects--status- Include connectivity status (slower)
gcpeasy env select [project]- Switch to a different project- Interactive selection if no project specified
- Supports selection by project ID, name, or number
gcpeasy cluster list- List available GKE clustersgcpeasy cluster select [cluster]- Switch to a different cluster- Interactive selection if no cluster specified
- Supports selection by cluster name or number
gcpeasy pod list- List application pods (simple format)gcpeasy pod list --status- List pods with detailed status informationgcpeasy pod logs- View pod logs with filtering options-f, --follow- Follow logs in real-time-e, --error- Show only error logs-w, --warn- Show only warning logs-i, --info- Show only info logs-d, --debug- Show only debug logs
gcpeasy pod shell- Open interactive shell on selected pod- Tries bash, zsh, sh in order of preference
gcpeasy logs- Shortcut forpod logsgcpeasy shell- Shortcut forpod shell
gcpeasy rails console(orgcpeasy rails c) - Access Rails consolegcpeasy rails logs- View Rails application logs (deprecated: usegcpeasy pod logs)- Same flags as
pod logs
- Same flags as
Most commands support interactive selection with numbered lists:
$ gcpeasy env list
Available environments:
- [ ] 1. project-dev (Development Project)
- [x] 2. project-staging (Staging Project)
- [ ] 3. project-prod (Production Project)
$ gcpeasy cluster select
β
Found 2 clusters:
1. dev-cluster (us-central1)
2. prod-cluster (us-east1)
Select cluster (number, or 'q' to quit): 1Commands also support direct selection by name or number:
gcpeasy env select 2 # Select by number
gcpeasy env select project-prod # Select by project ID
gcpeasy cluster select prod-cluster # Select by cluster namegcpeasy respects and manages your current context:
- Project context: Set with
gcpeasy env select, used by all commands - Cluster context: Set with
gcpeasy cluster select, configures kubectl - Smart defaults: Auto-selects when only one option available
- If kubectl is configured and working β uses current context
- If kubectl not configured β prompts for cluster selection and configures kubectl
- Use
gcpeasy cluster selectto explicitly change clusters
- If only 1 project accessible β auto-selects
- If multiple projects β prompts for selection
- Use
gcpeasy env selectto change projects
- Shows only application pods (filters out system namespaces)
- Displays running pods and pods with issues for debugging
- Consistent numbered selection across all pod-related commands
gcpeasy/
βββ cmd/ # CLI commands
β βββ root.go # Root command and global flags
β βββ auth.go # Authentication commands (login/logout)
β βββ env.go # Environment/project management
β βββ cluster.go # Cluster management
β βββ pod.go # Pod management commands
β βββ logs.go # Logs shortcut command
β βββ shell.go # Shell shortcut command
β βββ rails.go # Rails-specific commands
βββ internal/ # Internal packages
β βββ kubernetes.go # Kubernetes cluster operations
β βββ pod.go # Pod operations and selection
βββ main.go # Application entry point
βββ README.md # This file
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.