Skip to content

nitinchouhan1/cloudctl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cloudctl

cloudctl is a Go CLI for managing common AWS and GCP resources from one command line:

  • Authenticate to AWS or GCP
  • List, create, and delete storage buckets
  • List, create, delete, and inspect container registries / repositories
  • Keep a small local config with your active provider and default GCP project

Features

  • AWS support for S3 buckets and ECR repositories
  • GCP support for Cloud Storage buckets and Artifact Registry repositories
  • Browser-based GCP login flow
  • Local config stored at ~/.cloudctl/config.yaml
  • Provider selection through --provider or the saved current provider

Requirements

  • Go 1.25 or newer
  • Access to the AWS or GCP account you want to manage
  • A browser available on the machine if you want to use cloudctl auth login gcp

Install

From source:

go build -o cloudctl .

Then run it directly:

./cloudctl --help

If you want the command available everywhere, move the binary onto your PATH.

Quick Start

  1. Log in to a provider.
  2. Optionally set your default GCP project.
  3. Run bucket or registry commands.

AWS login

cloudctl auth login aws

You will be prompted for:

  • AWS Access Key ID
  • AWS Secret Access Key
  • AWS Region

GCP login

cloudctl auth login gcp

This opens a browser window and completes an OAuth login flow.

Set a default GCP project

cloudctl auth config set-project my-gcp-project

View current config

cloudctl auth config show

Commands

Auth

cloudctl auth login [aws|gcp]
cloudctl auth config set-project [project-id]
cloudctl auth config show

Buckets

cloudctl bucket list
cloudctl bucket create [bucket-name]
cloudctl bucket delete [bucket-name]
cloudctl bucket list-objects [bucket-name]

Common flags:

  • --provider aws|gcp
  • --project <gcp-project-id> for GCP bucket commands
  • --region <region-or-location> for provider-specific location handling
  • --force to empty the bucket before deleting it
  • --yes or -y to skip delete confirmation

Examples:

cloudctl bucket list --provider aws
cloudctl bucket list --provider gcp --project my-gcp-project
cloudctl bucket create my-bucket --provider aws --region us-east-1
cloudctl bucket create my-bucket --provider gcp --project my-gcp-project --region us-central1
cloudctl bucket list-objects my-bucket --provider gcp --project my-gcp-project

Registries

cloudctl registry list
cloudctl registry create [repo-name]
cloudctl registry delete [repo-name]
cloudctl registry list-images [repo-name]

Common flags:

  • --provider aws|gcp
  • --project <gcp-project-id> for GCP registry commands
  • --region <region-or-location>
  • --format <artifact-format> for GCP repository creation, defaulting to DOCKER
  • --force to delete AWS repositories after removing images
  • --yes or -y to skip delete confirmation

Examples:

cloudctl registry list --provider aws
cloudctl registry list --provider gcp --project my-gcp-project
cloudctl registry create my-repo --provider aws --region us-east-1
cloudctl registry create my-repo --provider gcp --project my-gcp-project --region us-central1 --format DOCKER
cloudctl registry list-images my-repo --provider gcp --project my-gcp-project --region us-central1

Configuration

cloudctl stores its config in:

~/.cloudctl/config.yaml

That file tracks:

  • The current active provider
  • Saved AWS credentials and region
  • Saved GCP refresh token
  • The default GCP project, if you set one

Notes

  • If no provider is passed on a command, cloudctl uses the current provider saved by the last successful login.
  • If you have not set a current provider, pass --provider explicitly or run cloudctl auth login.
  • GCP bucket and registry commands generally need a project ID. You can pass --project or set a default with cloudctl auth config set-project.

Build

go build ./...

License

See LICENSE for licensing information.

About

cloudctl is a Go CLI for managing common AWS and GCP resources

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages