gsp

Crates.iogsp
lib.rsgsp
version0.1.5
sourcesrc
created_at2023-03-06 19:06:13.678881
updated_at2024-06-20 07:49:50.169308
descriptionSimple CLI to switch between gcloud projects.
homepagehttps://github.com/BapRx/gsp
repositoryhttps://github.com/BapRx/gsp
max_upload_size
id802890
size66,687
Baptiste Roux (BapRx)

documentation

README

gsp

A CLI tool to easily switch between Google gcloud projects inspired by the late gsp.

This is more a pretext to play with Rust than anything else but I use this tool a lot and I will continue to maintain it.

Usage

❯ gsp help
Simple CLI to switch between gcloud projects.


Usage: gsp [OPTIONS] [PROJECT] [COMMAND]

Commands:
  current               Print the project which currently used
  list                  List the available projects
  refresh               Refresh the list of available projects
  generate-completions  Generate shell completions
  help                  Print this message or the help of the given subcommand(s)

Arguments:
  [PROJECT]  Part or entire project ID

Options:
      --log-level <LOG_LEVEL>  Set the log level [default: INFO] [possible values: TRACE, DEBUG, INFO, WARN, ERROR]
      --refresh                Force a cache refresh then run the requested command
  -h, --help                   Print help
  -V, --version                Print version

Cache

A cache file is created in order to avoid refreshing the project list every time. The file is stored at ~/.cache/gsp/projects.json

The cache contains the list of available projects and can be refeshed by using the gsp refresh command or by adding the --refresh argument to any other command:

❯ gsp list --refresh
[INFO] The cache was successfully refreshed.
+----------------------------------+----------------+--------------------------------+
| Project ID                       | Project number | Project name                   |
+==================================+================+================================+
| dummy-example-project            | 902838561285   | Example Project                |
+----------------------------------+----------------+--------------------------------+

Generate completions

gsp generate-completions --shell zsh > ${ZSH}/completions/_gsp
Commit count: 161

cargo fmt