I'm working on several gcloud projects and I'm tired of having to type out --project XYZ every time I need to call a command, or worse having the command execute on the wrong project if I forget to add that in.
gcloud: is it possible to change the default project based on the current folder?
627 views Asked by pandasEverywhere At
1
There are 1 answers
Related Questions in BASH
- When does Bash read heredocs?
- Why `set -o pipefail` gives different output even though the pipe is not failing
- Run an external command within jq to manipulate each values of a particular key
- API key 401 error in .env.development file
- How to "Enable mobile data" on a Huawei E3372 4G USB dongle using a bash script in Windows
- ImageMagick / Bash : pipe ignored(?) when filename format variable used
- MacOS Bash-Script: while read p and echo
- Parse command line arguments and write useful usage message without additional code
- JQ JSON - Values to Array
- why variable substitution is so different?
- postbank_pdf2csv: how to setup with Cygwin in Windows?
- Custom Bash functions & custom statements - Need some advice
- unexpected operator == in square brackets when trying to use gum lib
- How to disable a bash builtin inside a docker container
- Use sed or rename find series of alphabet then replace with with the same alphabet and a dash -
Related Questions in CONFIG
- Setting up the version control of .dotfiles while the .config is connected to a forked repo
- Filter input metrics in vmagent (prometheus)
- Can't remotely connect to my postgresql database on digitalocean
- jest config - Cannot find module
- Too many levels of symbolic links nvim
- How can I fix nginx to run my react website?
- Configuring NGINX and OCSP Dedicated Private Server
- BizTalk is picking up the machine.config file instead of the External config file in BizTalk Configuration File Configuration file
- Buffer viewer says "failed to load config file" in Tosca Commander
- Cludflare ssl/tls nginx "ERR_SSL_VERSION_OR_CIPHER_MISMATCH" Error
- Connection Strings in different .NET versions config
- TWA app crash because of java.lang.ClassNotFoundException: Didn't find class "androidx.browser.trusted.LauncherActivity"
- Brownie cannot get networks via alchemy in project brownie-config.yaml
- How to reset device setting in a single test in Playwright
- "Uncaught Error: Config file /config/runtime.json cannot be read." in console
Related Questions in GCLOUD
- Permission 'storage.buckets.get' denied on resource (or it may not exist)
- ERROR: (gcloud.endpoints.services.deploy) INVALID_ARGUMENT: Cannot convert to service config
- Google API NodeJS - Getting 401 Unauthorized Error on Subsequent Runs After Successful OAuth2
- Problem using service accounts in gke deployment
- How to connect docker container to vpn site to site
- Is there anyway of setting datastore to use firebase firestore emulator? i.e Datastore in native mode
- ModuleNotFoundError: No module named 'main' in Flask application deployed on gcloud
- gcloud.app.deploy Error Response: [13] default Cloud Build service account or user-specified service account does not have access to the bucket
- GCP Java dev_appserver Can't make API call memcache.Get in a thread that is neither the original request thread nor a thread created by ThreadManager
- Google Sign-In for iOS and OAuth
- gcloud CLI: use IPv4 only
- Configure Lens with GKE cluster - gke_gcloud_auth_plugin issue
- Google recaptcha enterprise: Your default credentials were not found
- Configuring podman on google cloud server for deployment
- Google cloud shows persistent disk SSD is full, wherease I do not have anything deployed currently
Related Questions in DIRENV
- direnv cannot be removed by ```snap direnv remove```
- Trying to start an IHP application but devenv and direnv are giving me errors
- Deactivate manually a virtual environment activated by direnv without leaving the project directory or shell
- Activating a pyenv virtual environment with direnv
- direnv runs in emulated x86_64 environment
- Terraform init: Error: failed to open temporary file with direnv
- How to back to normal terminal setting after changing with prompt color
- direnv with WSL2 - not loading files when used with source_env_if_exists
- understand linux shell hooks as used by direnv
- asdf errors when starting Linux shell
- Why is the variable PS1 a problem for direnv when sourcing venv
- Can not get asdf-direnv work in docker when building
- How do I execute commands serially inside a shell script?
- How can I install GRPCIO on an Apple M1 Silicon laptop?
- Why is direnv failing to read my zsh/fish/elvish/tcsh script?
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Yes, by using gcloud configurations together with direnv.
Create a configuration (this will also activate it):
gcloud config configurations create <cool_new_config>gcloud config set project <project>Install
direnv. Hook it into your shell. With bash I used~/.bash_profileinstead of directed~/.bashrc.Navigate to the project folder where you want the switch to occur.
export CLOUDSDK_ACTIVE_CONFIG_NAME=<cool_new_config>direnv allowVerify functionality:
gcloud config configurations listOptional: rebuild the rest of the configuration
gcloud config configurations listgcloud config configurations describe <default>gcloud auth logingcloud config set compute/region <us-central1>gcloud config set compute/zone <us-central1-a>